version.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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.cx.v3beta1;
  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/cloud/dialogflow/cx/v3beta1/flow.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option cc_enable_arenas = true;
  26. option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "VersionProto";
  30. option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
  31. option objc_class_prefix = "DF";
  32. option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1";
  33. // Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
  34. service Versions {
  35. option (google.api.default_host) = "dialogflow.googleapis.com";
  36. option (google.api.oauth_scopes) =
  37. "https://www.googleapis.com/auth/cloud-platform,"
  38. "https://www.googleapis.com/auth/dialogflow";
  39. // Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
  40. rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) {
  41. option (google.api.http) = {
  42. get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions"
  43. };
  44. option (google.api.method_signature) = "parent";
  45. }
  46. // Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
  47. rpc GetVersion(GetVersionRequest) returns (Version) {
  48. option (google.api.http) = {
  49. get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}"
  50. };
  51. option (google.api.method_signature) = "name";
  52. }
  53. // Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
  54. //
  55. // This method is a [long-running
  56. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  57. // The returned `Operation` type has the following method-specific fields:
  58. //
  59. // - `metadata`: [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata]
  60. // - `response`: [Version][google.cloud.dialogflow.cx.v3beta1.Version]
  61. rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) {
  62. option (google.api.http) = {
  63. post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions"
  64. body: "version"
  65. };
  66. option (google.api.method_signature) = "parent,version";
  67. option (google.longrunning.operation_info) = {
  68. response_type: "Version"
  69. metadata_type: "CreateVersionOperationMetadata"
  70. };
  71. }
  72. // Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
  73. rpc UpdateVersion(UpdateVersionRequest) returns (Version) {
  74. option (google.api.http) = {
  75. patch: "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}"
  76. body: "version"
  77. };
  78. option (google.api.method_signature) = "version,update_mask";
  79. }
  80. // Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
  81. rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) {
  82. option (google.api.http) = {
  83. delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}"
  84. };
  85. option (google.api.method_signature) = "name";
  86. }
  87. // Loads resources in the specified version to the draft flow.
  88. //
  89. // This method is a [long-running
  90. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  91. // The returned `Operation` type has the following method-specific fields:
  92. //
  93. // - `metadata`: An empty [Struct
  94. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
  95. // - `response`: An [Empty
  96. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
  97. rpc LoadVersion(LoadVersionRequest) returns (google.longrunning.Operation) {
  98. option (google.api.http) = {
  99. post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load"
  100. body: "*"
  101. };
  102. option (google.api.method_signature) = "name";
  103. option (google.longrunning.operation_info) = {
  104. response_type: "google.protobuf.Empty"
  105. metadata_type: "google.protobuf.Struct"
  106. };
  107. }
  108. // Compares the specified base version with target version.
  109. rpc CompareVersions(CompareVersionsRequest) returns (CompareVersionsResponse) {
  110. option (google.api.http) = {
  111. post: "/v3beta1/{base_version=projects/*/locations/*/agents/*/flows/*/versions/*}:compareVersions"
  112. body: "*"
  113. };
  114. option (google.api.method_signature) = "base_version";
  115. }
  116. }
  117. // Metadata associated with the long running operation for
  118. // [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
  119. message CreateVersionOperationMetadata {
  120. // Name of the created version.
  121. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  122. // ID>/flows/<Flow ID>/versions/<Version ID>`.
  123. string version = 1 [(google.api.resource_reference) = {
  124. type: "dialogflow.googleapis.com/Version"
  125. }];
  126. }
  127. // Represents a version of a flow.
  128. message Version {
  129. option (google.api.resource) = {
  130. type: "dialogflow.googleapis.com/Version"
  131. pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}"
  132. };
  133. // The state of the version.
  134. enum State {
  135. // Not specified. This value is not used.
  136. STATE_UNSPECIFIED = 0;
  137. // Version is not ready to serve (e.g. training is running).
  138. RUNNING = 1;
  139. // Training has succeeded and this version is ready to serve.
  140. SUCCEEDED = 2;
  141. // Version training failed.
  142. FAILED = 3;
  143. }
  144. // Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
  145. // ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
  146. // number generated by Dialogflow upon version creation.
  147. string name = 1;
  148. // Required. The human-readable name of the version. Limit of 64 characters.
  149. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  150. // The description of the version. The maximum length is 500 characters. If
  151. // exceeded, the request is rejected.
  152. string description = 3;
  153. // Output only. The NLU settings of the flow at version creation.
  154. NluSettings nlu_settings = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  155. // Output only. Create time of the version.
  156. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  157. // Output only. The state of this version. This field is read-only and cannot be set by
  158. // create and update methods.
  159. State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  160. }
  161. // The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
  162. message ListVersionsRequest {
  163. // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
  164. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  165. // ID>/flows/<Flow ID>`.
  166. string parent = 1 [
  167. (google.api.field_behavior) = REQUIRED,
  168. (google.api.resource_reference) = {
  169. child_type: "dialogflow.googleapis.com/Version"
  170. }
  171. ];
  172. // The maximum number of items to return in a single page. By default 20 and
  173. // at most 100.
  174. int32 page_size = 2;
  175. // The next_page_token value returned from a previous list request.
  176. string page_token = 3;
  177. }
  178. // The response message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
  179. message ListVersionsResponse {
  180. // A list of versions. There will be a maximum number of items returned based
  181. // on the page_size field in the request. The list may in some cases be empty
  182. // or contain fewer entries than page_size even if this isn't the last page.
  183. repeated Version versions = 1;
  184. // Token to retrieve the next page of results, or empty if there are no more
  185. // results in the list.
  186. string next_page_token = 2;
  187. }
  188. // The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion].
  189. message GetVersionRequest {
  190. // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
  191. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  192. // ID>/flows/<Flow ID>/versions/<Version ID>`.
  193. string name = 1 [
  194. (google.api.field_behavior) = REQUIRED,
  195. (google.api.resource_reference) = {
  196. type: "dialogflow.googleapis.com/Version"
  197. }
  198. ];
  199. }
  200. // The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
  201. message CreateVersionRequest {
  202. // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
  203. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  204. // ID>/flows/<Flow ID>`.
  205. string parent = 1 [
  206. (google.api.field_behavior) = REQUIRED,
  207. (google.api.resource_reference) = {
  208. child_type: "dialogflow.googleapis.com/Version"
  209. }
  210. ];
  211. // Required. The version to create.
  212. Version version = 2 [(google.api.field_behavior) = REQUIRED];
  213. }
  214. // The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion].
  215. message UpdateVersionRequest {
  216. // Required. The version to update.
  217. Version version = 1 [(google.api.field_behavior) = REQUIRED];
  218. // Required. The mask to control which fields get updated. Currently only `description`
  219. // and `display_name` can be updated.
  220. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  221. }
  222. // The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion].
  223. message DeleteVersionRequest {
  224. // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
  225. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  226. // ID>/flows/<Flow ID>/versions/<Version ID>`.
  227. string name = 1 [
  228. (google.api.field_behavior) = REQUIRED,
  229. (google.api.resource_reference) = {
  230. type: "dialogflow.googleapis.com/Version"
  231. }
  232. ];
  233. }
  234. // The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion].
  235. message LoadVersionRequest {
  236. // Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft flow.
  237. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  238. // ID>/flows/<Flow ID>/versions/<Version ID>`.
  239. string name = 1 [
  240. (google.api.field_behavior) = REQUIRED,
  241. (google.api.resource_reference) = {
  242. type: "dialogflow.googleapis.com/Version"
  243. }
  244. ];
  245. // This field is used to prevent accidental overwrite of other agent
  246. // resources, which can potentially impact other flow's behavior. If
  247. // `allow_override_agent_resources` is false, conflicted agent-level resources
  248. // will not be overridden (i.e. intents, entities, webhooks).
  249. bool allow_override_agent_resources = 2;
  250. }
  251. // The request message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions].
  252. message CompareVersionsRequest {
  253. // Required. Name of the base flow version to compare with the target version. Use
  254. // version ID `0` to indicate the draft version of the specified flow.
  255. //
  256. // Format: `projects/<Project ID>/locations/<Location ID>/agents/
  257. // <Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
  258. string base_version = 1 [
  259. (google.api.field_behavior) = REQUIRED,
  260. (google.api.resource_reference) = {
  261. type: "dialogflow.googleapis.com/Version"
  262. }
  263. ];
  264. // Required. Name of the target flow version to compare with the
  265. // base version. Use version ID `0` to indicate the draft version of the
  266. // specified flow. Format: `projects/<Project ID>/locations/<Location
  267. // ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
  268. string target_version = 2 [
  269. (google.api.field_behavior) = REQUIRED,
  270. (google.api.resource_reference) = {
  271. type: "dialogflow.googleapis.com/Version"
  272. }
  273. ];
  274. // The language to compare the flow versions for.
  275. //
  276. // If not specified, the agent's default language is used.
  277. // [Many
  278. // languages](https://cloud.google.com/dialogflow/docs/reference/language) are
  279. // supported. Note: languages must be enabled in the agent before they can be
  280. // used.
  281. string language_code = 3;
  282. }
  283. // The response message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions].
  284. message CompareVersionsResponse {
  285. // JSON representation of the base version content.
  286. string base_version_content_json = 1;
  287. // JSON representation of the target version content.
  288. string target_version_content_json = 2;
  289. // The timestamp when the two version compares.
  290. google.protobuf.Timestamp compare_time = 3;
  291. }