common.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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/resource.proto";
  17. import "google/protobuf/field_mask.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "CommonProto";
  21. option java_package = "com.google.cloud.contentwarehouse.v1";
  22. option (google.api.resource_definition) = {
  23. type: "contentwarehouse.googleapis.com/Location"
  24. pattern: "projects/{project}/locations/{location}"
  25. };
  26. // Meta information is used to improve the performance of the service.
  27. message RequestMetadata {
  28. // Provides user unique identification and groups information.
  29. UserInfo user_info = 1;
  30. }
  31. // Additional information returned to client, such as debugging information.
  32. message ResponseMetadata {
  33. // A unique id associated with this call. This id is logged for tracking
  34. // purpose.
  35. string request_id = 1;
  36. }
  37. message UserInfo {
  38. // A unique user identification string, as determined by the client.
  39. // The maximum number of allowed characters is 255.
  40. // Allowed characters include numbers 0 to 9, uppercase and lowercase letters,
  41. // and restricted special symbols (:, @, +, -, _, ~)
  42. // The format is "user:xxxx@example.com";
  43. string id = 1;
  44. // The unique group identifications which the user is belong to.
  45. // The format is "group:yyyy@example.com";
  46. repeated string group_ids = 2;
  47. }
  48. // Options for Update operations.
  49. message UpdateOptions {
  50. // Type for update.
  51. UpdateType update_type = 1;
  52. // Field mask for merging Document fields.
  53. // For the `FieldMask` definition,
  54. // see
  55. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  56. google.protobuf.FieldMask update_mask = 2;
  57. // Options for merging.
  58. MergeFieldsOptions merge_fields_options = 3;
  59. }
  60. // Options for merging updated fields.
  61. message MergeFieldsOptions {
  62. // When merging message fields, the default behavior is to merge
  63. // the content of two message fields together. If you instead want to use
  64. // the field from the source message to replace the corresponding field in
  65. // the destination message, set this flag to true. When this flag is set,
  66. // specified submessage fields that are missing in source will be cleared in
  67. // destination.
  68. optional bool replace_message_fields = 1;
  69. // When merging repeated fields, the default behavior is to append
  70. // entries from the source repeated field to the destination repeated field.
  71. // If you instead want to keep only the entries from the source repeated
  72. // field, set this flag to true.
  73. //
  74. // If you want to replace a repeated field within a message field on the
  75. // destination message, you must set both replace_repeated_fields and
  76. // replace_message_fields to true, otherwise the repeated fields will be
  77. // appended.
  78. optional bool replace_repeated_fields = 2;
  79. }
  80. // Update type of the requests.
  81. enum UpdateType {
  82. // Defaults to full replace behavior, ie. FULL_REPLACE.
  83. UPDATE_TYPE_UNSPECIFIED = 0;
  84. // Fully replace all the fields. Any field masks will be ignored.
  85. UPDATE_TYPE_REPLACE = 1;
  86. // Merge the fields into the existing entities.
  87. UPDATE_TYPE_MERGE = 2;
  88. // Inserts the properties by names.
  89. UPDATE_TYPE_INSERT_PROPERTIES_BY_NAMES = 3;
  90. // Replace the properties by names.
  91. UPDATE_TYPE_REPLACE_PROPERTIES_BY_NAMES = 4;
  92. // Delete the properties by names.
  93. UPDATE_TYPE_DELETE_PROPERTIES_BY_NAMES = 5;
  94. }
  95. // Type of database used by the customer
  96. enum DatabaseType {
  97. // This value is required by protobuf best practices
  98. DB_UNKNOWN = 0;
  99. // Internal Spanner
  100. DB_INFRA_SPANNER = 1;
  101. // Cloud Sql with a Postgres Sql instance
  102. DB_CLOUD_SQL_POSTGRES = 2;
  103. }
  104. // Access Control Mode.
  105. enum AccessControlMode {
  106. // This value is required by protobuf best practices
  107. ACL_MODE_UNKNOWN = 0;
  108. // Universal Access: No document level access control.
  109. ACL_MODE_UNIVERSAL_ACCESS = 1;
  110. // Document level access control with customer own Identity Service.
  111. ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID = 2;
  112. // Document level access control using Google Cloud Identity.
  113. ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI = 3;
  114. }