1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.dialogflow.cx.v3beta1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; 24import "google/protobuf/duration.proto"; 25import "google/protobuf/empty.proto"; 26import "google/protobuf/field_mask.proto"; 27import "google/protobuf/struct.proto"; 28 29option cc_enable_arenas = true; 30option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; 31option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb"; 32option java_multiple_files = true; 33option java_outer_classname = "WebhookProto"; 34option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; 35option objc_class_prefix = "DF"; 36option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; 37option (google.api.resource_definition) = { 38 type: "servicedirectory.googleapis.com/Service" 39 pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" 40}; 41 42// Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. 43service Webhooks { 44 option (google.api.default_host) = "dialogflow.googleapis.com"; 45 option (google.api.oauth_scopes) = 46 "https://www.googleapis.com/auth/cloud-platform," 47 "https://www.googleapis.com/auth/dialogflow"; 48 49 // Returns the list of all webhooks in the specified agent. 50 rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) { 51 option (google.api.http) = { 52 get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" 53 }; 54 option (google.api.method_signature) = "parent"; 55 } 56 57 // Retrieves the specified webhook. 58 rpc GetWebhook(GetWebhookRequest) returns (Webhook) { 59 option (google.api.http) = { 60 get: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" 61 }; 62 option (google.api.method_signature) = "name"; 63 } 64 65 // Creates a webhook in the specified agent. 66 rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) { 67 option (google.api.http) = { 68 post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" 69 body: "webhook" 70 }; 71 option (google.api.method_signature) = "parent,webhook"; 72 } 73 74 // Updates the specified webhook. 75 rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) { 76 option (google.api.http) = { 77 patch: "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}" 78 body: "webhook" 79 }; 80 option (google.api.method_signature) = "webhook,update_mask"; 81 } 82 83 // Deletes the specified webhook. 84 rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) { 85 option (google.api.http) = { 86 delete: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" 87 }; 88 option (google.api.method_signature) = "name"; 89 } 90} 91 92// Webhooks host the developer's business logic. During a session, webhooks 93// allow the developer to use the data extracted by Dialogflow's natural 94// language processing to generate dynamic responses, validate collected data, 95// or trigger actions on the backend. 96message Webhook { 97 option (google.api.resource) = { 98 type: "dialogflow.googleapis.com/Webhook" 99 pattern: "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" 100 }; 101 102 // Represents configuration for a generic web service. 103 message GenericWebService { 104 // Represents configuration of OAuth client credential flow for 3rd party 105 // API authentication. 106 message OAuthConfig { 107 // Required. The client ID provided by the 3rd party platform. 108 string client_id = 1 [(google.api.field_behavior) = REQUIRED]; 109 110 // Required. The client secret provided by the 3rd party platform. 111 string client_secret = 2 [(google.api.field_behavior) = REQUIRED]; 112 113 // Required. The token endpoint provided by the 3rd party platform to 114 // exchange an access token. 115 string token_endpoint = 3 [(google.api.field_behavior) = REQUIRED]; 116 117 // Optional. The OAuth scopes to grant. 118 repeated string scopes = 4 [(google.api.field_behavior) = OPTIONAL]; 119 } 120 121 // Indicate the auth token type generated from the [Diglogflow service 122 // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). 123 enum ServiceAgentAuth { 124 // Service agent auth type unspecified. Default to ID_TOKEN. 125 SERVICE_AGENT_AUTH_UNSPECIFIED = 0; 126 127 // No token used. 128 NONE = 1; 129 130 // Use [ID 131 // token](https://cloud.google.com/docs/authentication/token-types#id) 132 // generated from service agent. This can be used to access Cloud Function 133 // and Cloud Run after you grant Invoker role to 134 // `service-<PROJECT-NUMBER>@gcp-sa-dialogflow.iam.gserviceaccount.com`. 135 ID_TOKEN = 2; 136 137 // Use [access 138 // token](https://cloud.google.com/docs/authentication/token-types#access) 139 // generated from service agent. This can be used to access other Google 140 // Cloud APIs after you grant required roles to 141 // `service-<PROJECT-NUMBER>@gcp-sa-dialogflow.iam.gserviceaccount.com`. 142 ACCESS_TOKEN = 3; 143 } 144 145 // Represents the type of webhook configuration. 146 enum WebhookType { 147 // Default value. This value is unused. 148 WEBHOOK_TYPE_UNSPECIFIED = 0; 149 150 // Represents a standard webhook. 151 STANDARD = 1; 152 153 // Represents a flexible webhook. 154 FLEXIBLE = 2; 155 } 156 157 // HTTP method to use when calling webhooks. 158 enum HttpMethod { 159 // HTTP method not specified. 160 HTTP_METHOD_UNSPECIFIED = 0; 161 162 // HTTP POST Method. 163 POST = 1; 164 165 // HTTP GET Method. 166 GET = 2; 167 168 // HTTP HEAD Method. 169 HEAD = 3; 170 171 // HTTP PUT Method. 172 PUT = 4; 173 174 // HTTP DELETE Method. 175 DELETE = 5; 176 177 // HTTP PATCH Method. 178 PATCH = 6; 179 180 // HTTP OPTIONS Method. 181 OPTIONS = 7; 182 } 183 184 // Required. The webhook URI for receiving POST requests. It must use https 185 // protocol. 186 string uri = 1 [(google.api.field_behavior) = REQUIRED]; 187 188 // The user name for HTTP Basic authentication. 189 string username = 2 [deprecated = true]; 190 191 // The password for HTTP Basic authentication. 192 string password = 3 [deprecated = true]; 193 194 // The HTTP request headers to send together with webhook 195 // requests. 196 map<string, string> request_headers = 4; 197 198 // Optional. Specifies a list of allowed custom CA certificates (in DER 199 // format) for HTTPS verification. This overrides the default SSL trust 200 // store. If this is empty or unspecified, Dialogflow will use Google's 201 // default trust store to verify certificates. N.B. Make sure the HTTPS 202 // server certificates are signed with "subject alt name". For instance a 203 // certificate can be self-signed using the following command, 204 // ``` 205 // openssl x509 -req -days 200 -in example.com.csr \ 206 // -signkey example.com.key \ 207 // -out example.com.crt \ 208 // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") 209 // ``` 210 repeated bytes allowed_ca_certs = 5 211 [(google.api.field_behavior) = OPTIONAL]; 212 213 // Optional. The OAuth configuration of the webhook. If specified, 214 // Dialogflow will initiate the OAuth client credential flow to exchange an 215 // access token from the 3rd party platform and put it in the auth header. 216 OAuthConfig oauth_config = 11 [(google.api.field_behavior) = OPTIONAL]; 217 218 // Optional. Indicate the auth token type generated from the [Diglogflow 219 // service 220 // agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). 221 // The generated token is sent in the Authorization header. 222 ServiceAgentAuth service_agent_auth = 12 223 [(google.api.field_behavior) = OPTIONAL]; 224 225 // Optional. Type of the webhook. 226 WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL]; 227 228 // Optional. HTTP method for the flexible webhook calls. Standard webhook 229 // always uses POST. 230 HttpMethod http_method = 7 [(google.api.field_behavior) = OPTIONAL]; 231 232 // Optional. Defines a custom JSON object as request body to send to 233 // flexible webhook. 234 string request_body = 8 [(google.api.field_behavior) = OPTIONAL]; 235 236 // Optional. Maps the values extracted from specific fields of the flexible 237 // webhook response into session parameters. 238 // - Key: session parameter name 239 // - Value: field path in the webhook response 240 map<string, string> parameter_mapping = 9 241 [(google.api.field_behavior) = OPTIONAL]; 242 } 243 244 // Represents configuration for a [Service 245 // Directory](https://cloud.google.com/service-directory) service. 246 message ServiceDirectoryConfig { 247 // Required. The name of [Service 248 // Directory](https://cloud.google.com/service-directory) service. 249 // Format: `projects/<Project ID>/locations/<Location 250 // ID>/namespaces/<Namespace ID>/services/<Service ID>`. 251 // `Location ID` of the service directory must be the same as the location 252 // of the agent. 253 string service = 1 [ 254 (google.api.field_behavior) = REQUIRED, 255 (google.api.resource_reference) = { 256 type: "servicedirectory.googleapis.com/Service" 257 } 258 ]; 259 260 // Generic Service configuration of this webhook. 261 GenericWebService generic_web_service = 2; 262 } 263 264 // The unique identifier of the webhook. 265 // Required for the 266 // [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] 267 // method. 268 // [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] 269 // populates the name automatically. Format: `projects/<Project 270 // ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. 271 string name = 1; 272 273 // Required. The human-readable name of the webhook, unique within the agent. 274 string display_name = 2 [(google.api.field_behavior) = REQUIRED]; 275 276 // Required. The webhook configuration. 277 oneof webhook { 278 // Configuration for a generic web service. 279 GenericWebService generic_web_service = 4; 280 281 // Configuration for a [Service 282 // Directory](https://cloud.google.com/service-directory) service. 283 ServiceDirectoryConfig service_directory = 7; 284 } 285 286 // Webhook execution timeout. Execution is considered failed if Dialogflow 287 // doesn't receive a response from webhook at the end of the timeout period. 288 // Defaults to 5 seconds, maximum allowed timeout is 30 seconds. 289 google.protobuf.Duration timeout = 6; 290 291 // Indicates whether the webhook is disabled. 292 bool disabled = 5; 293} 294 295// The request message for 296// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. 297message ListWebhooksRequest { 298 // Required. The agent to list all webhooks for. 299 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 300 string parent = 1 [ 301 (google.api.field_behavior) = REQUIRED, 302 (google.api.resource_reference) = { 303 child_type: "dialogflow.googleapis.com/Webhook" 304 } 305 ]; 306 307 // The maximum number of items to return in a single page. By default 100 and 308 // at most 1000. 309 int32 page_size = 2; 310 311 // The next_page_token value returned from a previous list request. 312 string page_token = 3; 313} 314 315// The response message for 316// [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. 317message ListWebhooksResponse { 318 // The list of webhooks. There will be a maximum number of items returned 319 // based on the page_size field in the request. 320 repeated Webhook webhooks = 1; 321 322 // Token to retrieve the next page of results, or empty if there are no more 323 // results in the list. 324 string next_page_token = 2; 325} 326 327// The request message for 328// [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. 329message GetWebhookRequest { 330 // Required. The name of the webhook. 331 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 332 // ID>/webhooks/<Webhook ID>`. 333 string name = 1 [ 334 (google.api.field_behavior) = REQUIRED, 335 (google.api.resource_reference) = { 336 type: "dialogflow.googleapis.com/Webhook" 337 } 338 ]; 339} 340 341// The request message for 342// [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. 343message CreateWebhookRequest { 344 // Required. The agent to create a webhook for. 345 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 346 string parent = 1 [ 347 (google.api.field_behavior) = REQUIRED, 348 (google.api.resource_reference) = { 349 child_type: "dialogflow.googleapis.com/Webhook" 350 } 351 ]; 352 353 // Required. The webhook to create. 354 Webhook webhook = 2 [(google.api.field_behavior) = REQUIRED]; 355} 356 357// The request message for 358// [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. 359message UpdateWebhookRequest { 360 // Required. The webhook to update. 361 Webhook webhook = 1 [(google.api.field_behavior) = REQUIRED]; 362 363 // The mask to control which fields get updated. If the mask is not present, 364 // all fields will be updated. 365 google.protobuf.FieldMask update_mask = 2; 366} 367 368// The request message for 369// [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. 370message DeleteWebhookRequest { 371 // Required. The name of the webhook to delete. 372 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 373 // ID>/webhooks/<Webhook ID>`. 374 string name = 1 [ 375 (google.api.field_behavior) = REQUIRED, 376 (google.api.resource_reference) = { 377 type: "dialogflow.googleapis.com/Webhook" 378 } 379 ]; 380 381 // This field has no effect for webhook not being used. 382 // For webhooks that are used by pages/flows/transition route groups: 383 // 384 // * If `force` is set to false, an error will be returned with message 385 // indicating the referenced resources. 386 // * If `force` is set to true, Dialogflow will remove the webhook, as well 387 // as any references to the webhook (i.e. 388 // [Webhook][google.cloud.dialogflow.cx.v3beta1.Fulfillment.webhook] and 389 // [tag][google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag]in fulfillments 390 // that point to this webhook will be removed). 391 bool force = 2; 392} 393 394// The request message for a webhook call. The request is sent as a JSON object 395// and the field names will be presented in camel cases. 396// 397// You may see undocumented fields in an actual request. These fields are used 398// internally by Dialogflow and should be ignored. 399message WebhookRequest { 400 // Represents fulfillment information communicated to the webhook. 401 message FulfillmentInfo { 402 // Always present. 403 // The value of the 404 // [Fulfillment.tag][google.cloud.dialogflow.cx.v3beta1.Fulfillment.tag] 405 // field will be populated in this field by Dialogflow when the associated 406 // webhook is called. The tag is typically used by the webhook service to 407 // identify which fulfillment is being called, but it could be used for 408 // other purposes. 409 string tag = 1; 410 } 411 412 // Represents intent information communicated to the webhook. 413 message IntentInfo { 414 // Represents a value for an intent parameter. 415 message IntentParameterValue { 416 // Always present. Original text value extracted from user utterance. 417 string original_value = 1; 418 419 // Always present. Structured value for the parameter extracted from user 420 // utterance. 421 google.protobuf.Value resolved_value = 2; 422 } 423 424 // Always present. The unique identifier of the last matched 425 // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. 426 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 427 // ID>/intents/<Intent ID>`. 428 string last_matched_intent = 1 [(google.api.resource_reference) = { 429 type: "dialogflow.googleapis.com/Intent" 430 }]; 431 432 // Always present. The display name of the last matched 433 // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. 434 string display_name = 3; 435 436 // Parameters identified as a result of intent matching. This is a map of 437 // the name of the identified parameter to the value of the parameter 438 // identified from the user's utterance. All parameters defined in the 439 // matched intent that are identified will be surfaced here. 440 map<string, IntentParameterValue> parameters = 2; 441 442 // The confidence of the matched intent. Values range from 0.0 (completely 443 // uncertain) to 1.0 (completely certain). 444 float confidence = 4; 445 } 446 447 // Represents the result of sentiment analysis. 448 message SentimentAnalysisResult { 449 // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive 450 // sentiment). 451 float score = 1; 452 453 // A non-negative number in the [0, +inf) range, which represents the 454 // absolute magnitude of sentiment, regardless of score (positive or 455 // negative). 456 float magnitude = 2; 457 } 458 459 // Always present. The unique identifier of the 460 // [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] 461 // that will be returned to the API caller. 462 string detect_intent_response_id = 1; 463 464 // The original conversational query. 465 oneof query { 466 // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] 467 // was provided as input, this field will contain a copy of the text. 468 string text = 10; 469 470 // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was 471 // provided as input, this field will contain a copy of the intent 472 // identifier. Format: `projects/<Project ID>/locations/<Location 473 // ID>/agents/<Agent ID>/intents/<Intent ID>`. 474 string trigger_intent = 11 [(google.api.resource_reference) = { 475 type: "dialogflow.googleapis.com/Intent" 476 }]; 477 478 // If [natural language speech 479 // audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as 480 // input, this field will contain the transcript for the audio. 481 string transcript = 12; 482 483 // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided 484 // as input, this field will contain the name of the event. 485 string trigger_event = 14; 486 487 // If [DTMF][google.cloud.dialogflow.cx.v3beta1.DtmfInput] was provided as 488 // input, this field will contain the DTMF digits. 489 string dtmf_digits = 17; 490 } 491 492 // The language code specified in the [original 493 // request][QueryInput.language_code]. 494 string language_code = 15; 495 496 // Always present. Information about the fulfillment that triggered this 497 // webhook call. 498 FulfillmentInfo fulfillment_info = 6; 499 500 // Information about the last matched intent. 501 IntentInfo intent_info = 3; 502 503 // Information about page status. 504 PageInfo page_info = 4; 505 506 // Information about session status. 507 SessionInfo session_info = 5; 508 509 // The list of rich message responses to present to the user. Webhook can 510 // choose to append or replace this list in 511 // [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response]; 512 repeated ResponseMessage messages = 7; 513 514 // Custom data set in 515 // [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload]. 516 google.protobuf.Struct payload = 8; 517 518 // The sentiment analysis result of the current user request. The field is 519 // filled when sentiment analysis is configured to be enabled for the request. 520 SentimentAnalysisResult sentiment_analysis_result = 9; 521} 522 523// The response message for a webhook call. 524message WebhookResponse { 525 // Represents a fulfillment response to the user. 526 message FulfillmentResponse { 527 // Defines merge behavior for `messages`. 528 enum MergeBehavior { 529 // Not specified. `APPEND` will be used. 530 MERGE_BEHAVIOR_UNSPECIFIED = 0; 531 532 // `messages` will be appended to the list of messages waiting to be sent 533 // to the user. 534 APPEND = 1; 535 536 // `messages` will replace the list of messages waiting to be sent to the 537 // user. 538 REPLACE = 2; 539 } 540 541 // The list of rich message responses to present to the user. 542 repeated ResponseMessage messages = 1; 543 544 // Merge behavior for `messages`. 545 MergeBehavior merge_behavior = 2; 546 } 547 548 // The fulfillment response to send to the user. This field can be omitted by 549 // the webhook if it does not intend to send any response to the user. 550 FulfillmentResponse fulfillment_response = 1; 551 552 // Information about page status. This field can be omitted by the webhook if 553 // it does not intend to modify page status. 554 PageInfo page_info = 2; 555 556 // Information about session status. This field can be omitted by the webhook 557 // if it does not intend to modify session status. 558 SessionInfo session_info = 3; 559 560 // Value to append directly to 561 // [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads]. 562 google.protobuf.Struct payload = 4; 563 564 // The target to transition to. This can be set optionally to indicate an 565 // immediate transition to a different page in the same host flow, or a 566 // different flow in the same agent. 567 oneof transition { 568 // The target page to transition to. 569 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 570 // ID>/flows/<Flow ID>/pages/<Page ID>`. 571 string target_page = 5 [(google.api.resource_reference) = { 572 type: "dialogflow.googleapis.com/Page" 573 }]; 574 575 // The target flow to transition to. 576 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 577 // ID>/flows/<Flow ID>`. 578 string target_flow = 6 [(google.api.resource_reference) = { 579 type: "dialogflow.googleapis.com/Flow" 580 }]; 581 } 582} 583 584// Represents page information communicated to and from the webhook. 585message PageInfo { 586 // Represents form information. 587 message FormInfo { 588 // Represents parameter information. 589 message ParameterInfo { 590 // Represents the state of a parameter. 591 enum ParameterState { 592 // Not specified. This value should be never used. 593 PARAMETER_STATE_UNSPECIFIED = 0; 594 595 // Indicates that the parameter does not have a value. 596 EMPTY = 1; 597 598 // Indicates that the parameter value is invalid. This field can be used 599 // by the webhook to invalidate the parameter and ask the server to 600 // collect it from the user again. 601 INVALID = 2; 602 603 // Indicates that the parameter has a value. 604 FILLED = 3; 605 } 606 607 // Always present for 608 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 609 // Required for 610 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 611 // The human-readable name of the parameter, unique within the form. This 612 // field cannot be modified by the webhook. 613 string display_name = 1; 614 615 // Optional for both 616 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and 617 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 618 // Indicates whether the parameter is required. Optional parameters will 619 // not trigger prompts; however, they are filled if the user specifies 620 // them. Required parameters must be filled before form filling concludes. 621 bool required = 2; 622 623 // Always present for 624 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 625 // Required for 626 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 627 // The state of the parameter. This field can be set to 628 // [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] 629 // by the webhook to invalidate the parameter; other values set by the 630 // webhook will be ignored. 631 ParameterState state = 3; 632 633 // Optional for both 634 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and 635 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 636 // The value of the parameter. This field can be set by the webhook to 637 // change the parameter value. 638 google.protobuf.Value value = 4; 639 640 // Optional for 641 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 642 // Ignored for 643 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 644 // Indicates if the parameter value was just collected on the last 645 // conversation turn. 646 bool just_collected = 5; 647 } 648 649 // Optional for both 650 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and 651 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 652 // The parameters contained in the form. Note that the webhook cannot add 653 // or remove any form parameter. 654 repeated ParameterInfo parameter_info = 2; 655 } 656 657 // Always present for 658 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 659 // Ignored for 660 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The 661 // unique identifier of the current page. Format: `projects/<Project 662 // ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page 663 // ID>`. 664 string current_page = 1 [ 665 (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } 666 ]; 667 668 // Always present for 669 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 670 // Ignored for 671 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The 672 // display name of the current page. 673 string display_name = 4; 674 675 // Optional for both 676 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and 677 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. 678 // Information about the form. 679 FormInfo form_info = 3; 680} 681 682// Represents session information communicated to and from the webhook. 683message SessionInfo { 684 // Always present for 685 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 686 // Ignored for 687 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The 688 // unique identifier of the 689 // [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. 690 // This field can be used by the webhook to identify a session. Format: 691 // `projects/<Project ID>/locations/<Location ID>/agents/<Agent 692 // ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location 693 // ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>` 694 // if environment is specified. 695 string session = 1 [(google.api.resource_reference) = { 696 type: "dialogflow.googleapis.com/Session" 697 }]; 698 699 // Optional for 700 // [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. 701 // Optional for 702 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. All 703 // parameters collected from forms and intents during the session. Parameters 704 // can be created, updated, or removed by the webhook. To remove a parameter 705 // from the session, the webhook should explicitly set the parameter value to 706 // null in 707 // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The 708 // map is keyed by parameters' display names. 709 map<string, google.protobuf.Value> parameters = 2; 710} 711