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