xref: /aosp_15_r20/external/googleapis/google/cloud/contentwarehouse/v1/common.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/resource.proto";
20import "google/protobuf/field_mask.proto";
21
22option csharp_namespace = "Google.Cloud.ContentWarehouse.V1";
23option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb";
24option java_multiple_files = true;
25option java_outer_classname = "CommonProto";
26option java_package = "com.google.cloud.contentwarehouse.v1";
27option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1";
28option ruby_package = "Google::Cloud::ContentWarehouse::V1";
29option (google.api.resource_definition) = {
30  type: "contentwarehouse.googleapis.com/Location"
31  pattern: "projects/{project}/locations/{location}"
32};
33
34// Meta information is used to improve the performance of the service.
35message RequestMetadata {
36  // Provides user unique identification and groups information.
37  UserInfo user_info = 1;
38}
39
40// Additional information returned to client, such as debugging information.
41message ResponseMetadata {
42  // A unique id associated with this call. This id is logged for tracking
43  // purpose.
44  string request_id = 1;
45}
46
47// The user information.
48message UserInfo {
49  // A unique user identification string, as determined by the client.
50  // The maximum number of allowed characters is 255.
51  // Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
52  // and restricted special symbols (:, @, +, -, _, ~)
53  // The format is "user:[email protected]";
54  string id = 1;
55
56  // The unique group identifications which the user is belong to.
57  // The format is "group:[email protected]";
58  repeated string group_ids = 2;
59}
60
61// Options for Update operations.
62message UpdateOptions {
63  // Type for update.
64  UpdateType update_type = 1;
65
66  // Field mask for merging Document fields.
67  // For the `FieldMask` definition,
68  // see
69  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
70  google.protobuf.FieldMask update_mask = 2;
71
72  // Options for merging.
73  MergeFieldsOptions merge_fields_options = 3;
74}
75
76// Options for merging updated fields.
77message MergeFieldsOptions {
78  // When merging message fields, the default behavior is to merge
79  // the content of two message fields together. If you instead want to use
80  // the field from the source message to replace the corresponding field in
81  // the destination message, set this flag to true. When this flag is set,
82  // specified submessage fields that are missing in source will be cleared in
83  // destination.
84  optional bool replace_message_fields = 1;
85
86  // When merging repeated fields, the default behavior is to append
87  // entries from the source repeated field to the destination repeated field.
88  // If you instead want to keep only the entries from the source repeated
89  // field, set this flag to true.
90  //
91  // If you want to replace a repeated field within a message field on the
92  // destination message, you must set both replace_repeated_fields and
93  // replace_message_fields to true, otherwise the repeated fields will be
94  // appended.
95  optional bool replace_repeated_fields = 2;
96}
97
98// Update type of the requests.
99enum UpdateType {
100  // Defaults to full replace behavior, ie. FULL_REPLACE.
101  UPDATE_TYPE_UNSPECIFIED = 0;
102
103  // Fully replace all the fields (including previously linked raw document).
104  // Any field masks will be ignored.
105  UPDATE_TYPE_REPLACE = 1;
106
107  // Merge the fields into the existing entities.
108  UPDATE_TYPE_MERGE = 2;
109
110  // Inserts the properties by names.
111  UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3;
112
113  // Replace the properties by names.
114  UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4;
115
116  // Delete the properties by names.
117  UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5;
118
119  // For each of the property, replaces the property if the it exists, otherwise
120  // inserts a new property. And for the rest of the fields, merge them based on
121  // update mask and merge fields options.
122  UPDATE_TYPE_MERGE_AND_REPLACE_OR_INSERT_PROPERTIES_BY_NAMES = 6;
123}
124
125// Type of database used by the customer
126enum DatabaseType {
127  // This value is required by protobuf best practices
128  DB_UNKNOWN = 0;
129
130  // Internal Spanner
131  DB_INFRA_SPANNER = 1;
132
133  // Cloud Sql with a Postgres Sql instance
134  DB_CLOUD_SQL_POSTGRES = 2 [deprecated = true];
135}
136
137// Access Control Mode.
138enum AccessControlMode {
139  // This value is required by protobuf best practices
140  ACL_MODE_UNKNOWN = 0;
141
142  // Universal Access: No document level access control.
143  ACL_MODE_UNIVERSAL_ACCESS = 1;
144
145  // Document level access control with customer own Identity Service.
146  ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2;
147
148  // Document level access control using Google Cloud Identity.
149  ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3;
150}
151
152// The default role of the document creator.
153enum DocumentCreatorDefaultRole {
154  // Unspecified, will be default to document admin role.
155  DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED = 0;
156
157  // Document Admin, same as contentwarehouse.googleapis.com/documentAdmin.
158  DOCUMENT_ADMIN = 1;
159
160  // Document Editor, same as contentwarehouse.googleapis.com/documentEditor.
161  DOCUMENT_EDITOR = 2;
162
163  // Document Viewer, same as contentwarehouse.googleapis.com/documentViewer.
164  DOCUMENT_VIEWER = 3;
165}
166