version.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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/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.V2";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "VersionProto";
  28. option java_package = "com.google.cloud.dialogflow.v2";
  29. option objc_class_prefix = "DF";
  30. // Service for managing [Versions][google.cloud.dialogflow.v2.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: "/v2/{parent=projects/*/agent}/versions"
  40. additional_bindings {
  41. get: "/v2/{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: "/v2/{name=projects/*/agent/versions/*}"
  50. additional_bindings {
  51. get: "/v2/{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: "/v2/{parent=projects/*/agent}/versions"
  62. body: "version"
  63. additional_bindings {
  64. post: "/v2/{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: "/v2/{version.name=projects/*/agent/versions/*}"
  78. body: "version"
  79. additional_bindings {
  80. patch: "/v2/{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: "/v2/{name=projects/*/agent/versions/*}"
  90. additional_bindings {
  91. delete: "/v2/{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. //
  135. // - `projects/<Project ID>/agent/versions/<Version ID>`
  136. // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
  137. // ID>`
  138. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  139. // Optional. The developer-provided description of this version.
  140. string description = 2 [(google.api.field_behavior) = OPTIONAL];
  141. // Output only. The sequential number of this version. This field is read-only which means
  142. // it cannot be set by create and update methods.
  143. int32 version_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  144. // Output only. The creation time of this version. This field is read-only, i.e., it cannot
  145. // be set by create and update methods.
  146. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  147. // Output only. The status of this version. This field is read-only and cannot be set by
  148. // create and update methods.
  149. VersionStatus status = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  150. }
  151. // The request message for [Versions.ListVersions][google.cloud.dialogflow.v2.Versions.ListVersions].
  152. message ListVersionsRequest {
  153. // Required. The agent to list all versions from.
  154. // Supported formats:
  155. //
  156. // - `projects/<Project ID>/agent`
  157. // - `projects/<Project ID>/locations/<Location ID>/agent`
  158. string parent = 1 [
  159. (google.api.field_behavior) = REQUIRED,
  160. (google.api.resource_reference) = {
  161. child_type: "dialogflow.googleapis.com/Version"
  162. }
  163. ];
  164. // Optional. The maximum number of items to return in a single page. By default 100 and
  165. // at most 1000.
  166. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  167. // Optional. The next_page_token value returned from a previous list request.
  168. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  169. }
  170. // The response message for [Versions.ListVersions][google.cloud.dialogflow.v2.Versions.ListVersions].
  171. message ListVersionsResponse {
  172. // The list of agent versions. There will be a maximum number of items
  173. // returned based on the page_size field in the request.
  174. repeated Version versions = 1;
  175. // Token to retrieve the next page of results, or empty if there are no
  176. // more results in the list.
  177. string next_page_token = 2;
  178. }
  179. // The request message for [Versions.GetVersion][google.cloud.dialogflow.v2.Versions.GetVersion].
  180. message GetVersionRequest {
  181. // Required. The name of the version.
  182. // Supported formats:
  183. //
  184. // - `projects/<Project ID>/agent/versions/<Version ID>`
  185. // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
  186. // ID>`
  187. string name = 1 [
  188. (google.api.field_behavior) = REQUIRED,
  189. (google.api.resource_reference) = {
  190. type: "dialogflow.googleapis.com/Version"
  191. }
  192. ];
  193. }
  194. // The request message for [Versions.CreateVersion][google.cloud.dialogflow.v2.Versions.CreateVersion].
  195. message CreateVersionRequest {
  196. // Required. The agent to create a version for.
  197. // Supported formats:
  198. //
  199. // - `projects/<Project ID>/agent`
  200. // - `projects/<Project ID>/locations/<Location ID>/agent`
  201. string parent = 1 [
  202. (google.api.field_behavior) = REQUIRED,
  203. (google.api.resource_reference) = {
  204. child_type: "dialogflow.googleapis.com/Version"
  205. }
  206. ];
  207. // Required. The version to create.
  208. Version version = 2 [(google.api.field_behavior) = REQUIRED];
  209. }
  210. // The request message for [Versions.UpdateVersion][google.cloud.dialogflow.v2.Versions.UpdateVersion].
  211. message UpdateVersionRequest {
  212. // Required. The version to update.
  213. // Supported formats:
  214. //
  215. // - `projects/<Project ID>/agent/versions/<Version ID>`
  216. // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
  217. // ID>`
  218. Version version = 1 [(google.api.field_behavior) = REQUIRED];
  219. // Required. The mask to control which fields get updated.
  220. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  221. }
  222. // The request message for [Versions.DeleteVersion][google.cloud.dialogflow.v2.Versions.DeleteVersion].
  223. message DeleteVersionRequest {
  224. // Required. The name of the version to delete.
  225. // Supported formats:
  226. //
  227. // - `projects/<Project ID>/agent/versions/<Version ID>`
  228. // - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
  229. // ID>`
  230. string name = 1 [
  231. (google.api.field_behavior) = REQUIRED,
  232. (google.api.resource_reference) = {
  233. type: "dialogflow.googleapis.com/Version"
  234. }
  235. ];
  236. }