From b0da9d78ee05e21a1fe922954abcc3ebee4b8d05 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 18:31:59 -0400 Subject: [PATCH] docs: update the doc on diagnostic info (#265) feat: add audio export settings to security settings docs: update the doc on diagnostic info PiperOrigin-RevId: 446763565 Source-Link: https://github.com/googleapis/googleapis/commit/2d07d513b2e12e8d6f1e5823dd2626bb6f0a4f16 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7cf0655ec0b71a5963081fe8c5da908fcc840e3e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2NmMDY1NWVjMGI3MWE1OTYzMDgxZmU4YzVkYTkwOGZjYzg0MGUzZSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md PiperOrigin-RevId: 446890999 Source-Link: https://github.com/googleapis/googleapis/commit/044c5184ee9bf69c54294ba8ff844fe037d2d9d0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/770df39bd68400a84c0bb256c3c2fb7d65d649d5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzcwZGYzOWJkNjg0MDBhODRjMGJiMjU2YzNjMmZiN2Q2NWQ2NDlkNSJ9 --- .../cloud/dialogflow/cx/v3/session.proto | 18 +- .../cx/v3beta1/security_settings.proto | 50 +++ .../cloud/dialogflow/cx/v3beta1/session.proto | 18 +- .../protos/protos.d.ts | 125 +++++++ .../protos/protos.js | 322 ++++++++++++++++++ .../protos/protos.json | 34 ++ 6 files changed, 563 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto index 7b88afdf41c..6b408e9b2b2 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto @@ -617,8 +617,22 @@ message QueryResult { Match match = 15; // The free-form diagnostic info. For example, this field could contain - // webhook call latency. The string keys of the Struct's fields map can change - // without notice. + // webhook call latency. The fields of this data can change without notice, + // so you should not write code that depends on its structure. + // + // One of the fields is called "Alternative Matched Intents", which may + // aid with debugging. The following describes these intent results: + // + // - The list is empty if no intent was matched to end-user input. + // - Only intents that are referenced in the currently active flow are + // included. + // - The matched intent is included. + // - Other intents that could have matched end-user input, but did not match + // because they are referenced by intent routes that are out of + // [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), + // are included. + // - Other intents referenced by intent routes in scope that matched end-user + // input, but had a lower confidence score. google.protobuf.Struct diagnostic_info = 10; // The sentiment analyss result, which depends on diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto index ecc742e332e..366c6292c00 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto @@ -213,6 +213,41 @@ message SecuritySettings { DIALOGFLOW_HISTORY = 1; } + // Settings for exporting audio. + message AudioExportSettings { + // File format for exported audio file. Currently only in telephony + // recordings. + enum AudioFormat { + // Unspecified. Do not use. + AUDIO_FORMAT_UNSPECIFIED = 0; + + // G.711 mu-law PCM with 8kHz sample rate. + MULAW = 1; + + // MP3 file format. + MP3 = 2; + + // OGG Vorbis. + OGG = 3; + } + + // Cloud Storage bucket to export audio record to. You need to grant + // `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Storage Object + // Admin` role in this bucket. + string gcs_bucket = 1; + + // Filename pattern for exported audio. + string audio_export_pattern = 2; + + // Enable audio redaction if it is true. + bool enable_audio_redaction = 3; + + // File format for exported audio file. Currently only in telephony + // recordings. + AudioFormat audio_format = 4; + } + // Settings for exporting conversations to // [Insights](https://cloud.google.com/contact-center/insights/docs). message InsightsExportSettings { @@ -302,6 +337,21 @@ message SecuritySettings { // List of types of data to remove when retention settings triggers purge. repeated PurgeDataType purge_data_types = 8; + // Controls audio export settings for post-conversation analytics when + // ingesting audio to conversations via [Participants.AnalyzeContent][] or + // [Participants.StreamingAnalyzeContent][]. + // + // If [retention_strategy][google.cloud.dialogflow.cx.v3beta1.SecuritySettings.retention_strategy] is set to REMOVE_AFTER_CONVERSATION or + // [audio_export_settings.gcs_bucket][] is empty, audio export is disabled. + // + // If audio export is enabled, audio is recorded and saved to + // [audio_export_settings.gcs_bucket][], subject to retention policy of + // [audio_export_settings.gcs_bucket][]. + // + // This setting won't effect audio input for implicit sessions via + // [Sessions.DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] or [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent]. + AudioExportSettings audio_export_settings = 12; + // Controls conversation exporting settings to Insights after conversation is // completed. // diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto index 65716909fa1..2fff5e20572 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -617,8 +617,22 @@ message QueryResult { Match match = 15; // The free-form diagnostic info. For example, this field could contain - // webhook call latency. The string keys of the Struct's fields map can change - // without notice. + // webhook call latency. The fields of this data can change without notice, + // so you should not write code that depends on its structure. + // + // One of the fields is called "Alternative Matched Intents", which may + // aid with debugging. The following describes these intent results: + // + // - The list is empty if no intent was matched to end-user input. + // - Only intents that are referenced in the currently active flow are + // included. + // - The matched intent is included. + // - Other intents that could have matched end-user input, but did not match + // because they are referenced by intent routes that are out of + // [scope](https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope), + // are included. + // - Other intents referenced by intent routes in scope that matched end-user + // input, but had a lower confidence score. google.protobuf.Struct diagnostic_info = 10; // The sentiment analyss result, which depends on diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts index f6d577e0fc9..0f5aa2c878d 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts @@ -52252,6 +52252,9 @@ export namespace google { /** SecuritySettings purgeDataTypes */ purgeDataTypes?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]|null); + /** SecuritySettings audioExportSettings */ + audioExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null); + /** SecuritySettings insightsExportSettings */ insightsExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null); } @@ -52289,6 +52292,9 @@ export namespace google { /** SecuritySettings purgeDataTypes. */ public purgeDataTypes: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]; + /** SecuritySettings audioExportSettings. */ + public audioExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null); + /** SecuritySettings insightsExportSettings. */ public insightsExportSettings?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null); @@ -52386,6 +52392,125 @@ export namespace google { DIALOGFLOW_HISTORY = 1 } + /** Properties of an AudioExportSettings. */ + interface IAudioExportSettings { + + /** AudioExportSettings gcsBucket */ + gcsBucket?: (string|null); + + /** AudioExportSettings audioExportPattern */ + audioExportPattern?: (string|null); + + /** AudioExportSettings enableAudioRedaction */ + enableAudioRedaction?: (boolean|null); + + /** AudioExportSettings audioFormat */ + audioFormat?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null); + } + + /** Represents an AudioExportSettings. */ + class AudioExportSettings implements IAudioExportSettings { + + /** + * Constructs a new AudioExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings); + + /** AudioExportSettings gcsBucket. */ + public gcsBucket: string; + + /** AudioExportSettings audioExportPattern. */ + public audioExportPattern: string; + + /** AudioExportSettings enableAudioRedaction. */ + public enableAudioRedaction: boolean; + + /** AudioExportSettings audioFormat. */ + public audioFormat: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat); + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioExportSettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @param message AudioExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Verifies an AudioExportSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @param message AudioExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AudioExportSettings { + + /** AudioFormat enum. */ + enum AudioFormat { + AUDIO_FORMAT_UNSPECIFIED = 0, + MULAW = 1, + MP3 = 2, + OGG = 3 + } + } + /** Properties of an InsightsExportSettings. */ interface IInsightsExportSettings { diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.js b/packages/google-cloud-dialogflow-cx/protos/protos.js index dd4febc73a3..1d557dca1cf 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.js +++ b/packages/google-cloud-dialogflow-cx/protos/protos.js @@ -122624,6 +122624,7 @@ * @property {string|null} [deidentifyTemplate] SecuritySettings deidentifyTemplate * @property {number|null} [retentionWindowDays] SecuritySettings retentionWindowDays * @property {Array.|null} [purgeDataTypes] SecuritySettings purgeDataTypes + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null} [audioExportSettings] SecuritySettings audioExportSettings * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null} [insightsExportSettings] SecuritySettings insightsExportSettings */ @@ -122707,6 +122708,14 @@ */ SecuritySettings.prototype.purgeDataTypes = $util.emptyArray; + /** + * SecuritySettings audioExportSettings. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings|null|undefined} audioExportSettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.audioExportSettings = null; + /** * SecuritySettings insightsExportSettings. * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IInsightsExportSettings|null|undefined} insightsExportSettings @@ -122771,6 +122780,8 @@ } if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.inspectTemplate); + if (message.audioExportSettings != null && Object.hasOwnProperty.call(message, "audioExportSettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.encode(message.audioExportSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.insightsExportSettings != null && Object.hasOwnProperty.call(message, "insightsExportSettings")) $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.encode(message.insightsExportSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) @@ -122840,6 +122851,9 @@ } else message.purgeDataTypes.push(reader.int32()); break; + case 12: + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.decode(reader, reader.uint32()); + break; case 13: message.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.decode(reader, reader.uint32()); break; @@ -122924,6 +122938,11 @@ break; } } + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify(message.audioExportSettings); + if (error) + return "audioExportSettings." + error; + } if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) { var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.verify(message.insightsExportSettings); if (error) @@ -122991,6 +123010,11 @@ break; } } + if (object.audioExportSettings != null) { + if (typeof object.audioExportSettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.audioExportSettings: object expected"); + message.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.fromObject(object.audioExportSettings); + } if (object.insightsExportSettings != null) { if (typeof object.insightsExportSettings !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.insightsExportSettings: object expected"); @@ -123020,6 +123044,7 @@ object.redactionStrategy = options.enums === String ? "REDACTION_STRATEGY_UNSPECIFIED" : 0; object.redactionScope = options.enums === String ? "REDACTION_SCOPE_UNSPECIFIED" : 0; object.inspectTemplate = ""; + object.audioExportSettings = null; object.insightsExportSettings = null; object.deidentifyTemplate = ""; } @@ -123043,6 +123068,8 @@ } if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) object.inspectTemplate = message.inspectTemplate; + if (message.audioExportSettings != null && message.hasOwnProperty("audioExportSettings")) + object.audioExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.toObject(message.audioExportSettings, options); if (message.insightsExportSettings != null && message.hasOwnProperty("insightsExportSettings")) object.insightsExportSettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.InsightsExportSettings.toObject(message.insightsExportSettings, options); if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) @@ -123103,6 +123130,301 @@ return values; })(); + SecuritySettings.AudioExportSettings = (function() { + + /** + * Properties of an AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @interface IAudioExportSettings + * @property {string|null} [gcsBucket] AudioExportSettings gcsBucket + * @property {string|null} [audioExportPattern] AudioExportSettings audioExportPattern + * @property {boolean|null} [enableAudioRedaction] AudioExportSettings enableAudioRedaction + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null} [audioFormat] AudioExportSettings audioFormat + */ + + /** + * Constructs a new AudioExportSettings. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @classdesc Represents an AudioExportSettings. + * @implements IAudioExportSettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + */ + function AudioExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioExportSettings gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.gcsBucket = ""; + + /** + * AudioExportSettings audioExportPattern. + * @member {string} audioExportPattern + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioExportPattern = ""; + + /** + * AudioExportSettings enableAudioRedaction. + * @member {boolean} enableAudioRedaction + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.enableAudioRedaction = false; + + /** + * AudioExportSettings audioFormat. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat} audioFormat + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.audioFormat = 0; + + /** + * Creates a new AudioExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings instance + */ + AudioExportSettings.create = function create(properties) { + return new AudioExportSettings(properties); + }; + + /** + * Encodes the specified AudioExportSettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.audioExportPattern != null && Object.hasOwnProperty.call(message, "audioExportPattern")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioExportPattern); + if (message.enableAudioRedaction != null && Object.hasOwnProperty.call(message, "enableAudioRedaction")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableAudioRedaction); + if (message.audioFormat != null && Object.hasOwnProperty.call(message, "audioFormat")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.audioFormat); + return writer; + }; + + /** + * Encodes the specified AudioExportSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.IAudioExportSettings} message AudioExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @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.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsBucket = reader.string(); + break; + case 2: + message.audioExportPattern = reader.string(); + break; + case 3: + message.enableAudioRedaction = reader.bool(); + break; + case 4: + message.audioFormat = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioExportSettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioExportSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + if (!$util.isString(message.audioExportPattern)) + return "audioExportPattern: string expected"; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + if (typeof message.enableAudioRedaction !== "boolean") + return "enableAudioRedaction: boolean expected"; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + switch (message.audioFormat) { + default: + return "audioFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AudioExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} AudioExportSettings + */ + AudioExportSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.audioExportPattern != null) + message.audioExportPattern = String(object.audioExportPattern); + if (object.enableAudioRedaction != null) + message.enableAudioRedaction = Boolean(object.enableAudioRedaction); + switch (object.audioFormat) { + case "AUDIO_FORMAT_UNSPECIFIED": + case 0: + message.audioFormat = 0; + break; + case "MULAW": + case 1: + message.audioFormat = 1; + break; + case "MP3": + case 2: + message.audioFormat = 2; + break; + case "OGG": + case 3: + message.audioFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AudioExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings} message AudioExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.audioExportPattern = ""; + object.enableAudioRedaction = false; + object.audioFormat = options.enums === String ? "AUDIO_FORMAT_UNSPECIFIED" : 0; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.audioExportPattern != null && message.hasOwnProperty("audioExportPattern")) + object.audioExportPattern = message.audioExportPattern; + if (message.enableAudioRedaction != null && message.hasOwnProperty("enableAudioRedaction")) + object.enableAudioRedaction = message.enableAudioRedaction; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + object.audioFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] : message.audioFormat; + return object; + }; + + /** + * Converts this AudioExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + * @returns {Object.} JSON object + */ + AudioExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AudioFormat enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat + * @enum {number} + * @property {number} AUDIO_FORMAT_UNSPECIFIED=0 AUDIO_FORMAT_UNSPECIFIED value + * @property {number} MULAW=1 MULAW value + * @property {number} MP3=2 MP3 value + * @property {number} OGG=3 OGG value + */ + AudioExportSettings.AudioFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULAW"] = 1; + values[valuesById[2] = "MP3"] = 2; + values[valuesById[3] = "OGG"] = 3; + return values; + })(); + + return AudioExportSettings; + })(); + SecuritySettings.InsightsExportSettings = (function() { /** diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.json b/packages/google-cloud-dialogflow-cx/protos/protos.json index 17796ddffe1..301ddce971b 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.json +++ b/packages/google-cloud-dialogflow-cx/protos/protos.json @@ -14053,6 +14053,10 @@ "type": "PurgeDataType", "id": 8 }, + "audioExportSettings": { + "type": "AudioExportSettings", + "id": 12 + }, "insightsExportSettings": { "type": "InsightsExportSettings", "id": 13 @@ -14077,6 +14081,36 @@ "DIALOGFLOW_HISTORY": 1 } }, + "AudioExportSettings": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1 + }, + "audioExportPattern": { + "type": "string", + "id": 2 + }, + "enableAudioRedaction": { + "type": "bool", + "id": 3 + }, + "audioFormat": { + "type": "AudioFormat", + "id": 4 + } + }, + "nested": { + "AudioFormat": { + "values": { + "AUDIO_FORMAT_UNSPECIFIED": 0, + "MULAW": 1, + "MP3": 2, + "OGG": 3 + } + } + } + }, "InsightsExportSettings": { "fields": { "enableInsightsExport": {