document_schema.proto 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "DocumentSchemaProto";
  22. option java_package = "com.google.cloud.contentwarehouse.v1";
  23. // A document schema used to define document structure.
  24. message DocumentSchema {
  25. option (google.api.resource) = {
  26. type: "contentwarehouse.googleapis.com/DocumentSchema"
  27. pattern: "projects/{project}/locations/{location}/documentSchemas/{document_schema}"
  28. };
  29. // The resource name of the document schema.
  30. // Format:
  31. // projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
  32. //
  33. // The name is ignored when creating a document schema.
  34. string name = 1;
  35. // Required. Name of the schema given by the user. Must be unique per customer.
  36. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  37. // Document details.
  38. repeated PropertyDefinition property_definitions = 3;
  39. // Document Type, true refers the document is a folder, otherwise it is
  40. // a typical document.
  41. bool document_is_folder = 4;
  42. // Output only. The time when the document schema is last updated.
  43. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  44. // Output only. The time when the document schema is created.
  45. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  46. // Schema description.
  47. string description = 7;
  48. }
  49. // Defines the metadata for a schema property.
  50. message PropertyDefinition {
  51. // Required. The name of the metadata property.
  52. // Must be unique within a document schema and is case insensitive.
  53. // Names must be non-blank, start with a letter, and can contain alphanumeric
  54. // characters and: /, :, -, _, and .
  55. string name = 1 [(google.api.field_behavior) = REQUIRED];
  56. // The display-name for the property, used for front-end.
  57. string display_name = 12;
  58. // Whether the property can have multiple values.
  59. bool is_repeatable = 2;
  60. // Whether the property can be filtered. If this is a sub-property, all the
  61. // parent properties must be marked filterable.
  62. bool is_filterable = 3;
  63. // Indicates that the property should be included in a global search.
  64. bool is_searchable = 4;
  65. // Whether the property is user supplied metadata.
  66. bool is_metadata = 5;
  67. // Whether the property is mandatory.
  68. // Default is 'false', i.e. populating property value can be skipped.
  69. // If 'true' then user must populate the value for this property.
  70. bool is_required = 14;
  71. // Type of the property.
  72. oneof value_type_options {
  73. // Integer property.
  74. IntegerTypeOptions integer_type_options = 7;
  75. // Float property.
  76. FloatTypeOptions float_type_options = 8;
  77. // Text/string property.
  78. TextTypeOptions text_type_options = 9;
  79. // Nested structured data property.
  80. PropertyTypeOptions property_type_options = 10;
  81. // Enum/categorical property.
  82. EnumTypeOptions enum_type_options = 11;
  83. // Date time property.
  84. // It is not supported by CMEK compliant deployment.
  85. DateTimeTypeOptions date_time_type_options = 13;
  86. // Map property.
  87. MapTypeOptions map_type_options = 15;
  88. // Timestamp property.
  89. // It is not supported by CMEK compliant deployment.
  90. TimestampTypeOptions timestamp_type_options = 16;
  91. }
  92. }
  93. // Configurations for an integer property.
  94. message IntegerTypeOptions {
  95. }
  96. // Configurations for a float property.
  97. message FloatTypeOptions {
  98. }
  99. // Configurations for a text property.
  100. message TextTypeOptions {
  101. }
  102. // Configurations for a date time property.
  103. message DateTimeTypeOptions {
  104. }
  105. // Configurations for a Map property.
  106. message MapTypeOptions {
  107. }
  108. // Configurations for a timestamp property.
  109. message TimestampTypeOptions {
  110. }
  111. // Configurations for a nested structured data property.
  112. message PropertyTypeOptions {
  113. // Required. List of property definitions.
  114. repeated PropertyDefinition property_definitions = 1 [(google.api.field_behavior) = REQUIRED];
  115. }
  116. // Configurations for an enum/categorical property.
  117. message EnumTypeOptions {
  118. // Required. List of possible enum values.
  119. repeated string possible_values = 1 [(google.api.field_behavior) = REQUIRED];
  120. // Make sure the Enum property value provided in the document is in the
  121. // possile value list during document creation. The validation check runs by
  122. // default.
  123. bool validation_check_disabled = 2;
  124. }