# REST Resource: projects.locations.documentSchemas

## Resource: DocumentSchema

A document schema used to define document structure.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "propertyDefinitions": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyDefinition`) } ], "documentIsFolder": boolean, "updateTime": string, "createTime": string, "description": string } ``` |

| Fields ||
|---|---|
| `name` | `string` The resource name of the document schema. Format: projects/{projectNumber}/locations/{location}/documentSchemas/{document_schema_id}. The name is ignored when creating a document schema. |
| `displayName` | `string` Required. name of the schema given by the user. Must be unique per project. |
| `propertyDefinitions[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyDefinition`)`` Document details. |
| `documentIsFolder` | `boolean` Document type, true refers the document is a folder, otherwise it is a typical document. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the document schema is last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the document schema is created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `description` | `string` Schema description. |

## PropertyDefinition

Defines the metadata for a schema property.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "isRepeatable": boolean, "isFilterable": boolean, "isSearchable": boolean, "isMetadata": boolean, "isRequired": boolean, "retrievalImportance": enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#RetrievalImportance`), "schemaSources": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#SchemaSource`) } ], // Union field `value_type_options` can be only one of the following: "integerTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#IntegerTypeOptions`) }, "floatTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#FloatTypeOptions`) }, "textTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#TextTypeOptions`) }, "propertyTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyTypeOptions`) }, "enumTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#EnumTypeOptions`) }, "dateTimeTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#DateTimeTypeOptions`) }, "mapTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#MapTypeOptions`) }, "timestampTypeOptions": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#TimestampTypeOptions`) } // End of list of possible types for union field `value_type_options`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The name of the metadata property. Must be unique within a document schema and is case insensitive. Names must be non-blank, start with a letter, and can contain alphanumeric characters and: /, :, -, _, and . |
| `displayName` | `string` The display-name for the property, used for front-end. |
| `isRepeatable` | `boolean` Whether the property can have multiple values. |
| `isFilterable` | `boolean` Whether the property can be filtered. If this is a sub-property, all the parent properties must be marked filterable. |
| `isSearchable` | `boolean` Indicates that the property should be included in a global search. |
| `isMetadata` | `boolean` Whether the property is user supplied metadata. This out-of-the box placeholder setting can be used to tag derived properties. Its value and interpretation logic should be implemented by API user. |
| `isRequired` | `boolean` Whether the property is mandatory. Default is 'false', i.e. populating property value can be skipped. If 'true' then user must populate the value for this property. |
| `retrievalImportance` | ``enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#RetrievalImportance`)`` The retrieval importance of the property during search. |
| `schemaSources[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#SchemaSource`)`` The mapping information between this property to another schema source. |
| Union field `value_type_options`. Type of the property. `value_type_options` can be only one of the following: ||
| `integerTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#IntegerTypeOptions`)`` Integer property. |
| `floatTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#FloatTypeOptions`)`` Float property. |
| `textTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#TextTypeOptions`)`` text/string property. |
| `propertyTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyTypeOptions`)`` Nested structured data property. |
| `enumTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#EnumTypeOptions`)`` Enum/categorical property. |
| `dateTimeTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#DateTimeTypeOptions`)`` date time property. It is not supported by CMEK compliant deployment. |
| `mapTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#MapTypeOptions`)`` Map property. |
| `timestampTypeOptions` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#TimestampTypeOptions`)`` timestamp property. It is not supported by CMEK compliant deployment. |

## RetrievalImportance

Stores the retrieval importance.

| Enums ||
|---|---|
| `RETRIEVAL_IMPORTANCE_UNSPECIFIED` | No importance specified. Default medium importance. |
| `HIGHEST` | Highest importance. |
| `HIGHER` | Higher importance. |
| `HIGH` | High importance. |
| `MEDIUM` | Medium importance. |
| `LOW` | Low importance (negative). |
| `LOWEST` | Lowest importance (negative). |

## IntegerTypeOptions

This type has no fields.
Configurations for an integer property.

## FloatTypeOptions

This type has no fields.
Configurations for a float property.

## TextTypeOptions

This type has no fields.
Configurations for a text property.

## PropertyTypeOptions

Configurations for a nested structured data property.

| JSON representation |
|---|
| ``` { "propertyDefinitions": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyDefinition`) } ] } ``` |

| Fields ||
|---|---|
| `propertyDefinitions[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas#PropertyDefinition`)`` Required. List of property definitions. |

## EnumTypeOptions

Configurations for an enum/categorical property.

| JSON representation |
|---|
| ``` { "possibleValues": [ string ], "validationCheckDisabled": boolean } ``` |

| Fields ||
|---|---|
| `possibleValues[]` | `string` Required. List of possible enum values. |
| `validationCheckDisabled` | `boolean` Make sure the Enum property value provided in the document is in the possile value list during document creation. The validation check runs by default. |

## DateTimeTypeOptions

This type has no fields.
Configurations for a date time property.

## MapTypeOptions

This type has no fields.
Configurations for a Map property.

## TimestampTypeOptions

This type has no fields.
Configurations for a timestamp property.

## SchemaSource

The schema source information.

| JSON representation |
|---|
| ``` { "name": string, "processorType": string } ``` |

| Fields ||
|---|---|
| `name` | `string` The schema name in the source. |
| `processorType` | `string` The Doc AI processor type name. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas/create` | Creates a document schema. |
| ### `https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas/delete` | Deletes a document schema. |
| ### `https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas/get` | Gets a document schema. |
| ### `https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas/list` | Lists document schemas. |
| ### `https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas/patch` | Updates a Document Schema. |