conversation_event.proto 3.1 KB

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