version.proto 10 KB

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