xref: /aosp_15_r20/external/googleapis/google/cloud/dialogflow/v2beta1/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.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/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.V2Beta1";
29option go_package = "cloud.google.com/go/dialogflow/apiv2beta1/dialogflowpb;dialogflowpb";
30option java_multiple_files = true;
31option java_outer_classname = "VersionProto";
32option java_package = "com.google.cloud.dialogflow.v2beta1";
33option objc_class_prefix = "DF";
34
35// Service for managing [Versions][google.cloud.dialogflow.v2beta1.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: "/v2beta1/{parent=projects/*/agent}/versions"
46      additional_bindings {
47        get: "/v2beta1/{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: "/v2beta1/{name=projects/*/agent/versions/*}"
57      additional_bindings {
58        get: "/v2beta1/{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: "/v2beta1/{parent=projects/*/agent}/versions"
70      body: "version"
71      additional_bindings {
72        post: "/v2beta1/{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: "/v2beta1/{version.name=projects/*/agent/versions/*}"
87      body: "version"
88      additional_bindings {
89        patch: "/v2beta1/{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: "/v2beta1/{name=projects/*/agent/versions/*}"
100      additional_bindings {
101        delete: "/v2beta1/{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  // - `projects/<Project ID>/agent/versions/<Version ID>`
151  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
152  //   ID>`
153  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
154
155  // Optional. The developer-provided description of this version.
156  string description = 2 [(google.api.field_behavior) = OPTIONAL];
157
158  // Output only. The sequential number of this version. This field is read-only
159  // which means it cannot be set by create and update methods.
160  int32 version_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
161
162  // Output only. The creation time of this version. This field is read-only,
163  // i.e., it cannot be set by create and update methods.
164  google.protobuf.Timestamp create_time = 4
165      [(google.api.field_behavior) = OUTPUT_ONLY];
166
167  // Output only. The status of this version. This field is read-only and cannot
168  // be set by create and update methods.
169  VersionStatus status = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
170}
171
172// The request message for
173// [Versions.ListVersions][google.cloud.dialogflow.v2beta1.Versions.ListVersions].
174message ListVersionsRequest {
175  // Required. The agent to list all versions from.
176  // Supported formats:
177  // - `projects/<Project ID>/agent`
178  // - `projects/<Project ID>/locations/<Location ID>/agent`
179  string parent = 1 [
180    (google.api.field_behavior) = REQUIRED,
181    (google.api.resource_reference) = {
182      child_type: "dialogflow.googleapis.com/Version"
183    }
184  ];
185
186  // Optional. The maximum number of items to return in a single page. By
187  // default 100 and at most 1000.
188  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
189
190  // Optional. The next_page_token value returned from a previous list request.
191  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
192}
193
194// The response message for
195// [Versions.ListVersions][google.cloud.dialogflow.v2beta1.Versions.ListVersions].
196message ListVersionsResponse {
197  // The list of agent versions. There will be a maximum number of items
198  // returned based on the page_size field in the request.
199  repeated Version versions = 1;
200
201  // Token to retrieve the next page of results, or empty if there are no
202  // more results in the list.
203  string next_page_token = 2;
204}
205
206// The request message for
207// [Versions.GetVersion][google.cloud.dialogflow.v2beta1.Versions.GetVersion].
208message GetVersionRequest {
209  // Required. The name of the version.
210  // Supported formats:
211  // - `projects/<Project ID>/agent/versions/<Version ID>`
212  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
213  //   ID>`
214  string name = 1 [
215    (google.api.field_behavior) = REQUIRED,
216    (google.api.resource_reference) = {
217      type: "dialogflow.googleapis.com/Version"
218    }
219  ];
220}
221
222// The request message for
223// [Versions.CreateVersion][google.cloud.dialogflow.v2beta1.Versions.CreateVersion].
224message CreateVersionRequest {
225  // Required. The agent to create a version for.
226  // Supported formats:
227  // - `projects/<Project ID>/agent`
228  // - `projects/<Project ID>/locations/<Location ID>/agent`
229  string parent = 1 [
230    (google.api.field_behavior) = REQUIRED,
231    (google.api.resource_reference) = {
232      child_type: "dialogflow.googleapis.com/Version"
233    }
234  ];
235
236  // Required. The version to create.
237  Version version = 2 [(google.api.field_behavior) = REQUIRED];
238}
239
240// The request message for
241// [Versions.UpdateVersion][google.cloud.dialogflow.v2beta1.Versions.UpdateVersion].
242message UpdateVersionRequest {
243  // Required. The version to update.
244  // Supported formats:
245  // - `projects/<Project ID>/agent/versions/<Version ID>`
246  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
247  //   ID>`
248  Version version = 1 [(google.api.field_behavior) = REQUIRED];
249
250  // Required. The mask to control which fields get updated.
251  google.protobuf.FieldMask update_mask = 2
252      [(google.api.field_behavior) = REQUIRED];
253}
254
255// The request message for
256// [Versions.DeleteVersion][google.cloud.dialogflow.v2beta1.Versions.DeleteVersion].
257message DeleteVersionRequest {
258  // Required. The name of the version to delete.
259  // Supported formats:
260  // - `projects/<Project ID>/agent/versions/<Version ID>`
261  // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
262  //   ID>`
263  string name = 1 [
264    (google.api.field_behavior) = REQUIRED,
265    (google.api.resource_reference) = {
266      type: "dialogflow.googleapis.com/Version"
267    }
268  ];
269}
270