From 16ebab38df3e73d221740bcfa5c91b81fa38e9eb Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot <yoshi-automation@google.com>
Date: Fri, 11 Dec 2020 11:30:43 -0800
Subject: [PATCH] feat: allowed custom to specify webhook headers through query
 parameters (#724)

* chore: fixing syntax error in the GAPIC metadata JSON file

Use gapic-generator-typescript v1.2.8.
Committer: @alexander-fenster
PiperOrigin-RevId: 345712055

Source-Author: Google APIs <noreply@google.com>
Source-Date: Fri Dec 4 10:54:47 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 16dd59787d6ce130ab66066c02eeea9dac0c8f0e
Source-Link: https://github.com/googleapis/googleapis/commit/16dd59787d6ce130ab66066c02eeea9dac0c8f0e

* feat: allowed custom to specify webhook headers through query parameters docs: suggested to always use version for production traffic when calling DetectIntent, mark match_mode in Agent message as deprecated

PiperOrigin-RevId: 345742559

Source-Author: Google APIs <noreply@google.com>
Source-Date: Fri Dec 4 13:15:39 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 519e9dcdff23cc14d48f85e9e00b6214ec57967e
Source-Link: https://github.com/googleapis/googleapis/commit/519e9dcdff23cc14d48f85e9e00b6214ec57967e
---
 .../google/cloud/dialogflow/v2/agent.proto    |   5 +-
 .../google/cloud/dialogflow/v2/session.proto  | 123 ++-
 .../protos/protos.d.ts                        |   6 +
 .../google-cloud-dialogflow/protos/protos.js  |  60 +-
 .../protos/protos.json                        |   6 +
 .../src/v2/gapic_metadata.json                | 690 +++++++++-----
 .../src/v2/sessions_client.ts                 |  24 +-
 .../src/v2beta1/gapic_metadata.json           | 888 ++++++++++++------
 .../google-cloud-dialogflow/synth.metadata    |   6 +-
 9 files changed, 1243 insertions(+), 565 deletions(-)

diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/agent.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/agent.proto
index 1ce2717369b..82c1426c762 100644
--- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/agent.proto
+++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/agent.proto
@@ -267,7 +267,10 @@ message Agent {
   bool enable_logging = 8 [(google.api.field_behavior) = OPTIONAL];
 
   // Optional. Determines how intents are detected from user queries.
-  MatchMode match_mode = 9 [(google.api.field_behavior) = OPTIONAL];
+  MatchMode match_mode = 9 [
+    deprecated = true,
+    (google.api.field_behavior) = OPTIONAL
+  ];
 
   // Optional. To filter out false positive results and still get variety in
   // matched natural language inputs for your agent, you can tune the machine
diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/session.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/session.proto
index b0912cbda59..b99214a4c6a 100644
--- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/session.proto
+++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/session.proto
@@ -57,6 +57,10 @@ service Sessions {
   // as a result. This method is not idempotent, because it may cause contexts
   // and session entity types to be updated, which in turn might affect
   // results of future queries.
+  //
+  // Note: Always use agent versions for production traffic.
+  // See [Versions and
+  // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
   rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) {
     option (google.api.http) = {
       post: "/v2/{session=projects/*/agent/sessions/*}:detectIntent"
@@ -72,8 +76,12 @@ service Sessions {
   // Processes a natural language query in audio format in a streaming fashion
   // and returns structured, actionable data as a result. This method is only
   // available via the gRPC API (not REST).
-  rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) {
-  }
+  //
+  // Note: Always use agent versions for production traffic.
+  // See [Versions and
+  // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
+  rpc StreamingDetectIntent(stream StreamingDetectIntentRequest)
+      returns (stream StreamingDetectIntentResponse) {}
 }
 
 // The request to detect user's intent.
@@ -90,6 +98,10 @@ message DetectIntentRequest {
   //
   // For more information, see the [API interactions
   // guide](https://cloud.google.com/dialogflow/docs/api-overview).
+  //
+  // Note: Always use agent versions for production traffic.
+  // See [Versions and
+  // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
   string session = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -115,12 +127,14 @@ message DetectIntentRequest {
   // configured, no output audio is generated.
   OutputAudioConfig output_audio_config = 4;
 
-  // Mask for [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] indicating which settings in this
-  // request-level config should override speech synthesizer settings defined at
-  // agent-level.
+  // Mask for
+  // [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config]
+  // indicating which settings in this request-level config should override
+  // speech synthesizer settings defined at agent-level.
   //
-  // If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] replaces the agent-level
-  // config in its entirety.
+  // If unspecified or empty,
+  // [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config]
+  // replaces the agent-level config in its entirety.
   google.protobuf.FieldMask output_audio_config_mask = 7;
 
   // The natural language speech audio to be processed. This field
@@ -192,6 +206,17 @@ message QueryParameters {
   // Configures the type of sentiment analysis to perform. If not
   // provided, sentiment analysis is not performed.
   SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10;
+
+  // This field can be used to pass HTTP headers for a webhook
+  // call. These headers will be sent to webhook along with the headers that
+  // have been configured through the Dialogflow web console. The headers
+  // defined within this field will overwrite the headers configured through the
+  // Dialogflow console if there is a conflict. Header names are
+  // case-insensitive. Google's specified headers are not allowed. Including:
+  // "Host", "Content-Length", "Connection", "From", "User-Agent",
+  // "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For",
+  // etc.
+  map<string, string> webhook_headers = 14;
 }
 
 // Represents the query input. It can contain either:
@@ -325,25 +350,29 @@ message QueryResult {
 }
 
 // The top-level message sent by the client to the
-// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent] method.
+// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]
+// method.
 //
 // Multiple request messages should be sent in order:
 //
 // 1.  The first message must contain
 // [session][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.session],
-//     [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] plus optionally
-//     [query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params]. If the client
-//     wants to receive an audio response, it should also contain
+//     [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input]
+//     plus optionally
+//     [query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params].
+//     If the client wants to receive an audio response, it should also contain
 //     [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config].
 //     The message must not contain
 //     [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio].
-// 2.  If [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] was set to
-//     [query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig], all subsequent
-//     messages must contain
-//     [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio] to continue with
-//     Speech recognition.
-//     If you decide to rather detect an intent from text input after you
-//     already started Speech recognition, please send a message with
+// 2.  If
+// [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input]
+// was set to
+//     [query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig],
+//     all subsequent messages must contain
+//     [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio]
+//     to continue with Speech recognition. If you decide to rather detect an
+//     intent from text input after you already started Speech recognition,
+//     please send a message with
 //     [query_input.text][google.cloud.dialogflow.v2.QueryInput.text].
 //
 //     However, note that:
@@ -368,6 +397,10 @@ message StreamingDetectIntentRequest {
   //
   // For more information, see the [API interactions
   // guide](https://cloud.google.com/dialogflow/docs/api-overview).
+  //
+  // Note: Always use agent versions for production traffic.
+  // See [Versions and
+  // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
   string session = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -388,14 +421,15 @@ message StreamingDetectIntentRequest {
   // 3.  an event that specifies which intent to trigger.
   QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED];
 
-  // Please use [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] instead.
-  // If `false` (default), recognition does not cease until
-  // the client closes the stream. If `true`, the recognizer will detect a
-  // single spoken utterance in input audio. Recognition ceases when it detects
-  // the audio's voice has stopped or paused. In this case, once a detected
-  // intent is received, the client should close the stream and start a new
-  // request with a new stream as needed.
-  // This setting is ignored when `query_input` is a piece of text or an event.
+  // Please use
+  // [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance]
+  // instead. If `false` (default), recognition does not cease until the client
+  // closes the stream. If `true`, the recognizer will detect a single spoken
+  // utterance in input audio. Recognition ceases when it detects the audio's
+  // voice has stopped or paused. In this case, once a detected intent is
+  // received, the client should close the stream and start a new request with a
+  // new stream as needed. This setting is ignored when `query_input` is a piece
+  // of text or an event.
   bool single_utterance = 4 [deprecated = true];
 
   // Instructs the speech synthesizer how to generate the output
@@ -403,12 +437,14 @@ message StreamingDetectIntentRequest {
   // configured, no output audio is generated.
   OutputAudioConfig output_audio_config = 5;
 
-  // Mask for [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] indicating which settings in this
-  // request-level config should override speech synthesizer settings defined at
-  // agent-level.
+  // Mask for
+  // [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config]
+  // indicating which settings in this request-level config should override
+  // speech synthesizer settings defined at agent-level.
   //
-  // If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] replaces the agent-level
-  // config in its entirety.
+  // If unspecified or empty,
+  // [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config]
+  // replaces the agent-level config in its entirety.
   google.protobuf.FieldMask output_audio_config_mask = 7;
 
   // The input audio content to be recognized. Must be sent if
@@ -503,11 +539,12 @@ message StreamingRecognitionResult {
 
     // Event indicates that the server has detected the end of the user's speech
     // utterance and expects no additional inputs.
-    // Therefore, the server will not process additional audio (although it may subsequently return additional results). The
-    // client should stop sending additional audio data, half-close the gRPC
-    // connection, and wait for any additional results until the server closes
-    // the gRPC connection. This message is only sent if `single_utterance` was
-    // set to `true`, and is not used otherwise.
+    // Therefore, the server will not process additional audio (although it may
+    // subsequently return additional results). The client should stop sending
+    // additional audio data, half-close the gRPC connection, and wait for any
+    // additional results until the server closes the gRPC connection. This
+    // message is only sent if `single_utterance` was set to `true`, and is not
+    // used otherwise.
     END_OF_SINGLE_UTTERANCE = 2;
   }
 
@@ -534,7 +571,8 @@ message StreamingRecognitionResult {
   float confidence = 4;
 
   // Word-specific information for the words recognized by Speech in
-  // [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+  // [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript].
+  // Populated if and only if `message_type` = `TRANSCRIPT` and
   // [InputAudioConfig.enable_word_info] is set.
   repeated SpeechWordInfo speech_word_info = 7;
 
@@ -601,11 +639,14 @@ message SentimentAnalysisRequestConfig {
 // and identifies the prevailing subjective opinion, especially to determine a
 // user's attitude as positive, negative, or neutral.
 // For [Participants.DetectIntent][], it needs to be configured in
-// [DetectIntentRequest.query_params][google.cloud.dialogflow.v2.DetectIntentRequest.query_params]. For
-// [Participants.StreamingDetectIntent][], it needs to be configured in
+// [DetectIntentRequest.query_params][google.cloud.dialogflow.v2.DetectIntentRequest.query_params].
+// For [Participants.StreamingDetectIntent][], it needs to be configured in
 // [StreamingDetectIntentRequest.query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params].
-// And for [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and
-// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent], it needs to be configured in
+// And for
+// [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent]
+// and
+// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent],
+// it needs to be configured in
 // [ConversationProfile.human_agent_assistant_config][google.cloud.dialogflow.v2.ConversationProfile.human_agent_assistant_config]
 message SentimentAnalysisResult {
   // The sentiment analysis result for `query_text`.
diff --git a/packages/google-cloud-dialogflow/protos/protos.d.ts b/packages/google-cloud-dialogflow/protos/protos.d.ts
index d231deecb8e..e4b1d624041 100644
--- a/packages/google-cloud-dialogflow/protos/protos.d.ts
+++ b/packages/google-cloud-dialogflow/protos/protos.d.ts
@@ -10532,6 +10532,9 @@ export namespace google {
 
                     /** QueryParameters sentimentAnalysisRequestConfig */
                     sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null);
+
+                    /** QueryParameters webhookHeaders */
+                    webhookHeaders?: ({ [k: string]: string }|null);
                 }
 
                 /** Represents a QueryParameters. */
@@ -10564,6 +10567,9 @@ export namespace google {
                     /** QueryParameters sentimentAnalysisRequestConfig. */
                     public sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null);
 
+                    /** QueryParameters webhookHeaders. */
+                    public webhookHeaders: { [k: string]: string };
+
                     /**
                      * Creates a new QueryParameters 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 41459afb7d3..9dfef3d2d3c 100644
--- a/packages/google-cloud-dialogflow/protos/protos.js
+++ b/packages/google-cloud-dialogflow/protos/protos.js
@@ -25304,6 +25304,7 @@
                          * @property {Array.<google.cloud.dialogflow.v2.ISessionEntityType>|null} [sessionEntityTypes] QueryParameters sessionEntityTypes
                          * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload
                          * @property {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null} [sentimentAnalysisRequestConfig] QueryParameters sentimentAnalysisRequestConfig
+                         * @property {Object.<string,string>|null} [webhookHeaders] QueryParameters webhookHeaders
                          */
     
                         /**
@@ -25317,6 +25318,7 @@
                         function QueryParameters(properties) {
                             this.contexts = [];
                             this.sessionEntityTypes = [];
+                            this.webhookHeaders = {};
                             if (properties)
                                 for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                     if (properties[keys[i]] != null)
@@ -25379,6 +25381,14 @@
                          */
                         QueryParameters.prototype.sentimentAnalysisRequestConfig = null;
     
+                        /**
+                         * QueryParameters webhookHeaders.
+                         * @member {Object.<string,string>} webhookHeaders
+                         * @memberof google.cloud.dialogflow.v2.QueryParameters
+                         * @instance
+                         */
+                        QueryParameters.prototype.webhookHeaders = $util.emptyObject;
+    
                         /**
                          * Creates a new QueryParameters instance using the specified properties.
                          * @function create
@@ -25419,6 +25429,9 @@
                                 $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                             if (message.sentimentAnalysisRequestConfig != null && Object.hasOwnProperty.call(message, "sentimentAnalysisRequestConfig"))
                                 $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.encode(message.sentimentAnalysisRequestConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
+                            if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders"))
+                                for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i)
+                                    writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim();
                             return writer;
                         };
     
@@ -25449,7 +25462,7 @@
                         QueryParameters.decode = function 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.v2.QueryParameters();
+                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryParameters(), key, value;
                             while (reader.pos < end) {
                                 var tag = reader.uint32();
                                 switch (tag >>> 3) {
@@ -25478,6 +25491,28 @@
                                 case 10:
                                     message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.decode(reader, reader.uint32());
                                     break;
+                                case 14:
+                                    if (message.webhookHeaders === $util.emptyObject)
+                                        message.webhookHeaders = {};
+                                    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.webhookHeaders[key] = value;
+                                    break;
                                 default:
                                     reader.skipType(tag & 7);
                                     break;
@@ -25552,6 +25587,14 @@
                                 if (error)
                                     return "sentimentAnalysisRequestConfig." + error;
                             }
+                            if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) {
+                                if (!$util.isObject(message.webhookHeaders))
+                                    return "webhookHeaders: object expected";
+                                var key = Object.keys(message.webhookHeaders);
+                                for (var i = 0; i < key.length; ++i)
+                                    if (!$util.isString(message.webhookHeaders[key[i]]))
+                                        return "webhookHeaders: string{k:string} expected";
+                            }
                             return null;
                         };
     
@@ -25606,6 +25649,13 @@
                                     throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sentimentAnalysisRequestConfig: object expected");
                                 message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.fromObject(object.sentimentAnalysisRequestConfig);
                             }
+                            if (object.webhookHeaders) {
+                                if (typeof object.webhookHeaders !== "object")
+                                    throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.webhookHeaders: object expected");
+                                message.webhookHeaders = {};
+                                for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i)
+                                    message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]);
+                            }
                             return message;
                         };
     
@@ -25626,6 +25676,8 @@
                                 object.contexts = [];
                                 object.sessionEntityTypes = [];
                             }
+                            if (options.objects || options.defaults)
+                                object.webhookHeaders = {};
                             if (options.defaults) {
                                 object.timeZone = "";
                                 object.geoLocation = null;
@@ -25653,6 +25705,12 @@
                                 object.payload = $root.google.protobuf.Struct.toObject(message.payload, options);
                             if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig"))
                                 object.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.toObject(message.sentimentAnalysisRequestConfig, options);
+                            var keys2;
+                            if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) {
+                                object.webhookHeaders = {};
+                                for (var j = 0; j < keys2.length; ++j)
+                                    object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]];
+                            }
                             return object;
                         };
     
diff --git a/packages/google-cloud-dialogflow/protos/protos.json b/packages/google-cloud-dialogflow/protos/protos.json
index 4f7de168466..4029e6edbac 100644
--- a/packages/google-cloud-dialogflow/protos/protos.json
+++ b/packages/google-cloud-dialogflow/protos/protos.json
@@ -287,6 +287,7 @@
                           "type": "MatchMode",
                           "id": 9,
                           "options": {
+                            "deprecated": true,
                             "(google.api.field_behavior)": "OPTIONAL"
                           }
                         },
@@ -3334,6 +3335,11 @@
                         "sentimentAnalysisRequestConfig": {
                           "type": "SentimentAnalysisRequestConfig",
                           "id": 10
+                        },
+                        "webhookHeaders": {
+                          "keyType": "string",
+                          "type": "string",
+                          "id": 14
                         }
                       }
                     },
diff --git a/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json b/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json
index a460c3c7430..9fc8a3e0e7d 100644
--- a/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json
+++ b/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json
@@ -4,281 +4,523 @@
   "language": "typescript",
   "protoPackage": "google.cloud.dialogflow.v2",
   "libraryPackage": "@google-cloud/dialogflow",
-  "services": {"Agents": {"clients": {
+  "services": {
+    "Agents": {
+      "clients": {
         "grpc": {
           "libraryClient": "AgentsClient",
-          "rpcs": {"GetAgent": {
-              "methods": ["getAgent"]
-            },"SetAgent": {
-              "methods": ["setAgent"]
-            },"DeleteAgent": {
-              "methods": ["deleteAgent"]
-            },"GetValidationResult": {
-              "methods": ["getValidationResult"]
-            },"TrainAgent": {
-              "methods": ["trainAgent"]
-            },"ExportAgent": {
-              "methods": ["exportAgent"]
-            },"ImportAgent": {
-              "methods": ["importAgent"]
-            },"RestoreAgent": {
-              "methods": ["restoreAgent"]
-            },"SearchAgents": {
-              "methods": [
-                            "searchAgents",
-                            "searchAgentsStream",
-                            "searchAgentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetAgent": {
+              "methods": [
+                "getAgent"
+              ]
+            },
+            "SetAgent": {
+              "methods": [
+                "setAgent"
+              ]
+            },
+            "DeleteAgent": {
+              "methods": [
+                "deleteAgent"
+              ]
+            },
+            "GetValidationResult": {
+              "methods": [
+                "getValidationResult"
+              ]
+            },
+            "TrainAgent": {
+              "methods": [
+                "trainAgent"
+              ]
+            },
+            "ExportAgent": {
+              "methods": [
+                "exportAgent"
+              ]
+            },
+            "ImportAgent": {
+              "methods": [
+                "importAgent"
+              ]
+            },
+            "RestoreAgent": {
+              "methods": [
+                "restoreAgent"
+              ]
+            },
+            "SearchAgents": {
+              "methods": [
+                "searchAgents",
+                "searchAgentsStream",
+                "searchAgentsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "AgentsClient",
-          "rpcs": {"GetAgent": {
-              "methods": ["getAgent"]
-            },"SetAgent": {
-              "methods": ["setAgent"]
-            },"DeleteAgent": {
-              "methods": ["deleteAgent"]
-            },"GetValidationResult": {
-              "methods": ["getValidationResult"]
-            },"TrainAgent": {
-              "methods": ["trainAgent"]
-            },"ExportAgent": {
-              "methods": ["exportAgent"]
-            },"ImportAgent": {
-              "methods": ["importAgent"]
-            },"RestoreAgent": {
-              "methods": ["restoreAgent"]
-            },"SearchAgents": {
-              "methods": [
-                            "searchAgents",
-                            "searchAgentsStream",
-                            "searchAgentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetAgent": {
+              "methods": [
+                "getAgent"
+              ]
+            },
+            "SetAgent": {
+              "methods": [
+                "setAgent"
+              ]
+            },
+            "DeleteAgent": {
+              "methods": [
+                "deleteAgent"
+              ]
+            },
+            "GetValidationResult": {
+              "methods": [
+                "getValidationResult"
+              ]
+            },
+            "TrainAgent": {
+              "methods": [
+                "trainAgent"
+              ]
+            },
+            "ExportAgent": {
+              "methods": [
+                "exportAgent"
+              ]
+            },
+            "ImportAgent": {
+              "methods": [
+                "importAgent"
+              ]
+            },
+            "RestoreAgent": {
+              "methods": [
+                "restoreAgent"
+              ]
+            },
+            "SearchAgents": {
+              "methods": [
+                "searchAgents",
+                "searchAgentsStream",
+                "searchAgentsAsync"
+              ]
+            }
+          }
         }
       }
-    },"Contexts": {"clients": {
+    },
+    "Contexts": {
+      "clients": {
         "grpc": {
           "libraryClient": "ContextsClient",
-          "rpcs": {"GetContext": {
-              "methods": ["getContext"]
-            },"CreateContext": {
-              "methods": ["createContext"]
-            },"UpdateContext": {
-              "methods": ["updateContext"]
-            },"DeleteContext": {
-              "methods": ["deleteContext"]
-            },"DeleteAllContexts": {
-              "methods": ["deleteAllContexts"]
-            },"ListContexts": {
-              "methods": [
-                            "listContexts",
-                            "listContextsStream",
-                            "listContextsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetContext": {
+              "methods": [
+                "getContext"
+              ]
+            },
+            "CreateContext": {
+              "methods": [
+                "createContext"
+              ]
+            },
+            "UpdateContext": {
+              "methods": [
+                "updateContext"
+              ]
+            },
+            "DeleteContext": {
+              "methods": [
+                "deleteContext"
+              ]
+            },
+            "DeleteAllContexts": {
+              "methods": [
+                "deleteAllContexts"
+              ]
+            },
+            "ListContexts": {
+              "methods": [
+                "listContexts",
+                "listContextsStream",
+                "listContextsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "ContextsClient",
-          "rpcs": {"GetContext": {
-              "methods": ["getContext"]
-            },"CreateContext": {
-              "methods": ["createContext"]
-            },"UpdateContext": {
-              "methods": ["updateContext"]
-            },"DeleteContext": {
-              "methods": ["deleteContext"]
-            },"DeleteAllContexts": {
-              "methods": ["deleteAllContexts"]
-            },"ListContexts": {
-              "methods": [
-                            "listContexts",
-                            "listContextsStream",
-                            "listContextsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetContext": {
+              "methods": [
+                "getContext"
+              ]
+            },
+            "CreateContext": {
+              "methods": [
+                "createContext"
+              ]
+            },
+            "UpdateContext": {
+              "methods": [
+                "updateContext"
+              ]
+            },
+            "DeleteContext": {
+              "methods": [
+                "deleteContext"
+              ]
+            },
+            "DeleteAllContexts": {
+              "methods": [
+                "deleteAllContexts"
+              ]
+            },
+            "ListContexts": {
+              "methods": [
+                "listContexts",
+                "listContextsStream",
+                "listContextsAsync"
+              ]
+            }
+          }
         }
       }
-    },"EntityTypes": {"clients": {
+    },
+    "EntityTypes": {
+      "clients": {
         "grpc": {
           "libraryClient": "EntityTypesClient",
-          "rpcs": {"GetEntityType": {
-              "methods": ["getEntityType"]
-            },"CreateEntityType": {
-              "methods": ["createEntityType"]
-            },"UpdateEntityType": {
-              "methods": ["updateEntityType"]
-            },"DeleteEntityType": {
-              "methods": ["deleteEntityType"]
-            },"BatchUpdateEntityTypes": {
-              "methods": ["batchUpdateEntityTypes"]
-            },"BatchDeleteEntityTypes": {
-              "methods": ["batchDeleteEntityTypes"]
-            },"BatchCreateEntities": {
-              "methods": ["batchCreateEntities"]
-            },"BatchUpdateEntities": {
-              "methods": ["batchUpdateEntities"]
-            },"BatchDeleteEntities": {
-              "methods": ["batchDeleteEntities"]
-            },"ListEntityTypes": {
-              "methods": [
-                            "listEntityTypes",
-                            "listEntityTypesStream",
-                            "listEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetEntityType": {
+              "methods": [
+                "getEntityType"
+              ]
+            },
+            "CreateEntityType": {
+              "methods": [
+                "createEntityType"
+              ]
+            },
+            "UpdateEntityType": {
+              "methods": [
+                "updateEntityType"
+              ]
+            },
+            "DeleteEntityType": {
+              "methods": [
+                "deleteEntityType"
+              ]
+            },
+            "BatchUpdateEntityTypes": {
+              "methods": [
+                "batchUpdateEntityTypes"
+              ]
+            },
+            "BatchDeleteEntityTypes": {
+              "methods": [
+                "batchDeleteEntityTypes"
+              ]
+            },
+            "BatchCreateEntities": {
+              "methods": [
+                "batchCreateEntities"
+              ]
+            },
+            "BatchUpdateEntities": {
+              "methods": [
+                "batchUpdateEntities"
+              ]
+            },
+            "BatchDeleteEntities": {
+              "methods": [
+                "batchDeleteEntities"
+              ]
+            },
+            "ListEntityTypes": {
+              "methods": [
+                "listEntityTypes",
+                "listEntityTypesStream",
+                "listEntityTypesAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "EntityTypesClient",
-          "rpcs": {"GetEntityType": {
-              "methods": ["getEntityType"]
-            },"CreateEntityType": {
-              "methods": ["createEntityType"]
-            },"UpdateEntityType": {
-              "methods": ["updateEntityType"]
-            },"DeleteEntityType": {
-              "methods": ["deleteEntityType"]
-            },"BatchUpdateEntityTypes": {
-              "methods": ["batchUpdateEntityTypes"]
-            },"BatchDeleteEntityTypes": {
-              "methods": ["batchDeleteEntityTypes"]
-            },"BatchCreateEntities": {
-              "methods": ["batchCreateEntities"]
-            },"BatchUpdateEntities": {
-              "methods": ["batchUpdateEntities"]
-            },"BatchDeleteEntities": {
-              "methods": ["batchDeleteEntities"]
-            },"ListEntityTypes": {
-              "methods": [
-                            "listEntityTypes",
-                            "listEntityTypesStream",
-                            "listEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetEntityType": {
+              "methods": [
+                "getEntityType"
+              ]
+            },
+            "CreateEntityType": {
+              "methods": [
+                "createEntityType"
+              ]
+            },
+            "UpdateEntityType": {
+              "methods": [
+                "updateEntityType"
+              ]
+            },
+            "DeleteEntityType": {
+              "methods": [
+                "deleteEntityType"
+              ]
+            },
+            "BatchUpdateEntityTypes": {
+              "methods": [
+                "batchUpdateEntityTypes"
+              ]
+            },
+            "BatchDeleteEntityTypes": {
+              "methods": [
+                "batchDeleteEntityTypes"
+              ]
+            },
+            "BatchCreateEntities": {
+              "methods": [
+                "batchCreateEntities"
+              ]
+            },
+            "BatchUpdateEntities": {
+              "methods": [
+                "batchUpdateEntities"
+              ]
+            },
+            "BatchDeleteEntities": {
+              "methods": [
+                "batchDeleteEntities"
+              ]
+            },
+            "ListEntityTypes": {
+              "methods": [
+                "listEntityTypes",
+                "listEntityTypesStream",
+                "listEntityTypesAsync"
+              ]
+            }
+          }
         }
       }
-    },"Environments": {"clients": {
+    },
+    "Environments": {
+      "clients": {
         "grpc": {
           "libraryClient": "EnvironmentsClient",
-          "rpcs": {"ListEnvironments": {
+          "rpcs": {
+            "ListEnvironments": {
               "methods": [
-                            "listEnvironments",
-                            "listEnvironmentsStream",
-                            "listEnvironmentsAsync"
+                "listEnvironments",
+                "listEnvironmentsStream",
+                "listEnvironmentsAsync"
               ]
-            }}
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "EnvironmentsClient",
-          "rpcs": {,"ListEnvironments": {
+          "rpcs": {
+            "ListEnvironments": {
               "methods": [
-                            "listEnvironments",
-                            "listEnvironmentsStream",
-                            "listEnvironmentsAsync"
+                "listEnvironments",
+                "listEnvironmentsStream",
+                "listEnvironmentsAsync"
               ]
-            }}
+            }
+          }
         }
       }
-    },"Intents": {"clients": {
+    },
+    "Intents": {
+      "clients": {
         "grpc": {
           "libraryClient": "IntentsClient",
-          "rpcs": {"GetIntent": {
-              "methods": ["getIntent"]
-            },"CreateIntent": {
-              "methods": ["createIntent"]
-            },"UpdateIntent": {
-              "methods": ["updateIntent"]
-            },"DeleteIntent": {
-              "methods": ["deleteIntent"]
-            },"BatchUpdateIntents": {
-              "methods": ["batchUpdateIntents"]
-            },"BatchDeleteIntents": {
-              "methods": ["batchDeleteIntents"]
-            },"ListIntents": {
-              "methods": [
-                            "listIntents",
-                            "listIntentsStream",
-                            "listIntentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetIntent": {
+              "methods": [
+                "getIntent"
+              ]
+            },
+            "CreateIntent": {
+              "methods": [
+                "createIntent"
+              ]
+            },
+            "UpdateIntent": {
+              "methods": [
+                "updateIntent"
+              ]
+            },
+            "DeleteIntent": {
+              "methods": [
+                "deleteIntent"
+              ]
+            },
+            "BatchUpdateIntents": {
+              "methods": [
+                "batchUpdateIntents"
+              ]
+            },
+            "BatchDeleteIntents": {
+              "methods": [
+                "batchDeleteIntents"
+              ]
+            },
+            "ListIntents": {
+              "methods": [
+                "listIntents",
+                "listIntentsStream",
+                "listIntentsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "IntentsClient",
-          "rpcs": {"GetIntent": {
-              "methods": ["getIntent"]
-            },"CreateIntent": {
-              "methods": ["createIntent"]
-            },"UpdateIntent": {
-              "methods": ["updateIntent"]
-            },"DeleteIntent": {
-              "methods": ["deleteIntent"]
-            },"BatchUpdateIntents": {
-              "methods": ["batchUpdateIntents"]
-            },"BatchDeleteIntents": {
-              "methods": ["batchDeleteIntents"]
-            },"ListIntents": {
-              "methods": [
-                            "listIntents",
-                            "listIntentsStream",
-                            "listIntentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetIntent": {
+              "methods": [
+                "getIntent"
+              ]
+            },
+            "CreateIntent": {
+              "methods": [
+                "createIntent"
+              ]
+            },
+            "UpdateIntent": {
+              "methods": [
+                "updateIntent"
+              ]
+            },
+            "DeleteIntent": {
+              "methods": [
+                "deleteIntent"
+              ]
+            },
+            "BatchUpdateIntents": {
+              "methods": [
+                "batchUpdateIntents"
+              ]
+            },
+            "BatchDeleteIntents": {
+              "methods": [
+                "batchDeleteIntents"
+              ]
+            },
+            "ListIntents": {
+              "methods": [
+                "listIntents",
+                "listIntentsStream",
+                "listIntentsAsync"
+              ]
+            }
+          }
         }
       }
-    },"SessionEntityTypes": {"clients": {
+    },
+    "SessionEntityTypes": {
+      "clients": {
         "grpc": {
           "libraryClient": "SessionEntityTypesClient",
-          "rpcs": {"GetSessionEntityType": {
-              "methods": ["getSessionEntityType"]
-            },"CreateSessionEntityType": {
-              "methods": ["createSessionEntityType"]
-            },"UpdateSessionEntityType": {
-              "methods": ["updateSessionEntityType"]
-            },"DeleteSessionEntityType": {
-              "methods": ["deleteSessionEntityType"]
-            },"ListSessionEntityTypes": {
-              "methods": [
-                            "listSessionEntityTypes",
-                            "listSessionEntityTypesStream",
-                            "listSessionEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetSessionEntityType": {
+              "methods": [
+                "getSessionEntityType"
+              ]
+            },
+            "CreateSessionEntityType": {
+              "methods": [
+                "createSessionEntityType"
+              ]
+            },
+            "UpdateSessionEntityType": {
+              "methods": [
+                "updateSessionEntityType"
+              ]
+            },
+            "DeleteSessionEntityType": {
+              "methods": [
+                "deleteSessionEntityType"
+              ]
+            },
+            "ListSessionEntityTypes": {
+              "methods": [
+                "listSessionEntityTypes",
+                "listSessionEntityTypesStream",
+                "listSessionEntityTypesAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "SessionEntityTypesClient",
-          "rpcs": {"GetSessionEntityType": {
-              "methods": ["getSessionEntityType"]
-            },"CreateSessionEntityType": {
-              "methods": ["createSessionEntityType"]
-            },"UpdateSessionEntityType": {
-              "methods": ["updateSessionEntityType"]
-            },"DeleteSessionEntityType": {
-              "methods": ["deleteSessionEntityType"]
-            },"ListSessionEntityTypes": {
-              "methods": [
-                            "listSessionEntityTypes",
-                            "listSessionEntityTypesStream",
-                            "listSessionEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetSessionEntityType": {
+              "methods": [
+                "getSessionEntityType"
+              ]
+            },
+            "CreateSessionEntityType": {
+              "methods": [
+                "createSessionEntityType"
+              ]
+            },
+            "UpdateSessionEntityType": {
+              "methods": [
+                "updateSessionEntityType"
+              ]
+            },
+            "DeleteSessionEntityType": {
+              "methods": [
+                "deleteSessionEntityType"
+              ]
+            },
+            "ListSessionEntityTypes": {
+              "methods": [
+                "listSessionEntityTypes",
+                "listSessionEntityTypesStream",
+                "listSessionEntityTypesAsync"
+              ]
+            }
+          }
         }
       }
-    },"Sessions": {"clients": {
+    },
+    "Sessions": {
+      "clients": {
         "grpc": {
           "libraryClient": "SessionsClient",
-          "rpcs": {"DetectIntent": {
-              "methods": ["detectIntent"]
-            },"StreamingDetectIntent": {
-              "methods": ["streamingDetectIntent"]
-            }}
+          "rpcs": {
+            "DetectIntent": {
+              "methods": [
+                "detectIntent"
+              ]
+            },
+            "StreamingDetectIntent": {
+              "methods": [
+                "streamingDetectIntent"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "SessionsClient",
-          "rpcs": {"DetectIntent": {
-              "methods": ["detectIntent"]
-            }}
+          "rpcs": {
+            "DetectIntent": {
+              "methods": [
+                "detectIntent"
+              ]
+            }
+          }
         }
       }
-    }}
+    }
+  }
 }
diff --git a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts
index f196653b586..9d3395ae864 100644
--- a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts
+++ b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts
@@ -362,6 +362,10 @@ export class SessionsClient {
    * and session entity types to be updated, which in turn might affect
    * results of future queries.
    *
+   * Note: Always use agent versions for production traffic.
+   * See [Versions and
+   * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
+   *
    * @param {Object} request
    *   The request object that will be sent.
    * @param {string} request.session
@@ -377,6 +381,10 @@ export class SessionsClient {
    *
    *   For more information, see the [API interactions
    *   guide](https://cloud.google.com/dialogflow/docs/api-overview).
+   *
+   *   Note: Always use agent versions for production traffic.
+   *   See [Versions and
+   *   environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
    * @param {google.cloud.dialogflow.v2.QueryParameters} request.queryParams
    *   The parameters of this query.
    * @param {google.cloud.dialogflow.v2.QueryInput} request.queryInput
@@ -393,12 +401,14 @@ export class SessionsClient {
    *   audio. If this field is not set and agent-level speech synthesizer is not
    *   configured, no output audio is generated.
    * @param {google.protobuf.FieldMask} request.outputAudioConfigMask
-   *   Mask for {@link google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config|output_audio_config} indicating which settings in this
-   *   request-level config should override speech synthesizer settings defined at
-   *   agent-level.
+   *   Mask for
+   *   {@link google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config|output_audio_config}
+   *   indicating which settings in this request-level config should override
+   *   speech synthesizer settings defined at agent-level.
    *
-   *   If unspecified or empty, {@link google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config|output_audio_config} replaces the agent-level
-   *   config in its entirety.
+   *   If unspecified or empty,
+   *   {@link google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config|output_audio_config}
+   *   replaces the agent-level config in its entirety.
    * @param {Buffer} request.inputAudio
    *   The natural language speech audio to be processed. This field
    *   should be populated iff `query_input` is set to an input audio config.
@@ -461,6 +471,10 @@ export class SessionsClient {
    * and returns structured, actionable data as a result. This method is only
    * available via the gRPC API (not REST).
    *
+   * Note: Always use agent versions for production traffic.
+   * See [Versions and
+   * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
+   *
    * @param {object} [options]
    *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
    * @returns {Stream}
diff --git a/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json b/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json
index b791847979b..ed5878ccdfa 100644
--- a/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json
+++ b/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json
@@ -4,361 +4,669 @@
   "language": "typescript",
   "protoPackage": "google.cloud.dialogflow.v2beta1",
   "libraryPackage": "@google-cloud/dialogflow",
-  "services": {"Agents": {"clients": {
+  "services": {
+    "Agents": {
+      "clients": {
         "grpc": {
           "libraryClient": "AgentsClient",
-          "rpcs": {"GetAgent": {
-              "methods": ["getAgent"]
-            },"SetAgent": {
-              "methods": ["setAgent"]
-            },"DeleteAgent": {
-              "methods": ["deleteAgent"]
-            },"GetValidationResult": {
-              "methods": ["getValidationResult"]
-            },"TrainAgent": {
-              "methods": ["trainAgent"]
-            },"ExportAgent": {
-              "methods": ["exportAgent"]
-            },"ImportAgent": {
-              "methods": ["importAgent"]
-            },"RestoreAgent": {
-              "methods": ["restoreAgent"]
-            },"SearchAgents": {
-              "methods": [
-                            "searchAgents",
-                            "searchAgentsStream",
-                            "searchAgentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetAgent": {
+              "methods": [
+                "getAgent"
+              ]
+            },
+            "SetAgent": {
+              "methods": [
+                "setAgent"
+              ]
+            },
+            "DeleteAgent": {
+              "methods": [
+                "deleteAgent"
+              ]
+            },
+            "GetValidationResult": {
+              "methods": [
+                "getValidationResult"
+              ]
+            },
+            "TrainAgent": {
+              "methods": [
+                "trainAgent"
+              ]
+            },
+            "ExportAgent": {
+              "methods": [
+                "exportAgent"
+              ]
+            },
+            "ImportAgent": {
+              "methods": [
+                "importAgent"
+              ]
+            },
+            "RestoreAgent": {
+              "methods": [
+                "restoreAgent"
+              ]
+            },
+            "SearchAgents": {
+              "methods": [
+                "searchAgents",
+                "searchAgentsStream",
+                "searchAgentsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "AgentsClient",
-          "rpcs": {"GetAgent": {
-              "methods": ["getAgent"]
-            },"SetAgent": {
-              "methods": ["setAgent"]
-            },"DeleteAgent": {
-              "methods": ["deleteAgent"]
-            },"GetValidationResult": {
-              "methods": ["getValidationResult"]
-            },"TrainAgent": {
-              "methods": ["trainAgent"]
-            },"ExportAgent": {
-              "methods": ["exportAgent"]
-            },"ImportAgent": {
-              "methods": ["importAgent"]
-            },"RestoreAgent": {
-              "methods": ["restoreAgent"]
-            },"SearchAgents": {
-              "methods": [
-                            "searchAgents",
-                            "searchAgentsStream",
-                            "searchAgentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetAgent": {
+              "methods": [
+                "getAgent"
+              ]
+            },
+            "SetAgent": {
+              "methods": [
+                "setAgent"
+              ]
+            },
+            "DeleteAgent": {
+              "methods": [
+                "deleteAgent"
+              ]
+            },
+            "GetValidationResult": {
+              "methods": [
+                "getValidationResult"
+              ]
+            },
+            "TrainAgent": {
+              "methods": [
+                "trainAgent"
+              ]
+            },
+            "ExportAgent": {
+              "methods": [
+                "exportAgent"
+              ]
+            },
+            "ImportAgent": {
+              "methods": [
+                "importAgent"
+              ]
+            },
+            "RestoreAgent": {
+              "methods": [
+                "restoreAgent"
+              ]
+            },
+            "SearchAgents": {
+              "methods": [
+                "searchAgents",
+                "searchAgentsStream",
+                "searchAgentsAsync"
+              ]
+            }
+          }
         }
       }
-    },"Contexts": {"clients": {
+    },
+    "Contexts": {
+      "clients": {
         "grpc": {
           "libraryClient": "ContextsClient",
-          "rpcs": {"GetContext": {
-              "methods": ["getContext"]
-            },"CreateContext": {
-              "methods": ["createContext"]
-            },"UpdateContext": {
-              "methods": ["updateContext"]
-            },"DeleteContext": {
-              "methods": ["deleteContext"]
-            },"DeleteAllContexts": {
-              "methods": ["deleteAllContexts"]
-            },"ListContexts": {
-              "methods": [
-                            "listContexts",
-                            "listContextsStream",
-                            "listContextsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetContext": {
+              "methods": [
+                "getContext"
+              ]
+            },
+            "CreateContext": {
+              "methods": [
+                "createContext"
+              ]
+            },
+            "UpdateContext": {
+              "methods": [
+                "updateContext"
+              ]
+            },
+            "DeleteContext": {
+              "methods": [
+                "deleteContext"
+              ]
+            },
+            "DeleteAllContexts": {
+              "methods": [
+                "deleteAllContexts"
+              ]
+            },
+            "ListContexts": {
+              "methods": [
+                "listContexts",
+                "listContextsStream",
+                "listContextsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "ContextsClient",
-          "rpcs": {"GetContext": {
-              "methods": ["getContext"]
-            },"CreateContext": {
-              "methods": ["createContext"]
-            },"UpdateContext": {
-              "methods": ["updateContext"]
-            },"DeleteContext": {
-              "methods": ["deleteContext"]
-            },"DeleteAllContexts": {
-              "methods": ["deleteAllContexts"]
-            },"ListContexts": {
-              "methods": [
-                            "listContexts",
-                            "listContextsStream",
-                            "listContextsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetContext": {
+              "methods": [
+                "getContext"
+              ]
+            },
+            "CreateContext": {
+              "methods": [
+                "createContext"
+              ]
+            },
+            "UpdateContext": {
+              "methods": [
+                "updateContext"
+              ]
+            },
+            "DeleteContext": {
+              "methods": [
+                "deleteContext"
+              ]
+            },
+            "DeleteAllContexts": {
+              "methods": [
+                "deleteAllContexts"
+              ]
+            },
+            "ListContexts": {
+              "methods": [
+                "listContexts",
+                "listContextsStream",
+                "listContextsAsync"
+              ]
+            }
+          }
         }
       }
-    },"Documents": {"clients": {
+    },
+    "Documents": {
+      "clients": {
         "grpc": {
           "libraryClient": "DocumentsClient",
-          "rpcs": {"GetDocument": {
-              "methods": ["getDocument"]
-            },"CreateDocument": {
-              "methods": ["createDocument"]
-            },"DeleteDocument": {
-              "methods": ["deleteDocument"]
-            },"UpdateDocument": {
-              "methods": ["updateDocument"]
-            },"ReloadDocument": {
-              "methods": ["reloadDocument"]
-            },"ListDocuments": {
-              "methods": [
-                            "listDocuments",
-                            "listDocumentsStream",
-                            "listDocumentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetDocument": {
+              "methods": [
+                "getDocument"
+              ]
+            },
+            "CreateDocument": {
+              "methods": [
+                "createDocument"
+              ]
+            },
+            "DeleteDocument": {
+              "methods": [
+                "deleteDocument"
+              ]
+            },
+            "UpdateDocument": {
+              "methods": [
+                "updateDocument"
+              ]
+            },
+            "ReloadDocument": {
+              "methods": [
+                "reloadDocument"
+              ]
+            },
+            "ListDocuments": {
+              "methods": [
+                "listDocuments",
+                "listDocumentsStream",
+                "listDocumentsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "DocumentsClient",
-          "rpcs": {"GetDocument": {
-              "methods": ["getDocument"]
-            },"CreateDocument": {
-              "methods": ["createDocument"]
-            },"DeleteDocument": {
-              "methods": ["deleteDocument"]
-            },"UpdateDocument": {
-              "methods": ["updateDocument"]
-            },"ReloadDocument": {
-              "methods": ["reloadDocument"]
-            },"ListDocuments": {
-              "methods": [
-                            "listDocuments",
-                            "listDocumentsStream",
-                            "listDocumentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetDocument": {
+              "methods": [
+                "getDocument"
+              ]
+            },
+            "CreateDocument": {
+              "methods": [
+                "createDocument"
+              ]
+            },
+            "DeleteDocument": {
+              "methods": [
+                "deleteDocument"
+              ]
+            },
+            "UpdateDocument": {
+              "methods": [
+                "updateDocument"
+              ]
+            },
+            "ReloadDocument": {
+              "methods": [
+                "reloadDocument"
+              ]
+            },
+            "ListDocuments": {
+              "methods": [
+                "listDocuments",
+                "listDocumentsStream",
+                "listDocumentsAsync"
+              ]
+            }
+          }
         }
       }
-    },"EntityTypes": {"clients": {
+    },
+    "EntityTypes": {
+      "clients": {
         "grpc": {
           "libraryClient": "EntityTypesClient",
-          "rpcs": {"GetEntityType": {
-              "methods": ["getEntityType"]
-            },"CreateEntityType": {
-              "methods": ["createEntityType"]
-            },"UpdateEntityType": {
-              "methods": ["updateEntityType"]
-            },"DeleteEntityType": {
-              "methods": ["deleteEntityType"]
-            },"BatchUpdateEntityTypes": {
-              "methods": ["batchUpdateEntityTypes"]
-            },"BatchDeleteEntityTypes": {
-              "methods": ["batchDeleteEntityTypes"]
-            },"BatchCreateEntities": {
-              "methods": ["batchCreateEntities"]
-            },"BatchUpdateEntities": {
-              "methods": ["batchUpdateEntities"]
-            },"BatchDeleteEntities": {
-              "methods": ["batchDeleteEntities"]
-            },"ListEntityTypes": {
-              "methods": [
-                            "listEntityTypes",
-                            "listEntityTypesStream",
-                            "listEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetEntityType": {
+              "methods": [
+                "getEntityType"
+              ]
+            },
+            "CreateEntityType": {
+              "methods": [
+                "createEntityType"
+              ]
+            },
+            "UpdateEntityType": {
+              "methods": [
+                "updateEntityType"
+              ]
+            },
+            "DeleteEntityType": {
+              "methods": [
+                "deleteEntityType"
+              ]
+            },
+            "BatchUpdateEntityTypes": {
+              "methods": [
+                "batchUpdateEntityTypes"
+              ]
+            },
+            "BatchDeleteEntityTypes": {
+              "methods": [
+                "batchDeleteEntityTypes"
+              ]
+            },
+            "BatchCreateEntities": {
+              "methods": [
+                "batchCreateEntities"
+              ]
+            },
+            "BatchUpdateEntities": {
+              "methods": [
+                "batchUpdateEntities"
+              ]
+            },
+            "BatchDeleteEntities": {
+              "methods": [
+                "batchDeleteEntities"
+              ]
+            },
+            "ListEntityTypes": {
+              "methods": [
+                "listEntityTypes",
+                "listEntityTypesStream",
+                "listEntityTypesAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "EntityTypesClient",
-          "rpcs": {"GetEntityType": {
-              "methods": ["getEntityType"]
-            },"CreateEntityType": {
-              "methods": ["createEntityType"]
-            },"UpdateEntityType": {
-              "methods": ["updateEntityType"]
-            },"DeleteEntityType": {
-              "methods": ["deleteEntityType"]
-            },"BatchUpdateEntityTypes": {
-              "methods": ["batchUpdateEntityTypes"]
-            },"BatchDeleteEntityTypes": {
-              "methods": ["batchDeleteEntityTypes"]
-            },"BatchCreateEntities": {
-              "methods": ["batchCreateEntities"]
-            },"BatchUpdateEntities": {
-              "methods": ["batchUpdateEntities"]
-            },"BatchDeleteEntities": {
-              "methods": ["batchDeleteEntities"]
-            },"ListEntityTypes": {
-              "methods": [
-                            "listEntityTypes",
-                            "listEntityTypesStream",
-                            "listEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetEntityType": {
+              "methods": [
+                "getEntityType"
+              ]
+            },
+            "CreateEntityType": {
+              "methods": [
+                "createEntityType"
+              ]
+            },
+            "UpdateEntityType": {
+              "methods": [
+                "updateEntityType"
+              ]
+            },
+            "DeleteEntityType": {
+              "methods": [
+                "deleteEntityType"
+              ]
+            },
+            "BatchUpdateEntityTypes": {
+              "methods": [
+                "batchUpdateEntityTypes"
+              ]
+            },
+            "BatchDeleteEntityTypes": {
+              "methods": [
+                "batchDeleteEntityTypes"
+              ]
+            },
+            "BatchCreateEntities": {
+              "methods": [
+                "batchCreateEntities"
+              ]
+            },
+            "BatchUpdateEntities": {
+              "methods": [
+                "batchUpdateEntities"
+              ]
+            },
+            "BatchDeleteEntities": {
+              "methods": [
+                "batchDeleteEntities"
+              ]
+            },
+            "ListEntityTypes": {
+              "methods": [
+                "listEntityTypes",
+                "listEntityTypesStream",
+                "listEntityTypesAsync"
+              ]
+            }
+          }
         }
       }
-    },"Environments": {"clients": {
+    },
+    "Environments": {
+      "clients": {
         "grpc": {
           "libraryClient": "EnvironmentsClient",
-          "rpcs": {"ListEnvironments": {
+          "rpcs": {
+            "ListEnvironments": {
               "methods": [
-                            "listEnvironments",
-                            "listEnvironmentsStream",
-                            "listEnvironmentsAsync"
+                "listEnvironments",
+                "listEnvironmentsStream",
+                "listEnvironmentsAsync"
               ]
-            }}
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "EnvironmentsClient",
-          "rpcs": {,"ListEnvironments": {
+          "rpcs": {
+            "ListEnvironments": {
               "methods": [
-                            "listEnvironments",
-                            "listEnvironmentsStream",
-                            "listEnvironmentsAsync"
+                "listEnvironments",
+                "listEnvironmentsStream",
+                "listEnvironmentsAsync"
               ]
-            }}
+            }
+          }
         }
       }
-    },"Intents": {"clients": {
+    },
+    "Intents": {
+      "clients": {
         "grpc": {
           "libraryClient": "IntentsClient",
-          "rpcs": {"GetIntent": {
-              "methods": ["getIntent"]
-            },"CreateIntent": {
-              "methods": ["createIntent"]
-            },"UpdateIntent": {
-              "methods": ["updateIntent"]
-            },"DeleteIntent": {
-              "methods": ["deleteIntent"]
-            },"BatchUpdateIntents": {
-              "methods": ["batchUpdateIntents"]
-            },"BatchDeleteIntents": {
-              "methods": ["batchDeleteIntents"]
-            },"ListIntents": {
-              "methods": [
-                            "listIntents",
-                            "listIntentsStream",
-                            "listIntentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetIntent": {
+              "methods": [
+                "getIntent"
+              ]
+            },
+            "CreateIntent": {
+              "methods": [
+                "createIntent"
+              ]
+            },
+            "UpdateIntent": {
+              "methods": [
+                "updateIntent"
+              ]
+            },
+            "DeleteIntent": {
+              "methods": [
+                "deleteIntent"
+              ]
+            },
+            "BatchUpdateIntents": {
+              "methods": [
+                "batchUpdateIntents"
+              ]
+            },
+            "BatchDeleteIntents": {
+              "methods": [
+                "batchDeleteIntents"
+              ]
+            },
+            "ListIntents": {
+              "methods": [
+                "listIntents",
+                "listIntentsStream",
+                "listIntentsAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "IntentsClient",
-          "rpcs": {"GetIntent": {
-              "methods": ["getIntent"]
-            },"CreateIntent": {
-              "methods": ["createIntent"]
-            },"UpdateIntent": {
-              "methods": ["updateIntent"]
-            },"DeleteIntent": {
-              "methods": ["deleteIntent"]
-            },"BatchUpdateIntents": {
-              "methods": ["batchUpdateIntents"]
-            },"BatchDeleteIntents": {
-              "methods": ["batchDeleteIntents"]
-            },"ListIntents": {
-              "methods": [
-                            "listIntents",
-                            "listIntentsStream",
-                            "listIntentsAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetIntent": {
+              "methods": [
+                "getIntent"
+              ]
+            },
+            "CreateIntent": {
+              "methods": [
+                "createIntent"
+              ]
+            },
+            "UpdateIntent": {
+              "methods": [
+                "updateIntent"
+              ]
+            },
+            "DeleteIntent": {
+              "methods": [
+                "deleteIntent"
+              ]
+            },
+            "BatchUpdateIntents": {
+              "methods": [
+                "batchUpdateIntents"
+              ]
+            },
+            "BatchDeleteIntents": {
+              "methods": [
+                "batchDeleteIntents"
+              ]
+            },
+            "ListIntents": {
+              "methods": [
+                "listIntents",
+                "listIntentsStream",
+                "listIntentsAsync"
+              ]
+            }
+          }
         }
       }
-    },"KnowledgeBases": {"clients": {
+    },
+    "KnowledgeBases": {
+      "clients": {
         "grpc": {
           "libraryClient": "KnowledgeBasesClient",
-          "rpcs": {"GetKnowledgeBase": {
-              "methods": ["getKnowledgeBase"]
-            },"CreateKnowledgeBase": {
-              "methods": ["createKnowledgeBase"]
-            },"DeleteKnowledgeBase": {
-              "methods": ["deleteKnowledgeBase"]
-            },"UpdateKnowledgeBase": {
-              "methods": ["updateKnowledgeBase"]
-            },"ListKnowledgeBases": {
-              "methods": [
-                            "listKnowledgeBases",
-                            "listKnowledgeBasesStream",
-                            "listKnowledgeBasesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetKnowledgeBase": {
+              "methods": [
+                "getKnowledgeBase"
+              ]
+            },
+            "CreateKnowledgeBase": {
+              "methods": [
+                "createKnowledgeBase"
+              ]
+            },
+            "DeleteKnowledgeBase": {
+              "methods": [
+                "deleteKnowledgeBase"
+              ]
+            },
+            "UpdateKnowledgeBase": {
+              "methods": [
+                "updateKnowledgeBase"
+              ]
+            },
+            "ListKnowledgeBases": {
+              "methods": [
+                "listKnowledgeBases",
+                "listKnowledgeBasesStream",
+                "listKnowledgeBasesAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "KnowledgeBasesClient",
-          "rpcs": {"GetKnowledgeBase": {
-              "methods": ["getKnowledgeBase"]
-            },"CreateKnowledgeBase": {
-              "methods": ["createKnowledgeBase"]
-            },"DeleteKnowledgeBase": {
-              "methods": ["deleteKnowledgeBase"]
-            },"UpdateKnowledgeBase": {
-              "methods": ["updateKnowledgeBase"]
-            },"ListKnowledgeBases": {
-              "methods": [
-                            "listKnowledgeBases",
-                            "listKnowledgeBasesStream",
-                            "listKnowledgeBasesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetKnowledgeBase": {
+              "methods": [
+                "getKnowledgeBase"
+              ]
+            },
+            "CreateKnowledgeBase": {
+              "methods": [
+                "createKnowledgeBase"
+              ]
+            },
+            "DeleteKnowledgeBase": {
+              "methods": [
+                "deleteKnowledgeBase"
+              ]
+            },
+            "UpdateKnowledgeBase": {
+              "methods": [
+                "updateKnowledgeBase"
+              ]
+            },
+            "ListKnowledgeBases": {
+              "methods": [
+                "listKnowledgeBases",
+                "listKnowledgeBasesStream",
+                "listKnowledgeBasesAsync"
+              ]
+            }
+          }
         }
       }
-    },"SessionEntityTypes": {"clients": {
+    },
+    "SessionEntityTypes": {
+      "clients": {
         "grpc": {
           "libraryClient": "SessionEntityTypesClient",
-          "rpcs": {"GetSessionEntityType": {
-              "methods": ["getSessionEntityType"]
-            },"CreateSessionEntityType": {
-              "methods": ["createSessionEntityType"]
-            },"UpdateSessionEntityType": {
-              "methods": ["updateSessionEntityType"]
-            },"DeleteSessionEntityType": {
-              "methods": ["deleteSessionEntityType"]
-            },"ListSessionEntityTypes": {
-              "methods": [
-                            "listSessionEntityTypes",
-                            "listSessionEntityTypesStream",
-                            "listSessionEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetSessionEntityType": {
+              "methods": [
+                "getSessionEntityType"
+              ]
+            },
+            "CreateSessionEntityType": {
+              "methods": [
+                "createSessionEntityType"
+              ]
+            },
+            "UpdateSessionEntityType": {
+              "methods": [
+                "updateSessionEntityType"
+              ]
+            },
+            "DeleteSessionEntityType": {
+              "methods": [
+                "deleteSessionEntityType"
+              ]
+            },
+            "ListSessionEntityTypes": {
+              "methods": [
+                "listSessionEntityTypes",
+                "listSessionEntityTypesStream",
+                "listSessionEntityTypesAsync"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "SessionEntityTypesClient",
-          "rpcs": {"GetSessionEntityType": {
-              "methods": ["getSessionEntityType"]
-            },"CreateSessionEntityType": {
-              "methods": ["createSessionEntityType"]
-            },"UpdateSessionEntityType": {
-              "methods": ["updateSessionEntityType"]
-            },"DeleteSessionEntityType": {
-              "methods": ["deleteSessionEntityType"]
-            },"ListSessionEntityTypes": {
-              "methods": [
-                            "listSessionEntityTypes",
-                            "listSessionEntityTypesStream",
-                            "listSessionEntityTypesAsync"
-              ]
-            }}
+          "rpcs": {
+            "GetSessionEntityType": {
+              "methods": [
+                "getSessionEntityType"
+              ]
+            },
+            "CreateSessionEntityType": {
+              "methods": [
+                "createSessionEntityType"
+              ]
+            },
+            "UpdateSessionEntityType": {
+              "methods": [
+                "updateSessionEntityType"
+              ]
+            },
+            "DeleteSessionEntityType": {
+              "methods": [
+                "deleteSessionEntityType"
+              ]
+            },
+            "ListSessionEntityTypes": {
+              "methods": [
+                "listSessionEntityTypes",
+                "listSessionEntityTypesStream",
+                "listSessionEntityTypesAsync"
+              ]
+            }
+          }
         }
       }
-    },"Sessions": {"clients": {
+    },
+    "Sessions": {
+      "clients": {
         "grpc": {
           "libraryClient": "SessionsClient",
-          "rpcs": {"DetectIntent": {
-              "methods": ["detectIntent"]
-            },"StreamingDetectIntent": {
-              "methods": ["streamingDetectIntent"]
-            }}
+          "rpcs": {
+            "DetectIntent": {
+              "methods": [
+                "detectIntent"
+              ]
+            },
+            "StreamingDetectIntent": {
+              "methods": [
+                "streamingDetectIntent"
+              ]
+            }
+          }
         },
         "grpc-fallback": {
           "libraryClient": "SessionsClient",
-          "rpcs": {"DetectIntent": {
-              "methods": ["detectIntent"]
-            }}
+          "rpcs": {
+            "DetectIntent": {
+              "methods": [
+                "detectIntent"
+              ]
+            }
+          }
         }
       }
-    }}
+    }
+  }
 }
diff --git a/packages/google-cloud-dialogflow/synth.metadata b/packages/google-cloud-dialogflow/synth.metadata
index 929ec5ed652..9127e5c9f32 100644
--- a/packages/google-cloud-dialogflow/synth.metadata
+++ b/packages/google-cloud-dialogflow/synth.metadata
@@ -4,15 +4,15 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/nodejs-dialogflow.git",
-        "sha": "be20d3df79b8b0dca4c5993943df157601343764"
+        "sha": "b6f5738613fc5af49b966d4a8c4137921abed5ef"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "d189e871205fea665a9648f7c4676f027495ccaf",
-        "internalRef": "345596855"
+        "sha": "519e9dcdff23cc14d48f85e9e00b6214ec57967e",
+        "internalRef": "345742559"
       }
     },
     {