Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding location and doc schema #8371

Merged
merged 17 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
346 changes: 346 additions & 0 deletions mmv1/products/documentaiwarehouse/DocumentSchema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
# Copyright 2023 Google Inc.
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Api::Resource
name: 'DocumentSchema'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
base_url: 'projects/{{project_number}}/locations/{{location}}/documentSchemas'
self_link: '{{name}}'
delete_url: '{{name}}'
immutable: true
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/manage-document-schemas'
api: 'https://cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas'
description: |
A document schema is used to define document structure.
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb
examples:
- !ruby/object:Provider::Terraform::Examples
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: "document_ai_warehouse_document_schema_text"
primary_resource_id: "example_text"
vars:
document_schema_name: "schema-name-text"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_integer"
primary_resource_id: "example_integer"
vars:
document_schema_name: "schema-name-integer"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_float"
primary_resource_id: "example_float"
vars:
document_schema_name: "schema-name-float"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_property"
primary_resource_id: "example_property"
vars:
document_schema_name: "schema-name-property"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_property_enum"
primary_resource_id: "example_property_enum"
vars:
document_schema_name: "schema-name-property-enum"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_enum"
primary_resource_id: "example_enum"
vars:
document_schema_name: "schema-name-enum"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_map"
primary_resource_id: "example_map"
vars:
document_schema_name: "schema-name-map"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_datetime"
primary_resource_id: "example_datetime"
vars:
document_schema_name: "schema-name-datetime"
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_document_schema_timestamp"
primary_resource_id: "example_timestamp"
vars:
document_schema_name: "schema-name-timestamp"
parameters:
- !ruby/object:Api::Type::String
name: 'project_number'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
url_param_only: true
required: true
immutable: true
description: |
The unique identifier of the project.
- !ruby/object:Api::Type::String
name: 'location'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
url_param_only: true
immutable: true
required: true
description: |
The location of the resource.
properties:
- !ruby/object:Api::Type::String
name: 'name'
output: true
description: |
The resource name of the document schema.
- !ruby/object:Api::Type::String
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'displayName'
required: true
description: |
Name of the schema given by the user.
- !ruby/object:Api::Type::Boolean
name: 'documentIsFolder'
description: |
Tells whether the document is a folder or a typical document.
- !ruby/object:Api::Type::Array
name: 'propertyDefinitions'
description: |
Defines the metadata for a schema property.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'name'
required: true
description: |
The name of the metadata property.
- !ruby/object:Api::Type::String
name: 'displayName'
description: |
The display-name for the property, used for front-end.
- !ruby/object:Api::Type::Boolean
name: 'isRepeatable'
description: |
Whether the property can have multiple values.
- !ruby/object:Api::Type::Boolean
name: 'isFilterable'
description: |
Whether the property can be filtered. If this is a sub-property, all the parent properties must be marked filterable.
- !ruby/object:Api::Type::Boolean
name: 'isSearchable'
description: |
Indicates that the property should be included in a global search.
- !ruby/object:Api::Type::Boolean
name: 'isMetadata'
description: |
Whether the property is user supplied metadata.
- !ruby/object:Api::Type::Boolean
name: 'isRequired'
description: |
Whether the property is mandatory.
- !ruby/object:Api::Type::Enum
name: 'retrievalImportance'
description: |
Stores the retrieval importance.
values:
- :HIGHEST
- :HIGHER
- :HIGH
- :MEDIUM
- :LOW
- :LOWEST
- !ruby/object:Api::Type::Array
name: 'schemaSources'
description: |
The schema source information.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The schema name in the source.
- !ruby/object:Api::Type::String
name: 'processorType'
description: |
The Doc AI processor type name.
# select any one of the property types (integer, float, text, property, enum, dateTime, map, timestamp)
- !ruby/object:Api::Type::NestedObject
name: 'integerTypeOptions'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
description: |
Integer property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'floatTypeOptions'
description: |
Float property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'textTypeOptions'
description: |
Text/string property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'propertyTypeOptions'
description: |
Nested structured data property.
properties:
- !ruby/object:Api::Type::Array
name: 'propertyDefinitions'
description: |
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
Defines the metadata for a schema property.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
required: true
description: |
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
The name of the metadata property.
- !ruby/object:Api::Type::String
name: 'displayName'
description: |
The display-name for the property, used for front-end.
- !ruby/object:Api::Type::Boolean
name: 'isRepeatable'
description: |
Whether the property can have multiple values.
- !ruby/object:Api::Type::Boolean
name: 'isFilterable'
description: |
Whether the property can be filtered. If this is a sub-property, all the parent properties must be marked filterable.
- !ruby/object:Api::Type::Boolean
name: 'isSearchable'
description: |
Indicates that the property should be included in a global search.
- !ruby/object:Api::Type::Boolean
name: 'isMetadata'
description: |
Whether the property is user supplied metadata.
- !ruby/object:Api::Type::Boolean
name: 'isRequired'
description: |
Whether the property is mandatory.
- !ruby/object:Api::Type::Enum
name: 'retrievalImportance'
description: |
Stores the retrieval importance.
values:
- :HIGHEST
- :HIGHER
- :HIGH
- :MEDIUM
- :LOW
- :LOWEST
- !ruby/object:Api::Type::Array
name: 'schemaSources'
description: |
The schema source information.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The schema name in the source.
- !ruby/object:Api::Type::String
name: 'processorType'
description: |
The Doc AI processor type name.
- !ruby/object:Api::Type::NestedObject
name: 'integerTypeOptions'
description: |
Integer property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'floatTypeOptions'
description: |
Float property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'textTypeOptions'
description: |
Text property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'enumTypeOptions'
description: |
Enum/categorical property.
properties:
- !ruby/object:Api::Type::Array
name: 'possibleValues'
required: true
description: |
List of possible enum values.
item_type: Api::Type::String
- !ruby/object:Api::Type::Boolean
name: 'validationCheckDisabled'
description: |
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.
- !ruby/object:Api::Type::NestedObject
name: 'dateTimeTypeOptions'
description: |
Date time property. Not supported by CMEK compliant deployment.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'mapTypeOptions'
description: |
Map property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'timestampTypeOptions'
description: |
Timestamp property. Not supported by CMEK compliant deployment.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'enumTypeOptions'
description: |
Enum/categorical property.
properties:
- !ruby/object:Api::Type::Array
name: 'possibleValues'
required: true
description: |
List of possible enum values.
item_type: Api::Type::String
- !ruby/object:Api::Type::Boolean
name: 'validationCheckDisabled'
description: |
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.
- !ruby/object:Api::Type::NestedObject
name: 'dateTimeTypeOptions'
description: |
Date time property. Not supported by CMEK compliant deployment.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'mapTypeOptions'
description: |
Map property.
send_empty_value: true
allow_empty_object: true
properties: []
- !ruby/object:Api::Type::NestedObject
name: 'timestampTypeOptions'
description: |
Timestamp property. Not supported by CMEK compliant deployment.
send_empty_value: true
allow_empty_object: true
properties: []

Loading