xref: /aosp_15_r20/external/googleapis/google/cloud/dialogflow/v2/version.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.v2;
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/empty.proto";
24import "google/protobuf/field_mask.proto";
25import "google/protobuf/timestamp.proto";
26
27option cc_enable_arenas = true;
28option csharp_namespace = "Google.Cloud.Dialogflow.V2";
29option go_package = "cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb";
30option java_multiple_files = true;
31option java_outer_classname = "VersionProto";
32option java_package = "com.google.cloud.dialogflow.v2";
33option objc_class_prefix = "DF";
34
35// Service for managing [Versions][google.cloud.dialogflow.v2.Version].
36service Versions {
37  option (google.api.default_host) = "dialogflow.googleapis.com";
38  option (google.api.oauth_scopes) =
39      "https://www.googleapis.com/auth/cloud-platform,"
40      "https://www.googleapis.com/auth/dialogflow";
41
42  // Returns the list of all versions of the specified agent.
43  rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) {
44    option (google.api.http) = {
45      get: "/v2/{parent=projects/*/agent}/versions"
46      additional_bindings {
47        get: "/v2/{parent=projects/*/locations/*/agent}/versions"
48      }
49    };
50    option (google.api.method_signature) = "parent";
51  }
52
53  // Retrieves the specified agent version.
54  rpc GetVersion(GetVersionRequest) returns (Version) {
55    option (google.api.http) = {
56      get: "/v2/{name=projects/*/agent/versions/*}"
57      additional_bindings {
58        get: "/v2/{name=projects/*/locations/*/agent/versions/*}"
59      }
60    };
61    option (google.api.method_signature) = "name";
62  }
63
64  // Creates an agent version.
65  //
66  // The new version points to the agent instance in the "default" environment.
67  rpc CreateVersion(CreateVersionRequest) returns (Version) {
68    option (google.api.http) = {
69      post: "/v2/{parent=projects/*/agent}/versions"
70      body: "version"
71      additional_bindings {
72        post: "/v2/{parent=projects/*/locations/*/agent}/versions"
73        body: "version"
74      }
75    };
76    option (google.api.method_signature) = "parent,version";
77  }
78
79  // Updates the specified agent version.
80  //
81  // Note that this method does not allow you to update the state of the agent
82  // the given version points to. It allows you to update only mutable
83  // properties of the version resource.
84  rpc UpdateVersion(UpdateVersionRequest) returns (Version) {
85    option (google.api.http) = {
86      patch: "/v2/{version.name=projects/*/agent/versions/*}"
87      body: "version"
88      additional_bindings {
89        patch: "/v2/{version.name=projects/*/locations/*/agent/versions/*}"
90        body: "version"
91      }
92    };
93    option (google.api.method_signature) = "version,update_mask";
94  }
95
96  // Delete the specified agent version.
97  rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) {
98    option (google.api.http) = {
99      delete: "/v2/{name=projects/*/agent/versions/*}"
100      additional_bindings {
101        delete: "/v2/{name=projects/*/locations/*/agent/versions/*}"
102      }
103    };
104    option (google.api.method_signature) = "name";
105  }
106}
107
108// You can create multiple versions of your agent and publish them to separate
109// environments.
110//
111// When you edit an agent, you are editing the draft agent. At any point, you
112// can save the draft agent as an agent version, which is an immutable snapshot
113// of your agent.
114//
115// When you save the draft agent, it is published to the default environment.
116// When you create agent versions, you can publish them to custom environments.
117// You can create a variety of custom environments for:
118//
119// - testing
120// - development
121// - production
122// - etc.
123//
124// For more information, see the [versions and environments
125// guide](https://cloud.google.com/dialogflow/docs/agents-versions).
126message Version {
127  option (google.api.resource) = {
128    type: "dialogflow.googleapis.com/Version"
129    pattern: "projects/{project}/agent/versions/{version}"
130    pattern: "projects/{project}/locations/{location}/agent/versions/{version}"
131  };
132
133  // The status of a version.
134  enum VersionStatus {
135    // Not specified. This value is not used.
136    VERSION_STATUS_UNSPECIFIED = 0;
137
138    // Version is not ready to serve (e.g. training is in progress).
139    IN_PROGRESS = 1;
140
141    // Version is ready to serve.
142    READY = 2;
143
144    // Version training failed.
145    FAILED = 3;
146  }
147
148  // Output only. The unique identifier of this agent version.
149  // Supported formats:
150  //
151  // - `projects/<Project ID>/agent/versions/<Version ID>`
152  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
153  //   ID>`
154  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
155
156  // Optional. The developer-provided description of this version.
157  string description = 2 [(google.api.field_behavior) = OPTIONAL];
158
159  // Output only. The sequential number of this version. This field is read-only
160  // which means it cannot be set by create and update methods.
161  int32 version_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
162
163  // Output only. The creation time of this version. This field is read-only,
164  // i.e., it cannot be set by create and update methods.
165  google.protobuf.Timestamp create_time = 4
166      [(google.api.field_behavior) = OUTPUT_ONLY];
167
168  // Output only. The status of this version. This field is read-only and cannot
169  // be set by create and update methods.
170  VersionStatus status = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
171}
172
173// The request message for
174// [Versions.ListVersions][google.cloud.dialogflow.v2.Versions.ListVersions].
175message ListVersionsRequest {
176  // Required. The agent to list all versions from.
177  // Supported formats:
178  //
179  // - `projects/<Project ID>/agent`
180  // - `projects/<Project ID>/locations/<Location ID>/agent`
181  string parent = 1 [
182    (google.api.field_behavior) = REQUIRED,
183    (google.api.resource_reference) = {
184      child_type: "dialogflow.googleapis.com/Version"
185    }
186  ];
187
188  // Optional. The maximum number of items to return in a single page. By
189  // default 100 and at most 1000.
190  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
191
192  // Optional. The next_page_token value returned from a previous list request.
193  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
194}
195
196// The response message for
197// [Versions.ListVersions][google.cloud.dialogflow.v2.Versions.ListVersions].
198message ListVersionsResponse {
199  // The list of agent versions. There will be a maximum number of items
200  // returned based on the page_size field in the request.
201  repeated Version versions = 1;
202
203  // Token to retrieve the next page of results, or empty if there are no
204  // more results in the list.
205  string next_page_token = 2;
206}
207
208// The request message for
209// [Versions.GetVersion][google.cloud.dialogflow.v2.Versions.GetVersion].
210message GetVersionRequest {
211  // Required. The name of the version.
212  // Supported formats:
213  //
214  // - `projects/<Project ID>/agent/versions/<Version ID>`
215  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
216  //   ID>`
217  string name = 1 [
218    (google.api.field_behavior) = REQUIRED,
219    (google.api.resource_reference) = {
220      type: "dialogflow.googleapis.com/Version"
221    }
222  ];
223}
224
225// The request message for
226// [Versions.CreateVersion][google.cloud.dialogflow.v2.Versions.CreateVersion].
227message CreateVersionRequest {
228  // Required. The agent to create a version for.
229  // Supported formats:
230  //
231  // - `projects/<Project ID>/agent`
232  // - `projects/<Project ID>/locations/<Location ID>/agent`
233  string parent = 1 [
234    (google.api.field_behavior) = REQUIRED,
235    (google.api.resource_reference) = {
236      child_type: "dialogflow.googleapis.com/Version"
237    }
238  ];
239
240  // Required. The version to create.
241  Version version = 2 [(google.api.field_behavior) = REQUIRED];
242}
243
244// The request message for
245// [Versions.UpdateVersion][google.cloud.dialogflow.v2.Versions.UpdateVersion].
246message UpdateVersionRequest {
247  // Required. The version to update.
248  // Supported formats:
249  //
250  // - `projects/<Project ID>/agent/versions/<Version ID>`
251  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
252  //   ID>`
253  Version version = 1 [(google.api.field_behavior) = REQUIRED];
254
255  // Required. The mask to control which fields get updated.
256  google.protobuf.FieldMask update_mask = 2
257      [(google.api.field_behavior) = REQUIRED];
258}
259
260// The request message for
261// [Versions.DeleteVersion][google.cloud.dialogflow.v2.Versions.DeleteVersion].
262message DeleteVersionRequest {
263  // Required. The name of the version to delete.
264  // Supported formats:
265  //
266  // - `projects/<Project ID>/agent/versions/<Version ID>`
267  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
268  //   ID>`
269  string name = 1 [
270    (google.api.field_behavior) = REQUIRED,
271    (google.api.resource_reference) = {
272      type: "dialogflow.googleapis.com/Version"
273    }
274  ];
275}
276