xref: /aosp_15_r20/external/googleapis/google/cloud/dialogflow/v2/conversation_event.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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.v2;
18
19import "google/cloud/dialogflow/v2/participant.proto";
20import "google/rpc/status.proto";
21
22option cc_enable_arenas = true;
23option csharp_namespace = "Google.Cloud.Dialogflow.V2";
24option go_package = "cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb";
25option java_multiple_files = true;
26option java_outer_classname = "ConversationEventProto";
27option java_package = "com.google.cloud.dialogflow.v2";
28option objc_class_prefix = "DF";
29
30// Represents a notification sent to Pub/Sub subscribers for conversation
31// lifecycle events.
32message ConversationEvent {
33  // Enumeration of the types of events available.
34  enum Type {
35    // Type not set.
36    TYPE_UNSPECIFIED = 0;
37
38    // A new conversation has been opened. This is fired when a telephone call
39    // is answered, or a conversation is created via the API.
40    CONVERSATION_STARTED = 1;
41
42    // An existing conversation has closed. This is fired when a telephone call
43    // is terminated, or a conversation is closed via the API.
44    CONVERSATION_FINISHED = 2;
45
46    // An existing conversation has received notification from Dialogflow that
47    // human intervention is required.
48    HUMAN_INTERVENTION_NEEDED = 3;
49
50    // An existing conversation has received a new message, either from API or
51    // telephony. It is configured in
52    // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config]
53    NEW_MESSAGE = 5;
54
55    // Unrecoverable error during a telephone call.
56    //
57    // In general non-recoverable errors only occur if something was
58    // misconfigured in the ConversationProfile corresponding to the call. After
59    // a non-recoverable error, Dialogflow may stop responding.
60    //
61    // We don't fire this event:
62    //
63    // * in an API call because we can directly return the error, or,
64    // * when we can recover from an error.
65    UNRECOVERABLE_ERROR = 4;
66  }
67
68  // The unique identifier of the conversation this notification
69  // refers to.
70  // Format: `projects/<Project ID>/conversations/<Conversation ID>`.
71  string conversation = 1;
72
73  // The type of the event that this notification refers to.
74  Type type = 2;
75
76  // More detailed information about an error. Only set for type
77  // UNRECOVERABLE_ERROR_IN_PHONE_CALL.
78  google.rpc.Status error_status = 3;
79
80  // Payload of conversation event.
81  oneof payload {
82    // Payload of NEW_MESSAGE event.
83    Message new_message_payload = 4;
84  }
85}
86