document_schema_service.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.contentwarehouse.v1;
  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/contentwarehouse/v1/document_schema.proto";
  21. import "google/protobuf/empty.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "DocumentSchemaServiceProto";
  25. option java_package = "com.google.cloud.contentwarehouse.v1";
  26. // (go/id-aip-list) to add a finite deadline and enable fail_fast.
  27. // This service lets you manage document schema.
  28. service DocumentSchemaService {
  29. option (google.api.default_host) = "contentwarehouse.googleapis.com";
  30. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  31. // Creates a document schema.
  32. rpc CreateDocumentSchema(CreateDocumentSchemaRequest) returns (DocumentSchema) {
  33. option (google.api.http) = {
  34. post: "/v1/{parent=projects/*/locations/*}/documentSchemas"
  35. body: "document_schema"
  36. };
  37. option (google.api.method_signature) = "parent,document_schema";
  38. }
  39. // Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the
  40. // Document Schema is non-empty and does not equal the existing name.
  41. // Supports only appending new properties, adding new ENUM possible values,
  42. // and updating the [EnumTypeOptions.validation_check_disabled][google.cloud.contentwarehouse.v1.EnumTypeOptions.validation_check_disabled] flag for
  43. // ENUM possible values. Updating existing properties will result into
  44. // INVALID_ARGUMENT.
  45. rpc UpdateDocumentSchema(UpdateDocumentSchemaRequest) returns (DocumentSchema) {
  46. option (google.api.http) = {
  47. patch: "/v1/{name=projects/*/locations/*/documentSchemas/*}"
  48. body: "*"
  49. };
  50. option (google.api.method_signature) = "name,document_schema";
  51. }
  52. // Gets a document schema. Returns NOT_FOUND if the document schema does not
  53. // exist.
  54. rpc GetDocumentSchema(GetDocumentSchemaRequest) returns (DocumentSchema) {
  55. option (google.api.http) = {
  56. get: "/v1/{name=projects/*/locations/*/documentSchemas/*}"
  57. };
  58. option (google.api.method_signature) = "name";
  59. }
  60. // Deletes a document schema. Returns NOT_FOUND if the document schema does
  61. // not exist. Returns BAD_REQUEST if the document schema has documents
  62. // depending on it.
  63. rpc DeleteDocumentSchema(DeleteDocumentSchemaRequest) returns (google.protobuf.Empty) {
  64. option (google.api.http) = {
  65. delete: "/v1/{name=projects/*/locations/*/documentSchemas/*}"
  66. };
  67. option (google.api.method_signature) = "name";
  68. }
  69. // Lists document schemas.
  70. rpc ListDocumentSchemas(ListDocumentSchemasRequest) returns (ListDocumentSchemasResponse) {
  71. option (google.api.http) = {
  72. get: "/v1/{parent=projects/*/locations/*}/documentSchemas"
  73. };
  74. option (google.api.method_signature) = "parent";
  75. }
  76. }
  77. // Request message for DocumentSchemaService.CreateDocumentSchema.
  78. message CreateDocumentSchemaRequest {
  79. // Required. The parent name.
  80. string parent = 1 [
  81. (google.api.field_behavior) = REQUIRED,
  82. (google.api.resource_reference) = {
  83. type: "contentwarehouse.googleapis.com/Location"
  84. }
  85. ];
  86. // Required. The document schema to create.
  87. DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED];
  88. }
  89. // Request message for DocumentSchemaService.GetDocumentSchema.
  90. message GetDocumentSchemaRequest {
  91. // Required. The name of the document schema to retrieve.
  92. string name = 1 [
  93. (google.api.field_behavior) = REQUIRED,
  94. (google.api.resource_reference) = {
  95. type: "contentwarehouse.googleapis.com/DocumentSchema"
  96. }
  97. ];
  98. }
  99. // Request message for DocumentSchemaService.UpdateDocumentSchema.
  100. message UpdateDocumentSchemaRequest {
  101. // Required. The name of the document schema to update.
  102. // Format:
  103. // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
  104. string name = 1 [
  105. (google.api.field_behavior) = REQUIRED,
  106. (google.api.resource_reference) = {
  107. type: "contentwarehouse.googleapis.com/DocumentSchema"
  108. }
  109. ];
  110. // Required. The document schema to update with.
  111. DocumentSchema document_schema = 2 [(google.api.field_behavior) = REQUIRED];
  112. }
  113. // Request message for DocumentSchemaService.DeleteDocumentSchema.
  114. message DeleteDocumentSchemaRequest {
  115. // Required. The name of the document schema to delete.
  116. string name = 1 [
  117. (google.api.field_behavior) = REQUIRED,
  118. (google.api.resource_reference) = {
  119. type: "contentwarehouse.googleapis.com/DocumentSchema"
  120. }
  121. ];
  122. }
  123. // Request message for DocumentSchemaService.ListDocumentSchemas.
  124. message ListDocumentSchemasRequest {
  125. // Required. The parent, which owns this collection of document schemas.
  126. // Format: projects/{project_number}/locations/{location}.
  127. string parent = 1 [
  128. (google.api.field_behavior) = REQUIRED,
  129. (google.api.resource_reference) = {
  130. type: "contentwarehouse.googleapis.com/Location"
  131. }
  132. ];
  133. // The maximum number of document schemas to return. The service may return
  134. // fewer than this value.
  135. // If unspecified, at most 50 document schemas will be returned.
  136. // The maximum value is 1000; values above 1000 will be coerced to 1000.
  137. int32 page_size = 2;
  138. // A page token, received from a previous `ListDocumentSchemas` call.
  139. // Provide this to retrieve the subsequent page.
  140. //
  141. // When paginating, all other parameters provided to `ListDocumentSchemas`
  142. // must match the call that provided the page token.
  143. string page_token = 3;
  144. }
  145. // Response message for DocumentSchemaService.ListDocumentSchemas.
  146. message ListDocumentSchemasResponse {
  147. // The document schemas from the specified parent.
  148. repeated DocumentSchema document_schemas = 1;
  149. // A token, which can be sent as `page_token` to retrieve the next page.
  150. // If this field is omitted, there are no subsequent pages.
  151. string next_page_token = 2;
  152. }