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