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 2 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
261 changes: 261 additions & 0 deletions mmv1/products/documentaiwarehouse/DocumentSchema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
# 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}}/locations/{{location}}/documentSchemas'
self_link: '{{name}}'
delete_url: '{{name}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
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_wh.go.erb
# import_format: [
# "projects/{{project}}/locations/{{location}}/documentSchemas/{{name}}",
# "{{project}}/{{locations}}/{{name}}",
# "{{name}}"
# ]
examples:
- !ruby/object:Provider::Terraform::Examples
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: "document_ai_warehouse_document_schema"
primary_resource_id: "example"
vars:
document_schema_name: "schema-name"
parameters:
- !ruby/object:Api::Type::String
name: 'location'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
url_param_only: 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'
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.
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'
description: |
The name of the metadata property.
- !ruby/object:Api::Type::String
name: 'displayName'
required: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
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:
- :RETRIEVAL_IMPORTANCE_UNSPECIFIED
- :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'
required: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
description: |
The Doc AI processor type name.
- !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::String
name: 'dummy'
description: |
Configurations for an integer property.
send_empty_value: true
- !ruby/object:Api::Type::NestedObject
name: 'floatTypeOptions'
description: |
Float property.
send_empty_value: true
allow_empty_object: true
properties:
- !ruby/object:Api::Type::String
name: 'dummy'
description: |
Configurations for a float property.
send_empty_value: true
- !ruby/object:Api::Type::NestedObject
name: 'textTypeOptions'
description: |
Text/string property.
send_empty_value: true
allow_empty_object: true
properties:
- !ruby/object:Api::Type::String
name: 'dummy'
description: |
Configurations for a text property.
send_empty_value: true
- !ruby/object:Api::Type::NestedObject
name: 'propertyTypeOptions'
description: |
Nested structured data property.
send_empty_value: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
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.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
The name of the metadata property.
- !ruby/object:Api::Type::String
name: 'displayName'
required: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
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::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::String
name: 'dummy'
description: |
Configurations for an text property.
send_empty_value: true
- !ruby/object:Api::Type::NestedObject
name: 'enumTypeOptions'
description: |
Enum/categorical property.
send_empty_value: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
properties:
- !ruby/object:Api::Type::Array
name: 'possibleValues'
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::String
name: 'dummy'
description: |
Configurations for a date time property.
send_empty_value: true
- !ruby/object:Api::Type::NestedObject
name: 'mapTypeOptions'
description: |
Map property.
send_empty_value: true
allow_empty_object: true
properties:
- !ruby/object:Api::Type::String
name: 'dummy'
description: |
Configurations for a Map property.
send_empty_value: true
- !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::String
name: 'dummy'
description: |
Configurations for a timestamp property.
send_empty_value: true


68 changes: 68 additions & 0 deletions mmv1/products/documentaiwarehouse/Location.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2023 Google Inc.
# 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
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'Location'
base_url: 'projects/{{project}}/locations/us:initialize'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
self_link: '{{name}}'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview'
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
api: 'https://cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations'
description: |
A location is used to initialize a project.
skip_delete: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
skip_sweeper: true
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
# import_format:
# [
# 'projects/{{project}}/locations/{{location}}',
# '{{location}}'
# ]
# timeouts: !ruby/object:Api::Timeouts
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
# insert_minutes: 20
examples:
- !ruby/object:Provider::Terraform::Examples
name: "document_ai_warehouse_location"
primary_resource_id: "example"
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
# custom_code: !ruby/object:Provider::Terraform::CustomCode
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
# custom_create: 'templates/terraform/custom_create/document_ai_warehouse_location.go'
parameters:
- !ruby/object:Api::Type::String
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'location'
description: |
The location of the resource.
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
properties:
- !ruby/object:Api::Type::String
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'name'
output: true
description: |
Name of the instance.
- !ruby/object:Api::Type::Enum
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'databaseType'
description: |
The type of database used to store customer data.
values:
- :DB_UNKNOWN
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
- :DB_INFRA_SPANNER
- :DB_CLOUD_SQL_POSTGRES
default_value: :DB_INFRA_SPANNER
- !ruby/object:Api::Type::Enum
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
name: 'accessControlMode'
description: |
The access control mode for accessing the customer data.
values:
- :ACL_MODE_UNKNOWN
zli82016 marked this conversation as resolved.
Show resolved Hide resolved
- :ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI
- :ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_BYOID
- :ACL_MODE_UNIVERSAL_ACCESS
default_value: :ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI
26 changes: 26 additions & 0 deletions mmv1/products/documentaiwarehouse/product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2023 Google Inc.
# 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::Product
name: DocumentAIWarehouse
display_name: Document AI Warehouse
versions:
- !ruby/object:Api::Product::Version
name: ga
base_url: https://contentwarehouse.googleapis.com/v1/
scopes:
- https://www.googleapis.com/auth/cloud-platform
apis_required:
- !ruby/object:Api::Product::ApiReference
name: Document AI Warehouse API
url: https://console.cloud.google.com/apis/library/contentwarehouse.googleapis.com/
Loading