version.proto 9.4 KB

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