conversation_event.proto 3.1 KB

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