fulfillment.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/protobuf/field_mask.proto";
  21. option cc_enable_arenas = true;
  22. option csharp_namespace = "Google.Cloud.Dialogflow.V2";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "FulfillmentProto";
  26. option java_package = "com.google.cloud.dialogflow.v2";
  27. option objc_class_prefix = "DF";
  28. // Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment].
  29. service Fulfillments {
  30. option (google.api.default_host) = "dialogflow.googleapis.com";
  31. option (google.api.oauth_scopes) =
  32. "https://www.googleapis.com/auth/cloud-platform,"
  33. "https://www.googleapis.com/auth/dialogflow";
  34. // Retrieves the fulfillment.
  35. rpc GetFulfillment(GetFulfillmentRequest) returns (Fulfillment) {
  36. option (google.api.http) = {
  37. get: "/v2/{name=projects/*/agent/fulfillment}"
  38. additional_bindings {
  39. get: "/v2/{name=projects/*/locations/*/agent/fulfillment}"
  40. }
  41. };
  42. option (google.api.method_signature) = "name";
  43. }
  44. // Updates the fulfillment.
  45. rpc UpdateFulfillment(UpdateFulfillmentRequest) returns (Fulfillment) {
  46. option (google.api.http) = {
  47. patch: "/v2/{fulfillment.name=projects/*/agent/fulfillment}"
  48. body: "fulfillment"
  49. additional_bindings {
  50. patch: "/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}"
  51. body: "fulfillment"
  52. }
  53. };
  54. option (google.api.method_signature) = "fulfillment,update_mask";
  55. }
  56. }
  57. // By default, your agent responds to a matched intent with a static response.
  58. // As an alternative, you can provide a more dynamic response by using
  59. // fulfillment. When you enable fulfillment for an intent, Dialogflow responds
  60. // to that intent by calling a service that you define. For example, if an
  61. // end-user wants to schedule a haircut on Friday, your service can check your
  62. // database and respond to the end-user with availability information for
  63. // Friday.
  64. //
  65. // For more information, see the [fulfillment
  66. // guide](https://cloud.google.com/dialogflow/docs/fulfillment-overview).
  67. message Fulfillment {
  68. option (google.api.resource) = {
  69. type: "dialogflow.googleapis.com/Fulfillment"
  70. pattern: "projects/{project}/agent/fulfillment"
  71. pattern: "projects/{project}/locations/{location}/agent/fulfillment"
  72. };
  73. // Represents configuration for a generic web service.
  74. // Dialogflow supports two mechanisms for authentications:
  75. //
  76. // - Basic authentication with username and password.
  77. // - Authentication with additional authentication headers.
  78. //
  79. // More information could be found at:
  80. // https://cloud.google.com/dialogflow/docs/fulfillment-configure.
  81. message GenericWebService {
  82. // Required. The fulfillment URI for receiving POST requests.
  83. // It must use https protocol.
  84. string uri = 1 [(google.api.field_behavior) = REQUIRED];
  85. // Optional. The user name for HTTP Basic authentication.
  86. string username = 2 [(google.api.field_behavior) = OPTIONAL];
  87. // Optional. The password for HTTP Basic authentication.
  88. string password = 3 [(google.api.field_behavior) = OPTIONAL];
  89. // Optional. The HTTP request headers to send together with fulfillment requests.
  90. map<string, string> request_headers = 4 [(google.api.field_behavior) = OPTIONAL];
  91. // Optional. Indicates if generic web service is created through Cloud Functions
  92. // integration. Defaults to false.
  93. //
  94. // is_cloud_function is deprecated. Cloud functions can be configured by
  95. // its uri as a regular web service now.
  96. bool is_cloud_function = 5 [
  97. deprecated = true,
  98. (google.api.field_behavior) = OPTIONAL
  99. ];
  100. }
  101. // Whether fulfillment is enabled for the specific feature.
  102. message Feature {
  103. // The type of the feature.
  104. enum Type {
  105. // Feature type not specified.
  106. TYPE_UNSPECIFIED = 0;
  107. // Fulfillment is enabled for SmallTalk.
  108. SMALLTALK = 1;
  109. }
  110. // The type of the feature that enabled for fulfillment.
  111. Type type = 1;
  112. }
  113. // Required. The unique identifier of the fulfillment.
  114. // Supported formats:
  115. //
  116. // - `projects/<Project ID>/agent/fulfillment`
  117. // - `projects/<Project ID>/locations/<Location ID>/agent/fulfillment`
  118. //
  119. // This field is not used for Fulfillment in an Environment.
  120. string name = 1 [(google.api.field_behavior) = REQUIRED];
  121. // Optional. The human-readable name of the fulfillment, unique within the agent.
  122. //
  123. // This field is not used for Fulfillment in an Environment.
  124. string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
  125. // Required. The fulfillment configuration.
  126. oneof fulfillment {
  127. // Configuration for a generic web service.
  128. GenericWebService generic_web_service = 3;
  129. }
  130. // Optional. Whether fulfillment is enabled.
  131. bool enabled = 4 [(google.api.field_behavior) = OPTIONAL];
  132. // Optional. The field defines whether the fulfillment is enabled for certain features.
  133. repeated Feature features = 5 [(google.api.field_behavior) = OPTIONAL];
  134. }
  135. // The request message for [Fulfillments.GetFulfillment][google.cloud.dialogflow.v2.Fulfillments.GetFulfillment].
  136. message GetFulfillmentRequest {
  137. // Required. The name of the fulfillment.
  138. // Format: `projects/<Project ID>/agent/fulfillment`.
  139. string name = 1 [
  140. (google.api.field_behavior) = REQUIRED,
  141. (google.api.resource_reference) = {
  142. type: "dialogflow.googleapis.com/Fulfillment"
  143. }
  144. ];
  145. }
  146. // The request message for [Fulfillments.UpdateFulfillment][google.cloud.dialogflow.v2.Fulfillments.UpdateFulfillment].
  147. message UpdateFulfillmentRequest {
  148. // Required. The fulfillment to update.
  149. Fulfillment fulfillment = 1 [(google.api.field_behavior) = REQUIRED];
  150. // Required. The mask to control which fields get updated. If the mask is not
  151. // present, all fields will be updated.
  152. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  153. }