conversation_event.proto 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.v2beta1;
  16. import "google/cloud/dialogflow/v2beta1/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.V2beta1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ConversationEventProto";
  24. option java_package = "com.google.cloud.dialogflow.v2beta1";
  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 a new message, either from API or
  40. // telephony. It is configured in
  41. // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2beta1.ConversationProfile.new_message_event_notification_config]
  42. NEW_MESSAGE = 5;
  43. // Unrecoverable error during a telephone call.
  44. //
  45. // In general non-recoverable errors only occur if something was
  46. // misconfigured in the ConversationProfile corresponding to the call. After
  47. // a non-recoverable error, Dialogflow may stop responding.
  48. //
  49. // We don't fire this event:
  50. //
  51. // * in an API call because we can directly return the error, or,
  52. // * when we can recover from an error.
  53. UNRECOVERABLE_ERROR = 4;
  54. }
  55. // Required. The unique identifier of the conversation this notification
  56. // refers to.
  57. // Format: `projects/<Project ID>/conversations/<Conversation ID>`.
  58. string conversation = 1;
  59. // Required. The type of the event that this notification refers to.
  60. Type type = 2;
  61. // Optional. More detailed information about an error. Only set for type
  62. // UNRECOVERABLE_ERROR_IN_PHONE_CALL.
  63. google.rpc.Status error_status = 3;
  64. // Payload of conversation event.
  65. oneof payload {
  66. // Payload of NEW_MESSAGE event.
  67. Message new_message_payload = 4;
  68. }
  69. }