diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto index 9cae72b7433..38563059fa9 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto @@ -165,10 +165,24 @@ message ConversationProfile { // Settings for speech transcription. SpeechToTextConfig stt_config = 9; - // Language which represents the conversationProfile. - // If unspecified, the default language code en-us applies. Users need to - // create a ConversationProfile for each language they want to support. + // Language code for the conversation profile. If not specified, the language + // is en-US. Language at ConversationProfile should be set for all non en-US + // languages. + // This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag. Example: "en-US". string language_code = 10; + + // The time zone of this conversational profile from the + // [time zone database](https://www.iana.org/time-zones), e.g., + // America/New_York, Europe/Paris. Defaults to America/New_York. + string time_zone = 14; + + // Name of the CX SecuritySettings reference for the agent. + // Format: `projects//locations//securitySettings/`. + string security_settings = 13 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/CXSecuritySettings" + }]; } // The request message for [ConversationProfiles.ListConversationProfiles][google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfiles]. @@ -263,11 +277,16 @@ message AutomatedAgentConfig { // Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API // Service Agent` role in this project. // - // Format: `projects//locations//locations//agent/environments/`. If environment is not // specified, the default `draft` environment is used. Refer to // [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) // for more details. + // + // - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + // is used. string agent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -430,7 +449,7 @@ message HumanAgentAssistantConfig { // If this field is not set, it defaults to 0.0, which means that all // suggestions are returned. // - // Supported features: ARTICLE_SUGGESTION. + // Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE. float confidence_threshold = 5; // Determines how recent conversation context is filtered when generating @@ -537,13 +556,13 @@ message HumanAgentHandoffConfig { message NotificationConfig { // Format of cloud pub/sub message. enum MessageFormat { - // If it is unspeified, PROTO will be used. + // If it is unspecified, PROTO will be used. MESSAGE_FORMAT_UNSPECIFIED = 0; - // Pubsub message will be serialized proto. + // Pub/Sub message will be serialized proto. PROTO = 1; - // Pubsub message will be json. + // Pub/Sub message will be json. JSON = 2; } diff --git a/packages/google-cloud-dialogflow/protos/protos.d.ts b/packages/google-cloud-dialogflow/protos/protos.d.ts index a782827b8fa..0727a2820ca 100644 --- a/packages/google-cloud-dialogflow/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow/protos/protos.d.ts @@ -16896,6 +16896,12 @@ export namespace google { /** ConversationProfile languageCode */ languageCode?: (string|null); + + /** ConversationProfile timeZone */ + timeZone?: (string|null); + + /** ConversationProfile securitySettings */ + securitySettings?: (string|null); } /** Represents a ConversationProfile. */ @@ -16943,6 +16949,12 @@ export namespace google { /** ConversationProfile languageCode. */ public languageCode: string; + /** ConversationProfile timeZone. */ + public timeZone: string; + + /** ConversationProfile securitySettings. */ + public securitySettings: string; + /** * Creates a new ConversationProfile instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-dialogflow/protos/protos.js b/packages/google-cloud-dialogflow/protos/protos.js index b6770544004..27131a5919a 100644 --- a/packages/google-cloud-dialogflow/protos/protos.js +++ b/packages/google-cloud-dialogflow/protos/protos.js @@ -40625,6 +40625,8 @@ * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [newMessageEventNotificationConfig] ConversationProfile newMessageEventNotificationConfig * @property {google.cloud.dialogflow.v2.ISpeechToTextConfig|null} [sttConfig] ConversationProfile sttConfig * @property {string|null} [languageCode] ConversationProfile languageCode + * @property {string|null} [timeZone] ConversationProfile timeZone + * @property {string|null} [securitySettings] ConversationProfile securitySettings */ /** @@ -40738,6 +40740,22 @@ */ ConversationProfile.prototype.languageCode = ""; + /** + * ConversationProfile timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.v2.ConversationProfile + * @instance + */ + ConversationProfile.prototype.timeZone = ""; + + /** + * ConversationProfile securitySettings. + * @member {string} securitySettings + * @memberof google.cloud.dialogflow.v2.ConversationProfile + * @instance + */ + ConversationProfile.prototype.securitySettings = ""; + /** * Creates a new ConversationProfile instance using the specified properties. * @function create @@ -40786,6 +40804,10 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.securitySettings); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.timeZone); return writer; }; @@ -40856,6 +40878,12 @@ case 10: message.languageCode = reader.string(); break; + case 14: + message.timeZone = reader.string(); + break; + case 13: + message.securitySettings = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -40945,6 +40973,12 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + if (!$util.isString(message.securitySettings)) + return "securitySettings: string expected"; return null; }; @@ -41011,6 +41045,10 @@ } if (object.languageCode != null) message.languageCode = String(object.languageCode); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.securitySettings != null) + message.securitySettings = String(object.securitySettings); return message; }; @@ -41040,6 +41078,8 @@ object.languageCode = ""; object.createTime = null; object.updateTime = null; + object.securitySettings = ""; + object.timeZone = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -41065,6 +41105,10 @@ 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.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = message.securitySettings; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; return object; }; diff --git a/packages/google-cloud-dialogflow/protos/protos.json b/packages/google-cloud-dialogflow/protos/protos.json index 181e09a2f28..5ec6206432a 100644 --- a/packages/google-cloud-dialogflow/protos/protos.json +++ b/packages/google-cloud-dialogflow/protos/protos.json @@ -5583,6 +5583,17 @@ "languageCode": { "type": "string", "id": 10 + }, + "timeZone": { + "type": "string", + "id": 14 + }, + "securitySettings": { + "type": "string", + "id": 13, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/CXSecuritySettings" + } } } }, diff --git a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts index ac011e8e317..9d609cbe042 100644 --- a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts @@ -164,6 +164,9 @@ export class ConversationProfilesClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cXSecuritySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -1068,6 +1071,67 @@ export class ConversationProfilesClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cXSecuritySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + cXSecuritySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.cXSecuritySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from CXSecuritySettings resource. + * + * @param {string} cXSecuritySettingsName + * A fully-qualified path representing CXSecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCXSecuritySettingsName(cXSecuritySettingsName: string) { + return this.pathTemplates.cXSecuritySettingsPathTemplate.match( + cXSecuritySettingsName + ).project; + } + + /** + * Parse the location from CXSecuritySettings resource. + * + * @param {string} cXSecuritySettingsName + * A fully-qualified path representing CXSecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCXSecuritySettingsName(cXSecuritySettingsName: string) { + return this.pathTemplates.cXSecuritySettingsPathTemplate.match( + cXSecuritySettingsName + ).location; + } + + /** + * Parse the security_settings from CXSecuritySettings resource. + * + * @param {string} cXSecuritySettingsName + * A fully-qualified path representing CXSecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromCXSecuritySettingsName( + cXSecuritySettingsName: string + ) { + return this.pathTemplates.cXSecuritySettingsPathTemplate.match( + cXSecuritySettingsName + ).security_settings; + } + /** * Return a fully-qualified project resource name string. * diff --git a/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts index 19286eba85c..8860d1fc08f 100644 --- a/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts @@ -1016,6 +1016,84 @@ describe('v2.ConversationProfilesClient', () => { }); describe('Path templates', () => { + describe('cXSecuritySettings', () => { + const fakePath = '/rendered/path/cXSecuritySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = + new conversationprofilesModule.v2.ConversationProfilesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cXSecuritySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cXSecuritySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cXSecuritySettingsPath', () => { + const result = client.cXSecuritySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.cXSecuritySettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCXSecuritySettingsName', () => { + const result = client.matchProjectFromCXSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.cXSecuritySettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCXSecuritySettingsName', () => { + const result = client.matchLocationFromCXSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.cXSecuritySettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromCXSecuritySettingsName', () => { + const result = + client.matchSecuritySettingsFromCXSecuritySettingsName(fakePath); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + ( + client.pathTemplates.cXSecuritySettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = {