UNPKG

@google-cloud/dialogflow-cx

Version:
727 lines (670 loc) 16 MB
// 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_cloud_dialogflow_cx_protos || ($protobuf.roots._google_cloud_dialogflow_cx_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.cloud = (function() { /** * Namespace cloud. * @memberof google * @namespace */ var cloud = {}; cloud.dialogflow = (function() { /** * Namespace dialogflow. * @memberof google.cloud * @namespace */ var dialogflow = {}; dialogflow.cx = (function() { /** * Namespace cx. * @memberof google.cloud.dialogflow * @namespace */ var cx = {}; cx.v3 = (function() { /** * Namespace v3. * @memberof google.cloud.dialogflow.cx * @namespace */ var v3 = {}; v3.AdvancedSettings = (function() { /** * Properties of an AdvancedSettings. * @memberof google.cloud.dialogflow.cx.v3 * @interface IAdvancedSettings * @property {google.cloud.dialogflow.cx.v3.IGcsDestination|null} [audioExportGcsDestination] AdvancedSettings audioExportGcsDestination * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null} [speechSettings] AdvancedSettings speechSettings * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null} [dtmfSettings] AdvancedSettings dtmfSettings * @property {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null} [loggingSettings] AdvancedSettings loggingSettings */ /** * Constructs a new AdvancedSettings. * @memberof google.cloud.dialogflow.cx.v3 * @classdesc Represents an AdvancedSettings. * @implements IAdvancedSettings * @constructor * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings=} [properties] Properties to set */ function AdvancedSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AdvancedSettings audioExportGcsDestination. * @member {google.cloud.dialogflow.cx.v3.IGcsDestination|null|undefined} audioExportGcsDestination * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @instance */ AdvancedSettings.prototype.audioExportGcsDestination = null; /** * AdvancedSettings speechSettings. * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings|null|undefined} speechSettings * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @instance */ AdvancedSettings.prototype.speechSettings = null; /** * AdvancedSettings dtmfSettings. * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings|null|undefined} dtmfSettings * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @instance */ AdvancedSettings.prototype.dtmfSettings = null; /** * AdvancedSettings loggingSettings. * @member {google.cloud.dialogflow.cx.v3.AdvancedSettings.ILoggingSettings|null|undefined} loggingSettings * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @instance */ AdvancedSettings.prototype.loggingSettings = null; /** * Creates a new AdvancedSettings instance using the specified properties. * @function create * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings=} [properties] Properties to set * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings instance */ AdvancedSettings.create = function create(properties) { return new AdvancedSettings(properties); }; /** * Encodes the specified AdvancedSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. * @function encode * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings} message AdvancedSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AdvancedSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.audioExportGcsDestination != null && Object.hasOwnProperty.call(message, "audioExportGcsDestination")) $root.google.cloud.dialogflow.cx.v3.GcsDestination.encode(message.audioExportGcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.speechSettings != null && Object.hasOwnProperty.call(message, "speechSettings")) $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.encode(message.speechSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.dtmfSettings != null && Object.hasOwnProperty.call(message, "dtmfSettings")) $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.encode(message.dtmfSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** * Encodes the specified AdvancedSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {google.cloud.dialogflow.cx.v3.IAdvancedSettings} message AdvancedSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AdvancedSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AdvancedSettings message from the specified reader or buffer. * @function decode * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AdvancedSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 2: { message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.decode(reader, reader.uint32()); break; } case 3: { message.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.decode(reader, reader.uint32()); break; } case 5: { message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.decode(reader, reader.uint32()); break; } case 6: { message.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.decode(reader, reader.uint32()); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AdvancedSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AdvancedSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AdvancedSettings message. * @function verify * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AdvancedSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) { var error = $root.google.cloud.dialogflow.cx.v3.GcsDestination.verify(message.audioExportGcsDestination); if (error) return "audioExportGcsDestination." + error; } if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) { var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify(message.speechSettings); if (error) return "speechSettings." + error; } if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) { var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.verify(message.dtmfSettings); if (error) return "dtmfSettings." + error; } if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { var error = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.verify(message.loggingSettings); if (error) return "loggingSettings." + error; } return null; }; /** * Creates an AdvancedSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {Object.<string,*>} object Plain object * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings} AdvancedSettings */ AdvancedSettings.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings) return object; var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings(); if (object.audioExportGcsDestination != null) { if (typeof object.audioExportGcsDestination !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.audioExportGcsDestination: object expected"); message.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.fromObject(object.audioExportGcsDestination); } if (object.speechSettings != null) { if (typeof object.speechSettings !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.speechSettings: object expected"); message.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.fromObject(object.speechSettings); } if (object.dtmfSettings != null) { if (typeof object.dtmfSettings !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.dtmfSettings: object expected"); message.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.fromObject(object.dtmfSettings); } if (object.loggingSettings != null) { if (typeof object.loggingSettings !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.loggingSettings: object expected"); message.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.fromObject(object.loggingSettings); } return message; }; /** * Creates a plain object from an AdvancedSettings message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings} message AdvancedSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ AdvancedSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.audioExportGcsDestination = null; object.speechSettings = null; object.dtmfSettings = null; object.loggingSettings = null; } if (message.audioExportGcsDestination != null && message.hasOwnProperty("audioExportGcsDestination")) object.audioExportGcsDestination = $root.google.cloud.dialogflow.cx.v3.GcsDestination.toObject(message.audioExportGcsDestination, options); if (message.speechSettings != null && message.hasOwnProperty("speechSettings")) object.speechSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.toObject(message.speechSettings, options); if (message.dtmfSettings != null && message.hasOwnProperty("dtmfSettings")) object.dtmfSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings.toObject(message.dtmfSettings, options); if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) object.loggingSettings = $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings.toObject(message.loggingSettings, options); return object; }; /** * Converts this AdvancedSettings to JSON. * @function toJSON * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @instance * @returns {Object.<string,*>} JSON object */ AdvancedSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AdvancedSettings * @function getTypeUrl * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AdvancedSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings"; }; AdvancedSettings.SpeechSettings = (function() { /** * Properties of a SpeechSettings. * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @interface ISpeechSettings * @property {number|null} [endpointerSensitivity] SpeechSettings endpointerSensitivity * @property {google.protobuf.IDuration|null} [noSpeechTimeout] SpeechSettings noSpeechTimeout * @property {boolean|null} [useTimeoutBasedEndpointing] SpeechSettings useTimeoutBasedEndpointing * @property {Object.<string,string>|null} [models] SpeechSettings models */ /** * Constructs a new SpeechSettings. * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @classdesc Represents a SpeechSettings. * @implements ISpeechSettings * @constructor * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings=} [properties] Properties to set */ function SpeechSettings(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]]; } /** * SpeechSettings endpointerSensitivity. * @member {number} endpointerSensitivity * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @instance */ SpeechSettings.prototype.endpointerSensitivity = 0; /** * SpeechSettings noSpeechTimeout. * @member {google.protobuf.IDuration|null|undefined} noSpeechTimeout * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @instance */ SpeechSettings.prototype.noSpeechTimeout = null; /** * SpeechSettings useTimeoutBasedEndpointing. * @member {boolean} useTimeoutBasedEndpointing * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @instance */ SpeechSettings.prototype.useTimeoutBasedEndpointing = false; /** * SpeechSettings models. * @member {Object.<string,string>} models * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @instance */ SpeechSettings.prototype.models = $util.emptyObject; /** * Creates a new SpeechSettings instance using the specified properties. * @function create * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings=} [properties] Properties to set * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings instance */ SpeechSettings.create = function create(properties) { return new SpeechSettings(properties); }; /** * Encodes the specified SpeechSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. * @function encode * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SpeechSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.endpointerSensitivity != null && Object.hasOwnProperty.call(message, "endpointerSensitivity")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.endpointerSensitivity); if (message.noSpeechTimeout != null && Object.hasOwnProperty.call(message, "noSpeechTimeout")) $root.google.protobuf.Duration.encode(message.noSpeechTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.useTimeoutBasedEndpointing != null && Object.hasOwnProperty.call(message, "useTimeoutBasedEndpointing")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useTimeoutBasedEndpointing); if (message.models != null && Object.hasOwnProperty.call(message, "models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); return writer; }; /** * Encodes the specified SpeechSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.ISpeechSettings} message SpeechSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SpeechSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SpeechSettings message from the specified reader or buffer. * @function decode * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SpeechSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.endpointerSensitivity = reader.int32(); break; } case 2: { message.noSpeechTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } case 3: { message.useTimeoutBasedEndpointing = reader.bool(); break; } case 5: { if (message.models === $util.emptyObject) message.models = {}; 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.models[key] = value; break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SpeechSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SpeechSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SpeechSettings message. * @function verify * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SpeechSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) if (!$util.isInteger(message.endpointerSensitivity)) return "endpointerSensitivity: integer expected"; if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) { var error = $root.google.protobuf.Duration.verify(message.noSpeechTimeout); if (error) return "noSpeechTimeout." + error; } if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) if (typeof message.useTimeoutBasedEndpointing !== "boolean") return "useTimeoutBasedEndpointing: boolean expected"; if (message.models != null && message.hasOwnProperty("models")) { if (!$util.isObject(message.models)) return "models: object expected"; var key = Object.keys(message.models); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.models[key[i]])) return "models: string{k:string} expected"; } return null; }; /** * Creates a SpeechSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {Object.<string,*>} object Plain object * @returns {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} SpeechSettings */ SpeechSettings.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings) return object; var message = new $root.google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings(); if (object.endpointerSensitivity != null) message.endpointerSensitivity = object.endpointerSensitivity | 0; if (object.noSpeechTimeout != null) { if (typeof object.noSpeechTimeout !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.noSpeechTimeout: object expected"); message.noSpeechTimeout = $root.google.protobuf.Duration.fromObject(object.noSpeechTimeout); } if (object.useTimeoutBasedEndpointing != null) message.useTimeoutBasedEndpointing = Boolean(object.useTimeoutBasedEndpointing); if (object.models) { if (typeof object.models !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings.models: object expected"); message.models = {}; for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) message.models[keys[i]] = String(object.models[keys[i]]); } return message; }; /** * Creates a plain object from a SpeechSettings message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings} message SpeechSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ SpeechSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.models = {}; if (options.defaults) { object.endpointerSensitivity = 0; object.noSpeechTimeout = null; object.useTimeoutBasedEndpointing = false; } if (message.endpointerSensitivity != null && message.hasOwnProperty("endpointerSensitivity")) object.endpointerSensitivity = message.endpointerSensitivity; if (message.noSpeechTimeout != null && message.hasOwnProperty("noSpeechTimeout")) object.noSpeechTimeout = $root.google.protobuf.Duration.toObject(message.noSpeechTimeout, options); if (message.useTimeoutBasedEndpointing != null && message.hasOwnProperty("useTimeoutBasedEndpointing")) object.useTimeoutBasedEndpointing = message.useTimeoutBasedEndpointing; var keys2; if (message.models && (keys2 = Object.keys(message.models)).length) { object.models = {}; for (var j = 0; j < keys2.length; ++j) object.models[keys2[j]] = message.models[keys2[j]]; } return object; }; /** * Converts this SpeechSettings to JSON. * @function toJSON * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @instance * @returns {Object.<string,*>} JSON object */ SpeechSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for SpeechSettings * @function getTypeUrl * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ SpeechSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings"; }; return SpeechSettings; })(); AdvancedSettings.DtmfSettings = (function() { /** * Properties of a DtmfSettings. * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @interface IDtmfSettings * @property {boolean|null} [enabled] DtmfSettings enabled * @property {number|null} [maxDigits] DtmfSettings maxDigits * @property {string|null} [finishDigit] DtmfSettings finishDigit * @property {google.protobuf.IDuration|null} [interdigitTimeoutDuration] DtmfSettings interdigitTimeoutDuration * @property {google.protobuf.IDuration|null} [endpointingTimeoutDuration] DtmfSettings endpointingTimeoutDuration */ /** * Constructs a new DtmfSettings. * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings * @classdesc Represents a DtmfSettings. * @implements IDtmfSettings * @constructor * @param {google.cloud.dialogflow.cx.v3.AdvancedSettings.IDtmfSettings=} [properties] Properties to set */ function DtmfSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DtmfSettings enabled. * @member {boolean} enabled * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings * @instance */ DtmfSettings.prototype.enabled = false; /** * DtmfSettings maxDigits. * @member {number} maxDigits * @memberof google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettings * @instance