From 44b33333493ac4a458e84c1d3231f5571e63fd33 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:20:04 -0700 Subject: [PATCH] feat: [contactcenterinsights] add optional SpeechConfig to UploadConversationRequest (#4695) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add optional SpeechConfig to UploadConversationRequest PiperOrigin-RevId: 567616394 Source-Link: https://github.com/googleapis/googleapis/commit/37b45d1b5ebe4200fdc1250b85b3111e0f3c98c3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fa3a5648d3267a52ff8742c6bca465d306fcf4a5 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3RjZW50ZXJpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiZmEzYTU2NDhkMzI2N2E1MmZmODc0MmM2YmNhNDY1ZDMwNmZjZjRhNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: update typescript generator version to publish in dual format (ESM) PiperOrigin-RevId: 568643156 Source-Link: https://github.com/googleapis/googleapis/commit/f95afc063e20a0a61e13b186806ac84b49e329cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/bbd2c49d2e423a8ce5cc85627402d512aeefc58b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3RjZW50ZXJpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiYmJkMmM0OWQyZTQyM2E4Y2U1Y2M4NTYyNzQwMmQ1MTJhZWVmYzU4YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../v1/contact_center_insights.proto | 7 +- .../contactcenterinsights/v1/resources.proto | 14 + .../protos/protos.d.ts | 109 ++++++++ .../protos/protos.js | 259 ++++++++++++++++++ .../protos/protos.json | 25 ++ ...ct_center_insights.ingest_conversations.js | 3 +- ...act_center_insights.upload_conversation.js | 5 + ...google.cloud.contactcenterinsights.v1.json | 8 +- .../src/v1/contact_center_insights_client.ts | 6 +- 9 files changed, 431 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto index 3da19a05c75..f2075fa8f78 100644 --- a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto +++ b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto @@ -576,6 +576,10 @@ message UploadConversationRequest { // Optional. DLP settings for transcript redaction. Optional, will default to // the config specified in Settings. RedactionConfig redaction_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default Speech-to-Text configuration. Optional, will default to + // the config specified in Settings. + SpeechConfig speech_config = 11 [(google.api.field_behavior) = OPTIONAL]; } // The metadata for an UploadConversation operation. @@ -704,7 +708,8 @@ message IngestConversationsRequest { // Configuration for an external data store containing objects that will // be converted to conversations. oneof source { - // A cloud storage bucket source. + // A cloud storage bucket source. Note that any previously ingested objects + // from the source will be skipped to avoid duplication. GcsSource gcs_source = 2; } diff --git a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto index 3f55f22d21f..5c5535ce7b7 100644 --- a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto +++ b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto @@ -951,6 +951,10 @@ message Settings { // Default DLP redaction resources to be applied while ingesting // conversations. RedactionConfig redaction_config = 10; + + // Optional. Default Speech-to-Text resources to be used while ingesting audio + // files. Optional, CCAI Insights will create a default if not provided. + SpeechConfig speech_config = 11 [(google.api.field_behavior) = OPTIONAL]; } // DLP resources used for redaction while ingesting conversations. @@ -966,6 +970,16 @@ message RedactionConfig { string inspect_template = 2; } +// Speech-to-Text configuration. +message SpeechConfig { + // The fully-qualified Speech Recognizer resource name. + // Format: + // `projects/{project_id}/locations/{location}/recognizer/{recognizer}` + string speech_recognizer = 1 [(google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + }]; +} + // An annotation that was generated during the customer and agent interaction. message RuntimeAnnotation { // The data in the annotation. diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.d.ts b/packages/google-cloud-contactcenterinsights/protos/protos.d.ts index cf66d50edb8..703b44594b9 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.d.ts +++ b/packages/google-cloud-contactcenterinsights/protos/protos.d.ts @@ -1547,6 +1547,9 @@ export namespace google { /** UploadConversationRequest redactionConfig */ redactionConfig?: (google.cloud.contactcenterinsights.v1.IRedactionConfig|null); + + /** UploadConversationRequest speechConfig */ + speechConfig?: (google.cloud.contactcenterinsights.v1.ISpeechConfig|null); } /** Represents an UploadConversationRequest. */ @@ -1570,6 +1573,9 @@ export namespace google { /** UploadConversationRequest redactionConfig. */ public redactionConfig?: (google.cloud.contactcenterinsights.v1.IRedactionConfig|null); + /** UploadConversationRequest speechConfig. */ + public speechConfig?: (google.cloud.contactcenterinsights.v1.ISpeechConfig|null); + /** * Creates a new UploadConversationRequest instance using the specified properties. * @param [properties] Properties to set @@ -12284,6 +12290,9 @@ export namespace google { /** Settings redactionConfig */ redactionConfig?: (google.cloud.contactcenterinsights.v1.IRedactionConfig|null); + + /** Settings speechConfig */ + speechConfig?: (google.cloud.contactcenterinsights.v1.ISpeechConfig|null); } /** Represents a Settings. */ @@ -12319,6 +12328,9 @@ export namespace google { /** Settings redactionConfig. */ public redactionConfig?: (google.cloud.contactcenterinsights.v1.IRedactionConfig|null); + /** Settings speechConfig. */ + public speechConfig?: (google.cloud.contactcenterinsights.v1.ISpeechConfig|null); + /** * Creates a new Settings instance using the specified properties. * @param [properties] Properties to set @@ -12612,6 +12624,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig speechRecognizer */ + speechRecognizer?: (string|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.ISpeechConfig); + + /** SpeechConfig speechRecognizer. */ + public speechRecognizer: string; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.ISpeechConfig): google.cloud.contactcenterinsights.v1.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @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.contactcenterinsights.v1.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @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.contactcenterinsights.v1.SpeechConfig; + + /** + * Verifies a SpeechConfig 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 a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RuntimeAnnotation. */ interface IRuntimeAnnotation { diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.js b/packages/google-cloud-contactcenterinsights/protos/protos.js index e5c316cc8f5..9d482b95f61 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.js +++ b/packages/google-cloud-contactcenterinsights/protos/protos.js @@ -3157,6 +3157,7 @@ * @property {google.cloud.contactcenterinsights.v1.IConversation|null} [conversation] UploadConversationRequest conversation * @property {string|null} [conversationId] UploadConversationRequest conversationId * @property {google.cloud.contactcenterinsights.v1.IRedactionConfig|null} [redactionConfig] UploadConversationRequest redactionConfig + * @property {google.cloud.contactcenterinsights.v1.ISpeechConfig|null} [speechConfig] UploadConversationRequest speechConfig */ /** @@ -3206,6 +3207,14 @@ */ UploadConversationRequest.prototype.redactionConfig = null; + /** + * UploadConversationRequest speechConfig. + * @member {google.cloud.contactcenterinsights.v1.ISpeechConfig|null|undefined} speechConfig + * @memberof google.cloud.contactcenterinsights.v1.UploadConversationRequest + * @instance + */ + UploadConversationRequest.prototype.speechConfig = null; + /** * Creates a new UploadConversationRequest instance using the specified properties. * @function create @@ -3238,6 +3247,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversationId); if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) $root.google.cloud.contactcenterinsights.v1.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.cloud.contactcenterinsights.v1.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -3288,6 +3299,10 @@ message.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.decode(reader, reader.uint32()); break; } + case 11: { + message.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3339,6 +3354,11 @@ if (error) return "redactionConfig." + error; } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + var error = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } return null; }; @@ -3368,6 +3388,11 @@ throw TypeError(".google.cloud.contactcenterinsights.v1.UploadConversationRequest.redactionConfig: object expected"); message.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.fromObject(object.redactionConfig); } + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.UploadConversationRequest.speechConfig: object expected"); + message.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.fromObject(object.speechConfig); + } return message; }; @@ -3389,6 +3414,7 @@ object.conversation = null; object.conversationId = ""; object.redactionConfig = null; + object.speechConfig = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -3398,6 +3424,8 @@ object.conversationId = message.conversationId; if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) object.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.toObject(message.redactionConfig, options); + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) + object.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.toObject(message.speechConfig, options); return object; }; @@ -29065,6 +29093,7 @@ * @property {Object.|null} [pubsubNotificationSettings] Settings pubsubNotificationSettings * @property {google.cloud.contactcenterinsights.v1.Settings.IAnalysisConfig|null} [analysisConfig] Settings analysisConfig * @property {google.cloud.contactcenterinsights.v1.IRedactionConfig|null} [redactionConfig] Settings redactionConfig + * @property {google.cloud.contactcenterinsights.v1.ISpeechConfig|null} [speechConfig] Settings speechConfig */ /** @@ -29147,6 +29176,14 @@ */ Settings.prototype.redactionConfig = null; + /** + * Settings speechConfig. + * @member {google.cloud.contactcenterinsights.v1.ISpeechConfig|null|undefined} speechConfig + * @memberof google.cloud.contactcenterinsights.v1.Settings + * @instance + */ + Settings.prototype.speechConfig = null; + /** * Creates a new Settings instance using the specified properties. * @function create @@ -29188,6 +29225,8 @@ $root.google.cloud.contactcenterinsights.v1.Settings.AnalysisConfig.encode(message.analysisConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) $root.google.cloud.contactcenterinsights.v1.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.cloud.contactcenterinsights.v1.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -29273,6 +29312,10 @@ message.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.decode(reader, reader.uint32()); break; } + case 11: { + message.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29347,6 +29390,11 @@ if (error) return "redactionConfig." + error; } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + var error = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } return null; }; @@ -29398,6 +29446,11 @@ throw TypeError(".google.cloud.contactcenterinsights.v1.Settings.redactionConfig: object expected"); message.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.fromObject(object.redactionConfig); } + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.Settings.speechConfig: object expected"); + message.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.fromObject(object.speechConfig); + } return message; }; @@ -29424,6 +29477,7 @@ object.conversationTtl = null; object.analysisConfig = null; object.redactionConfig = null; + object.speechConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -29445,6 +29499,8 @@ object.analysisConfig = $root.google.cloud.contactcenterinsights.v1.Settings.AnalysisConfig.toObject(message.analysisConfig, options); if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) object.redactionConfig = $root.google.cloud.contactcenterinsights.v1.RedactionConfig.toObject(message.redactionConfig, options); + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) + object.speechConfig = $root.google.cloud.contactcenterinsights.v1.SpeechConfig.toObject(message.speechConfig, options); return object; }; @@ -29959,6 +30015,209 @@ return RedactionConfig; })(); + v1.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface ISpeechConfig + * @property {string|null} [speechRecognizer] SpeechConfig speechRecognizer + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.cloud.contactcenterinsights.v1.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 speechRecognizer. + * @member {string} speechRecognizer + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @instance + */ + SpeechConfig.prototype.speechRecognizer = ""; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.ISpeechConfig=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.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.speechRecognizer != null && Object.hasOwnProperty.call(message, "speechRecognizer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.speechRecognizer); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.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.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.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.cloud.contactcenterinsights.v1.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.speechRecognizer = reader.string(); + 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.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.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.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {Object.} 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.speechRecognizer != null && message.hasOwnProperty("speechRecognizer")) + if (!$util.isString(message.speechRecognizer)) + return "speechRecognizer: string expected"; + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.SpeechConfig) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.SpeechConfig(); + if (object.speechRecognizer != null) + message.speechRecognizer = String(object.speechRecognizer); + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.speechRecognizer = ""; + if (message.speechRecognizer != null && message.hasOwnProperty("speechRecognizer")) + object.speechRecognizer = message.speechRecognizer; + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.SpeechConfig + * @instance + * @returns {Object.} 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.cloud.contactcenterinsights.v1.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.cloud.contactcenterinsights.v1.SpeechConfig"; + }; + + return SpeechConfig; + })(); + v1.RuntimeAnnotation = (function() { /** diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.json b/packages/google-cloud-contactcenterinsights/protos/protos.json index 7311fa671ca..9dc7b667b34 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.json +++ b/packages/google-cloud-contactcenterinsights/protos/protos.json @@ -994,6 +994,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3032,6 +3039,13 @@ "redactionConfig": { "type": "RedactionConfig", "id": 10 + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -3065,6 +3079,17 @@ } } }, + "SpeechConfig": { + "fields": { + "speechRecognizer": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + } + } + }, "RuntimeAnnotation": { "oneofs": { "data": { diff --git a/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js index d33f4176695..8b0e13b1676 100644 --- a/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js +++ b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js @@ -29,7 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A cloud storage bucket source. + * A cloud storage bucket source. Note that any previously ingested objects + * from the source will be skipped to avoid duplication. */ // const gcsSource = {} /** diff --git a/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js index 535228a08aa..28abc808026 100644 --- a/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js +++ b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js @@ -49,6 +49,11 @@ function main(parent, conversation) { * the config specified in Settings. */ // const redactionConfig = {} + /** + * Optional. Default Speech-to-Text configuration. Optional, will default to + * the config specified in Settings. + */ + // const speechConfig = {} // Imports the Contactcenterinsights library const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; diff --git a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata_google.cloud.contactcenterinsights.v1.json b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata_google.cloud.contactcenterinsights.v1.json index 77d0b632f6f..1b1aba56768 100644 --- a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata_google.cloud.contactcenterinsights.v1.json +++ b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata_google.cloud.contactcenterinsights.v1.json @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 77, "type": "FULL" } ], @@ -94,6 +94,10 @@ { "name": "redaction_config", "type": ".google.cloud.contactcenterinsights.v1.RedactionConfig" + }, + { + "name": "speech_config", + "type": ".google.cloud.contactcenterinsights.v1.SpeechConfig" } ], "resultType": ".google.longrunning.Operation", @@ -538,7 +542,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 67, "type": "FULL" } ], diff --git a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts index aa713af5204..41770013c60 100644 --- a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts +++ b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts @@ -2997,6 +2997,9 @@ export class ContactCenterInsightsClient { * @param {google.cloud.contactcenterinsights.v1.RedactionConfig} [request.redactionConfig] * Optional. DLP settings for transcript redaction. Optional, will default to * the config specified in Settings. + * @param {google.cloud.contactcenterinsights.v1.SpeechConfig} [request.speechConfig] + * Optional. Default Speech-to-Text configuration. Optional, will default to + * the config specified in Settings. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3420,7 +3423,8 @@ export class ContactCenterInsightsClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} request.gcsSource - * A cloud storage bucket source. + * A cloud storage bucket source. Note that any previously ingested objects + * from the source will be skipped to avoid duplication. * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} request.transcriptObjectConfig * Configuration for when `source` contains conversation transcripts. * @param {string} request.parent