From b9f3b3e9b3d8bc39a8cc3f214055a92f56498b45 Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 18 Jul 2023 12:47:00 +0530 Subject: [PATCH 01/17] adding location and doc schema --- .../documentaiwarehouse/DocumentSchema.yaml | 248 ++++++++++++++++++ .../documentaiwarehouse/Location.yaml | 55 ++++ .../products/documentaiwarehouse/product.yaml | 13 + .../document_ai_warehouse_location.go | 56 ++++ .../custom_import/document_wh.go.erb | 17 ++ .../document_ai_warehouse_document.tf.erb | 2 + ...cument_ai_warehouse_document_schema.tf.erb | 9 + .../document_ai_warehouse_location.tf.erb | 3 + 8 files changed, 403 insertions(+) create mode 100644 mmv1/products/documentaiwarehouse/DocumentSchema.yaml create mode 100644 mmv1/products/documentaiwarehouse/Location.yaml create mode 100644 mmv1/products/documentaiwarehouse/product.yaml create mode 100644 mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go create mode 100644 mmv1/templates/terraform/custom_import/document_wh.go.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml new file mode 100644 index 000000000000..cdcf13014687 --- /dev/null +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -0,0 +1,248 @@ +--- !ruby/object:Api::Resource +name: 'DocumentSchema' +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' + 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 + name: "document_ai_warehouse_document_schema" + primary_resource_id: "example" + vars: + document_schema_name: "schema-name" +parameters: + - !ruby/object:Api::Type::String + name: 'location' + 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 + 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 + name: 'name' + description: | + The name of the metadata property. + - !ruby/object:Api::Type::String + name: 'displayName' + required: true + 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 + 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::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 + properties: + - !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 + name: 'name' + description: | + The name of the metadata property. + - !ruby/object:Api::Type::String + name: 'displayName' + required: true + 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 + 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 + 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 + + diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml new file mode 100644 index 000000000000..e3b901e78e84 --- /dev/null +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -0,0 +1,55 @@ +--- !ruby/object:Api::Resource +name: 'Location' +base_url: 'projects/{{project}}/locations/us:initialize' +self_link: '{{name}}' +references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview' + 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 +skip_sweeper: true +# import_format: +# [ +# 'projects/{{project}}/locations/{{location}}', +# '{{location}}' +# ] +# timeouts: !ruby/object:Api::Timeouts +# insert_minutes: 20 +examples: + - !ruby/object:Provider::Terraform::Examples + name: "document_ai_warehouse_location" + primary_resource_id: "example" +# custom_code: !ruby/object:Provider::Terraform::CustomCode +# custom_create: 'templates/terraform/custom_create/document_ai_warehouse_location.go' +parameters: + - !ruby/object:Api::Type::String + name: 'location' + description: | + The location of the resource. +properties: + - !ruby/object:Api::Type::String + name: 'name' + output: true + description: | + Name of the instance. + - !ruby/object:Api::Type::Enum + name: 'databaseType' + description: | + The type of database used to store customer data. + values: + - :DB_UNKNOWN + - :DB_INFRA_SPANNER + - :DB_CLOUD_SQL_POSTGRES + default_value: :DB_INFRA_SPANNER + - !ruby/object:Api::Type::Enum + name: 'accessControlMode' + description: | + The access control mode for accessing the customer data. + values: + - :ACL_MODE_UNKNOWN + - :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 \ No newline at end of file diff --git a/mmv1/products/documentaiwarehouse/product.yaml b/mmv1/products/documentaiwarehouse/product.yaml new file mode 100644 index 000000000000..7f2e6d8d698a --- /dev/null +++ b/mmv1/products/documentaiwarehouse/product.yaml @@ -0,0 +1,13 @@ +--- !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/ \ No newline at end of file diff --git a/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go b/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go new file mode 100644 index 000000000000..e5119f0f0c1a --- /dev/null +++ b/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go @@ -0,0 +1,56 @@ +userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent) +if err != nil { + return err +} + +fmt.Println("dummy") +fmt.Println("UserAgent", userAgent) + +url, err := tpgresource.ReplaceVars(d, config, "{{DocumentAIWarehouseBasePath}}projects/{{project}}/locations/us:initialize") +if err != nil { + return err +} + +billingProject := "" + +project, err := tpgresource.GetProject(d, config) +if err != nil { + return fmt.Errorf("Error fetching project for Config: %s", err) +} +billingProject = project + +// err == nil indicates that the billing_project value was found +if bp, err := tpgresource.GetBillingProject(d, config); err == nil { + billingProject = bp +} + +res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ + Config: config, + Method: "POST", + Project: billingProject, + RawURL: url, + UserAgent: userAgent, + Timeout: d.Timeout(schema.TimeoutCreate), +}) +if err != nil { + return fmt.Errorf("Error in provisioning: %s", err) +} +if err := d.Set("name", flattenDocumentAIWarehouseLocationName(res["name"], d, config)); err != nil { + return fmt.Errorf(`Error setting computed identity field "name": %s`, err) +} + +// Store the ID now +id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/locations/us:initialize") +if err != nil { + return fmt.Errorf("Error constructing id: %s", err) +} +d.SetId(id) + +// Update the resource after initializing auth to set fields. +if err := resourceDocumentAIWarehouseLocationUpdate(d, meta); err != nil { + return err +} + +log.Printf("[DEBUG] Finished creating Config %q: %#v", d.Id(), res) + +return resourceDocumentAIWarehouseLocationRead(d, meta) diff --git a/mmv1/templates/terraform/custom_import/document_wh.go.erb b/mmv1/templates/terraform/custom_import/document_wh.go.erb new file mode 100644 index 000000000000..12792ad27fbd --- /dev/null +++ b/mmv1/templates/terraform/custom_import/document_wh.go.erb @@ -0,0 +1,17 @@ +config := meta.(*transport_tpg.Config) + +if err := tpgresource.ParseImportId([]string{ + "projects/(?P[^/]+)/locations/(?P[^/]+)/documentSchemas/(?P[^/]+)"}, d, config); err != nil { + return nil, err +} + +originalName := d.Get("name").(string) +originalLocation := d.Get("location").(string) +originalProject := d.Get("project").(string) +name := fmt.Sprintf("projects/%s/locations/%s/documentSchemas/%s", originalProject, originalLocation, originalName) + +if err := d.Set("name", name); err != nil { + return nil, fmt.Errorf("Error setting name: %s", err) +} +d.SetId(name) +return []*schema.ResourceData{d}, nil diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb new file mode 100644 index 000000000000..181fb2293b5e --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb @@ -0,0 +1,2 @@ +resource "google_document_ai_warehouse_document" "<%= ctx[:primary_resource_id] %>" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb new file mode 100644 index 000000000000..434a8b49315f --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb @@ -0,0 +1,9 @@ +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + display_name = "<%= ctx[:vars]['document_schema_name'] %>" + location = "us" + property_definitions { + name = "testinvoice" + display_name = "testpropdef" + text_type_options {} + } +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb new file mode 100644 index 000000000000..9b119655c202 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb @@ -0,0 +1,3 @@ +resource "google_document_ai_warehouse_location" "<%= ctx[:primary_resource_id] %>" { + location = "us" +} \ No newline at end of file From c2f4c1c71ef966c89e5061c1524af0f6549778cb Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 18 Jul 2023 22:40:43 +0530 Subject: [PATCH 02/17] added copyright --- .../documentaiwarehouse/DocumentSchema.yaml | 13 +++++++++++++ mmv1/products/documentaiwarehouse/Location.yaml | 13 +++++++++++++ mmv1/products/documentaiwarehouse/product.yaml | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index cdcf13014687..6ea18b5a6899 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -1,3 +1,16 @@ +# 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 name: 'DocumentSchema' base_url: 'projects/{{project}}/locations/{{location}}/documentSchemas' diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index e3b901e78e84..e22552a7a210 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -1,3 +1,16 @@ +# 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 name: 'Location' base_url: 'projects/{{project}}/locations/us:initialize' diff --git a/mmv1/products/documentaiwarehouse/product.yaml b/mmv1/products/documentaiwarehouse/product.yaml index 7f2e6d8d698a..0a3d6158400d 100644 --- a/mmv1/products/documentaiwarehouse/product.yaml +++ b/mmv1/products/documentaiwarehouse/product.yaml @@ -1,3 +1,16 @@ +# 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 From e61c2574d8615f33524f7f14337e4f08f63d0214 Mon Sep 17 00:00:00 2001 From: purvii Date: Wed, 19 Jul 2023 22:20:29 +0530 Subject: [PATCH 03/17] resolved required field, url_param_only field, description, autogen_async, async in Location --- .../documentaiwarehouse/DocumentSchema.yaml | 2 +- .../documentaiwarehouse/Location.yaml | 53 +++++++++++++++---- ...ument_ai_warehouse_document_schema.go.erb} | 0 .../document_ai_warehouse_location.tf.erb | 6 +++ 4 files changed, 50 insertions(+), 11 deletions(-) rename mmv1/templates/terraform/custom_import/{document_wh.go.erb => document_ai_warehouse_document_schema.go.erb} (100%) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 6ea18b5a6899..d07a26e85fd8 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -23,7 +23,7 @@ references: !ruby/object:Api::Resource::ReferenceLinks 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 + custom_import: templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb # import_format: [ # "projects/{{project}}/locations/{{location}}/documentSchemas/{{name}}", # "{{project}}/{{locations}}/{{name}}", diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index e22552a7a210..6e96ad48ca2c 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -21,15 +21,28 @@ references: !ruby/object:Api::Resource::ReferenceLinks api: 'https://cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations' description: | A location is used to initialize a project. +autogen_async: true +async: !ruby/object:Api::OpAsync + actions: ['create'] + operation: !ruby/object:Api::OpAsync::Operation + path: 'name' + base_url: '{{op_id}}' + wait_ms: + 1000 + result: !ruby/object:Api::OpAsync::Result + path: 'response' + # resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: true + allowed: + - true + - false + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' skip_delete: true skip_sweeper: true -# import_format: -# [ -# 'projects/{{project}}/locations/{{location}}', -# '{{location}}' -# ] -# timeouts: !ruby/object:Api::Timeouts -# insert_minutes: 20 examples: - !ruby/object:Provider::Terraform::Examples name: "document_ai_warehouse_location" @@ -39,8 +52,9 @@ examples: parameters: - !ruby/object:Api::Type::String name: 'location' + url_param_only: true description: | - The location of the resource. + The location in which the instance is to be provisioned. properties: - !ruby/object:Api::Type::String name: 'name' @@ -51,18 +65,37 @@ properties: name: 'databaseType' description: | The type of database used to store customer data. + required: true values: - :DB_UNKNOWN - :DB_INFRA_SPANNER - :DB_CLOUD_SQL_POSTGRES - default_value: :DB_INFRA_SPANNER + # default_value: :DB_INFRA_SPANNER - !ruby/object:Api::Type::Enum name: 'accessControlMode' description: | The access control mode for accessing the customer data. + required: true values: - :ACL_MODE_UNKNOWN - :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 \ No newline at end of file + # default_value: :ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI + - !ruby/object:Api::Type::String + name: 'kmsKey' + description: | + The KMS key used for CMEK encryption. It is required that + the kms key is in the same region as the endpoint. The + same key will be used for all provisioned resources, if + encryption is available. If the kmsKey is left empty, no + encryption will be enforced. + - !ruby/object:Api::Type::Enum + name: 'documentCreatorDefaultRole' + description: | + The default role for the person who create a document. + values: + - :DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED + - :DOCUMENT_ADMIN + - :DOCUMENT_EDITOR + - :DOCUMENT_VIEWER \ No newline at end of file diff --git a/mmv1/templates/terraform/custom_import/document_wh.go.erb b/mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb similarity index 100% rename from mmv1/templates/terraform/custom_import/document_wh.go.erb rename to mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb index 9b119655c202..2437fe54f5f5 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb @@ -1,3 +1,9 @@ resource "google_document_ai_warehouse_location" "<%= ctx[:primary_resource_id] %>" { location = "us" + project = data.google_project.project.number + access_control_mode = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI" + database_type = "DB_INFRA_SPANNER" +} + +data "google_project" "project" { } \ No newline at end of file From 90e77ddc3f454f7567f7478398a86ac0d166721b Mon Sep 17 00:00:00 2001 From: purvii Date: Wed, 19 Jul 2023 22:20:48 +0530 Subject: [PATCH 04/17] resolved required field, url_param_only field, description, autogen_async, async in Location --- mmv1/products/documentaiwarehouse/Location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index 6e96ad48ca2c..d7cb4f7bc926 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -54,7 +54,7 @@ parameters: name: 'location' url_param_only: true description: | - The location in which the instance is to be provisioned. + The location in which the instance is to be provisioned. It takes the form projects/{projectNumber}/locations/{location}. properties: - !ruby/object:Api::Type::String name: 'name' From cb840cfcffa880662ec736f27804b99b9189dcc1 Mon Sep 17 00:00:00 2001 From: purvii Date: Thu, 20 Jul 2023 15:40:18 +0530 Subject: [PATCH 05/17] resolved hardcoded location, few fields in location, removed unnecessary enum values --- .../documentaiwarehouse/DocumentSchema.yaml | 5 ----- mmv1/products/documentaiwarehouse/Location.yaml | 15 +++++---------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index d07a26e85fd8..693b6d7efddf 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -24,11 +24,6 @@ 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 -# import_format: [ -# "projects/{{project}}/locations/{{location}}/documentSchemas/{{name}}", -# "{{project}}/{{locations}}/{{name}}", -# "{{name}}" -# ] examples: - !ruby/object:Provider::Terraform::Examples name: "document_ai_warehouse_document_schema" diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index d7cb4f7bc926..1d103c318c8b 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -13,8 +13,8 @@ --- !ruby/object:Api::Resource name: 'Location' -base_url: 'projects/{{project}}/locations/us:initialize' -self_link: '{{name}}' +base_url: 'projects/{{project}}/locations/{{location}}:initialize' +# self_link: '{{name}}' references: !ruby/object:Api::Resource::ReferenceLinks guides: 'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview' @@ -31,7 +31,6 @@ async: !ruby/object:Api::OpAsync 1000 result: !ruby/object:Api::OpAsync::Result path: 'response' - # resource_inside_response: true status: !ruby/object:Api::OpAsync::Status path: 'done' complete: true @@ -41,18 +40,19 @@ async: !ruby/object:Api::OpAsync error: !ruby/object:Api::OpAsync::Error path: 'error' message: 'message' +immutable: true +skip_read: true skip_delete: true skip_sweeper: true examples: - !ruby/object:Provider::Terraform::Examples name: "document_ai_warehouse_location" primary_resource_id: "example" -# custom_code: !ruby/object:Provider::Terraform::CustomCode -# custom_create: 'templates/terraform/custom_create/document_ai_warehouse_location.go' parameters: - !ruby/object:Api::Type::String name: 'location' url_param_only: true + required: true description: | The location in which the instance is to be provisioned. It takes the form projects/{projectNumber}/locations/{location}. properties: @@ -67,21 +67,17 @@ properties: The type of database used to store customer data. required: true values: - - :DB_UNKNOWN - :DB_INFRA_SPANNER - :DB_CLOUD_SQL_POSTGRES - # default_value: :DB_INFRA_SPANNER - !ruby/object:Api::Type::Enum name: 'accessControlMode' description: | The access control mode for accessing the customer data. required: true values: - - :ACL_MODE_UNKNOWN - :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 - !ruby/object:Api::Type::String name: 'kmsKey' description: | @@ -95,7 +91,6 @@ properties: description: | The default role for the person who create a document. values: - - :DOCUMENT_CREATOR_DEFAULT_ROLE_UNSPECIFIED - :DOCUMENT_ADMIN - :DOCUMENT_EDITOR - :DOCUMENT_VIEWER \ No newline at end of file From ae843f05eeb43988a7e68a1203671b4a4f921e03 Mon Sep 17 00:00:00 2001 From: purvii Date: Fri, 21 Jul 2023 00:39:27 +0530 Subject: [PATCH 06/17] resolved project_number, added fields in location example --- .../documentaiwarehouse/DocumentSchema.yaml | 8 +++++++- mmv1/products/documentaiwarehouse/Location.yaml | 13 +++++++------ .../document_ai_warehouse_document_schema.tf.erb | 4 ++++ .../examples/document_ai_warehouse_location.tf.erb | 6 ++++-- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 693b6d7efddf..fe7e1b79ca39 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -13,7 +13,7 @@ --- !ruby/object:Api::Resource name: 'DocumentSchema' -base_url: 'projects/{{project}}/locations/{{location}}/documentSchemas' +base_url: 'projects/{{project_number}}/locations/{{location}}/documentSchemas' self_link: '{{name}}' delete_url: '{{name}}' references: !ruby/object:Api::Resource::ReferenceLinks @@ -31,6 +31,12 @@ examples: vars: document_schema_name: "schema-name" parameters: + - !ruby/object:Api::Type::String + name: 'project_number' + url_param_only: true + required: true + description: | + The unique identifier of the project. - !ruby/object:Api::Type::String name: 'location' url_param_only: true diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index 1d103c318c8b..daad6447baab 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -13,7 +13,7 @@ --- !ruby/object:Api::Resource name: 'Location' -base_url: 'projects/{{project}}/locations/{{location}}:initialize' +base_url: 'projects/{{project_number}}/locations/{{location}}:initialize' # self_link: '{{name}}' references: !ruby/object:Api::Resource::ReferenceLinks guides: @@ -49,6 +49,12 @@ examples: name: "document_ai_warehouse_location" primary_resource_id: "example" parameters: + - !ruby/object:Api::Type::String + name: 'project_number' + url_param_only: true + required: true + description: | + The unique identifier of the project. - !ruby/object:Api::Type::String name: 'location' url_param_only: true @@ -56,11 +62,6 @@ parameters: description: | The location in which the instance is to be provisioned. It takes the form projects/{projectNumber}/locations/{location}. properties: - - !ruby/object:Api::Type::String - name: 'name' - output: true - description: | - Name of the instance. - !ruby/object:Api::Type::Enum name: 'databaseType' description: | diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb index 434a8b49315f..99b646ec7791 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb @@ -1,9 +1,13 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { display_name = "<%= ctx[:vars]['document_schema_name'] %>" location = "us" + project_number = data.google_project.project.number property_definitions { name = "testinvoice" display_name = "testpropdef" text_type_options {} } +} + +data "google_project" "project" { } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb index 2437fe54f5f5..28ef1e3f8a78 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_location.tf.erb @@ -1,8 +1,10 @@ resource "google_document_ai_warehouse_location" "<%= ctx[:primary_resource_id] %>" { location = "us" - project = data.google_project.project.number + project_number = data.google_project.project.number access_control_mode = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI" - database_type = "DB_INFRA_SPANNER" + database_type = "DB_INFRA_SPANNER" + kms_key = "dummy_key" + document_creator_default_role = "DOCUMENT_ADMIN" } data "google_project" "project" { From 9ad331985e8247e687f37a070bb1e1cca725711a Mon Sep 17 00:00:00 2001 From: purvii Date: Fri, 21 Jul 2023 11:20:59 +0530 Subject: [PATCH 07/17] DocumentSchema final changes --- mmv1/products/documentaiwarehouse/DocumentSchema.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index fe7e1b79ca39..2da8dbabfcf5 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -40,6 +40,7 @@ parameters: - !ruby/object:Api::Type::String name: 'location' url_param_only: true + required: true description: | The location of the resource. properties: @@ -96,13 +97,13 @@ properties: description: | Stores the retrieval importance. values: - - :RETRIEVAL_IMPORTANCE_UNSPECIFIED - :HIGHEST - :HIGHER - :HIGH - :MEDIUM - :LOW - :LOWEST + default_value: :MEDIUM - !ruby/object:Api::Type::Array name: 'schemaSources' description: | @@ -118,6 +119,7 @@ properties: required: true 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' description: | @@ -215,6 +217,7 @@ properties: properties: - !ruby/object:Api::Type::Array name: 'possibleValues' + required: true description: | List of possible enum values. item_type: Api::Type::String From 8558475f6ff7827ce9d096cbfbf9570a79bb9c60 Mon Sep 17 00:00:00 2001 From: purvii Date: Fri, 21 Jul 2023 15:30:32 +0530 Subject: [PATCH 08/17] added timeouts in Location --- mmv1/products/documentaiwarehouse/Location.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index daad6447baab..52299db7ec89 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -14,7 +14,6 @@ --- !ruby/object:Api::Resource name: 'Location' base_url: 'projects/{{project_number}}/locations/{{location}}:initialize' -# self_link: '{{name}}' references: !ruby/object:Api::Resource::ReferenceLinks guides: 'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview' @@ -31,6 +30,7 @@ async: !ruby/object:Api::OpAsync 1000 result: !ruby/object:Api::OpAsync::Result path: 'response' + resource_inside_response: true status: !ruby/object:Api::OpAsync::Status path: 'done' complete: true @@ -44,10 +44,16 @@ immutable: true skip_read: true skip_delete: true skip_sweeper: true +exclude_import: true examples: - !ruby/object:Provider::Terraform::Examples name: "document_ai_warehouse_location" primary_resource_id: "example" + skip_import_test: true +timeouts: !ruby/object:Api::Timeouts + insert_minutes: 30 + update_minutes: 30 + delete_minutes: 30 parameters: - !ruby/object:Api::Type::String name: 'project_number' From fc2f3a45301036ec6bf08aad08d3e67ae91ba7cb Mon Sep 17 00:00:00 2001 From: purvii Date: Sun, 23 Jul 2023 22:55:46 +0530 Subject: [PATCH 09/17] adding missing fields from test report --- .../documentaiwarehouse/DocumentSchema.yaml | 27 +++ ...cument_ai_warehouse_document_schema.tf.erb | 202 +++++++++++++++++- 2 files changed, 224 insertions(+), 5 deletions(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 2da8dbabfcf5..9d3228a0ef5f 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -197,6 +197,33 @@ properties: 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 + default_value: :MEDIUM + - !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 + description: | + The Doc AI processor type name. - !ruby/object:Api::Type::NestedObject name: 'textTypeOptions' description: | diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb index 99b646ec7791..1a1ab824e04a 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb @@ -1,13 +1,205 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { - display_name = "<%= ctx[:vars]['document_schema_name'] %>" - location = "us" - project_number = data.google_project.project.number + project_number = "406397197218" + display_name = "test-property-integer" + location = "us" + + property_definitions { + name = "prop1" + display_name = "propdisp1" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + integer_type_options {} + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-float" + location = "us" + property_definitions { - name = "testinvoice" - display_name = "testpropdef" + name = "prop2" + display_name = "propdisp2" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + float_type_options {} + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-text" + location = "us" + document_is_folder = false + + property_definitions { + name = "prop3" + display_name = "propdisp3" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } text_type_options {} } } +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-property" + location = "us" + document_is_folder = false + + property_definitions { + name = "prop8" + display_name = "propdisp8" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + property_type_options { + property_definitions { + name = "prop8_nested" + display_name = "propdisp8_nested" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source_nested" + processor_type = "dummy_processor_nested" + } + text_type_options {} + } + } + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-enum" + location = "us" + + property_definitions { + name = "prop6" + display_name = "propdisp6" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + enum_type_options { + possible_values = [ + "M", + "F", + "X" + ] + validation_check_disabled = false + } + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-date_time" + location = "us" + + property_definitions { + name = "prop7" + display_name = "propdisp7" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + date_time_type_options {} + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-map" + location = "us" + + property_definitions { + name = "prop4" + display_name = "propdisp4" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + map_type_options {} + } +} + +resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { + project_number = "406397197218" + display_name = "test-property-timestamp" + location = "us" + + property_definitions { + name = "prop5" + display_name = "propdisp5" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + timestamp_type_options {} + } +} + + + data "google_project" "project" { } \ No newline at end of file From d64675742fb14fbeba5aaf44690e26f068c111ab Mon Sep 17 00:00:00 2001 From: purvii Date: Mon, 24 Jul 2023 17:18:42 +0530 Subject: [PATCH 10/17] added DocumentSchema tests --- .../documentaiwarehouse/DocumentSchema.yaml | 84 ++++++++++++++++++- ...cument_ai_warehouse_document_schema.go.erb | 4 +- .../document_ai_warehouse_document.tf.erb | 2 - ..._ai_warehouse_document_schema_text.tf.erb} | 52 ++++++------ 4 files changed, 108 insertions(+), 34 deletions(-) delete mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb rename mmv1/templates/terraform/examples/{document_ai_warehouse_document_schema.tf.erb => document_ai_warehouse_document_schema_text.tf.erb} (87%) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 9d3228a0ef5f..a335f9a6c221 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -26,10 +26,10 @@ 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 - name: "document_ai_warehouse_document_schema" - primary_resource_id: "example" + name: "document_ai_warehouse_document_schema_text" + primary_resource_id: "example_text" vars: - document_schema_name: "schema-name" + document_schema_name: "schema-name-text" parameters: - !ruby/object:Api::Type::String name: 'project_number' @@ -51,6 +51,7 @@ properties: The resource name of the document schema. - !ruby/object:Api::Type::String name: 'displayName' + required: true description: | Name of the schema given by the user. - !ruby/object:Api::Type::Boolean @@ -65,6 +66,7 @@ properties: properties: - !ruby/object:Api::Type::String name: 'name' + required: true description: | The name of the metadata property. - !ruby/object:Api::Type::String @@ -224,6 +226,30 @@ properties: required: true 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::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: | @@ -236,6 +262,58 @@ properties: 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 + 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::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 - !ruby/object:Api::Type::NestedObject name: 'enumTypeOptions' description: | diff --git a/mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb b/mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb index 12792ad27fbd..f24c80976052 100644 --- a/mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb +++ b/mmv1/templates/terraform/custom_import/document_ai_warehouse_document_schema.go.erb @@ -1,13 +1,13 @@ config := meta.(*transport_tpg.Config) if err := tpgresource.ParseImportId([]string{ - "projects/(?P[^/]+)/locations/(?P[^/]+)/documentSchemas/(?P[^/]+)"}, d, config); err != nil { + "projects/(?P[^/]+)/locations/(?P[^/]+)/documentSchemas/(?P[^/]+)"}, d, config); err != nil { return nil, err } originalName := d.Get("name").(string) originalLocation := d.Get("location").(string) -originalProject := d.Get("project").(string) +originalProject := d.Get("project_number").(string) name := fmt.Sprintf("projects/%s/locations/%s/documentSchemas/%s", originalProject, originalLocation, originalName) if err := d.Set("name", name); err != nil { diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb deleted file mode 100644 index 181fb2293b5e..000000000000 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document.tf.erb +++ /dev/null @@ -1,2 +0,0 @@ -resource "google_document_ai_warehouse_document" "<%= ctx[:primary_resource_id] %>" { -} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb similarity index 87% rename from mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb rename to mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb index 1a1ab824e04a..d1baf56f740d 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb @@ -1,11 +1,12 @@ -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { - project_number = "406397197218" - display_name = "test-property-integer" - location = "us" +resource "google_document_ai_warehouse_document_schema" "example_text" { + project_number = "406397197218" + display_name = "test-property-text" + location = "us" + document_is_folder = false property_definitions { - name = "prop1" - display_name = "propdisp1" + name = "prop3" + display_name = "propdisp3" is_repeatable = false is_filterable = true is_searchable = true @@ -16,18 +17,18 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour name = "dummy_source" processor_type = "dummy_processor" } - integer_type_options {} + text_type_options {} } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_integer" { project_number = "406397197218" - display_name = "test-property-float" + display_name = "test-property-integer" location = "us" property_definitions { - name = "prop2" - display_name = "propdisp2" + name = "prop1" + display_name = "propdisp1" is_repeatable = false is_filterable = true is_searchable = true @@ -38,19 +39,18 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour name = "dummy_source" processor_type = "dummy_processor" } - float_type_options {} + integer_type_options {} } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { - project_number = "406397197218" - display_name = "test-property-text" - location = "us" - document_is_folder = false +resource "google_document_ai_warehouse_document_schema" "example_float" { + project_number = "406397197218" + display_name = "test-property-float" + location = "us" property_definitions { - name = "prop3" - display_name = "propdisp3" + name = "prop2" + display_name = "propdisp2" is_repeatable = false is_filterable = true is_searchable = true @@ -61,11 +61,11 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour name = "dummy_source" processor_type = "dummy_processor" } - text_type_options {} + float_type_options {} } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_property" { project_number = "406397197218" display_name = "test-property-property" location = "us" @@ -104,7 +104,7 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_enum" { project_number = "406397197218" display_name = "test-property-enum" location = "us" @@ -133,7 +133,7 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_datetime" { project_number = "406397197218" display_name = "test-property-date_time" location = "us" @@ -155,7 +155,7 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_map" { project_number = "406397197218" display_name = "test-property-map" location = "us" @@ -177,7 +177,7 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour } } -resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resource_id] %>" { +resource "google_document_ai_warehouse_document_schema" "example_timestamp" { project_number = "406397197218" display_name = "test-property-timestamp" location = "us" @@ -199,7 +199,5 @@ resource "google_document_ai_warehouse_document_schema" "<%= ctx[:primary_resour } } - - data "google_project" "project" { } \ No newline at end of file From ff96addb05989525cada0069524c7a3db66086b4 Mon Sep 17 00:00:00 2001 From: purvii Date: Mon, 24 Jul 2023 17:22:55 +0530 Subject: [PATCH 11/17] removed required field from processorType --- mmv1/products/documentaiwarehouse/DocumentSchema.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index a335f9a6c221..99138684642a 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -118,7 +118,6 @@ properties: The schema name in the source. - !ruby/object:Api::Type::String name: 'processorType' - required: true description: | The Doc AI processor type name. # select any one of the property types (integer, float, text, property, enum, dateTime, map, timestamp) From 7af4b68a92634f5e6bbed135f4350e889d74dad9 Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 25 Jul 2023 19:54:18 +0530 Subject: [PATCH 12/17] changed dummy_values --- .../documentaiwarehouse/DocumentSchema.yaml | 80 +------------------ .../documentaiwarehouse/Location.yaml | 1 + .../document_ai_warehouse_location.go | 56 ------------- ...t_ai_warehouse_document_schema_text.tf.erb | 16 ++-- 4 files changed, 10 insertions(+), 143 deletions(-) delete mode 100644 mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 99138684642a..93ea0187cc15 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -18,7 +18,7 @@ self_link: '{{name}}' delete_url: '{{name}}' references: !ruby/object:Api::Resource::ReferenceLinks guides: - 'Official Documentation': 'https://cloud.google.com/document-warehouse/docs/overview' + '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. @@ -71,7 +71,6 @@ properties: The name of the metadata property. - !ruby/object:Api::Type::String name: 'displayName' - required: true description: | The display-name for the property, used for front-end. - !ruby/object:Api::Type::Boolean @@ -105,7 +104,6 @@ properties: - :MEDIUM - :LOW - :LOWEST - default_value: :MEDIUM - !ruby/object:Api::Type::Array name: 'schemaSources' description: | @@ -225,30 +223,6 @@ properties: required: true 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::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: | @@ -261,58 +235,6 @@ properties: 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 - 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::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 - !ruby/object:Api::Type::NestedObject name: 'enumTypeOptions' description: | diff --git a/mmv1/products/documentaiwarehouse/Location.yaml b/mmv1/products/documentaiwarehouse/Location.yaml index 52299db7ec89..cbf1a999e150 100644 --- a/mmv1/products/documentaiwarehouse/Location.yaml +++ b/mmv1/products/documentaiwarehouse/Location.yaml @@ -20,6 +20,7 @@ references: !ruby/object:Api::Resource::ReferenceLinks api: 'https://cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations' description: | A location is used to initialize a project. +id_format: 'projects/{{project_number}}/locations/{{location}}' autogen_async: true async: !ruby/object:Api::OpAsync actions: ['create'] diff --git a/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go b/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go deleted file mode 100644 index e5119f0f0c1a..000000000000 --- a/mmv1/templates/terraform/custom_create/document_ai_warehouse_location.go +++ /dev/null @@ -1,56 +0,0 @@ -userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent) -if err != nil { - return err -} - -fmt.Println("dummy") -fmt.Println("UserAgent", userAgent) - -url, err := tpgresource.ReplaceVars(d, config, "{{DocumentAIWarehouseBasePath}}projects/{{project}}/locations/us:initialize") -if err != nil { - return err -} - -billingProject := "" - -project, err := tpgresource.GetProject(d, config) -if err != nil { - return fmt.Errorf("Error fetching project for Config: %s", err) -} -billingProject = project - -// err == nil indicates that the billing_project value was found -if bp, err := tpgresource.GetBillingProject(d, config); err == nil { - billingProject = bp -} - -res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ - Config: config, - Method: "POST", - Project: billingProject, - RawURL: url, - UserAgent: userAgent, - Timeout: d.Timeout(schema.TimeoutCreate), -}) -if err != nil { - return fmt.Errorf("Error in provisioning: %s", err) -} -if err := d.Set("name", flattenDocumentAIWarehouseLocationName(res["name"], d, config)); err != nil { - return fmt.Errorf(`Error setting computed identity field "name": %s`, err) -} - -// Store the ID now -id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/locations/us:initialize") -if err != nil { - return fmt.Errorf("Error constructing id: %s", err) -} -d.SetId(id) - -// Update the resource after initializing auth to set fields. -if err := resourceDocumentAIWarehouseLocationUpdate(d, meta); err != nil { - return err -} - -log.Printf("[DEBUG] Finished creating Config %q: %#v", d.Id(), res) - -return resourceDocumentAIWarehouseLocationRead(d, meta) diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb index d1baf56f740d..bdc7500aad78 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb @@ -1,5 +1,5 @@ resource "google_document_ai_warehouse_document_schema" "example_text" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-text" location = "us" document_is_folder = false @@ -22,7 +22,7 @@ resource "google_document_ai_warehouse_document_schema" "example_text" { } resource "google_document_ai_warehouse_document_schema" "example_integer" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-integer" location = "us" @@ -44,7 +44,7 @@ resource "google_document_ai_warehouse_document_schema" "example_integer" { } resource "google_document_ai_warehouse_document_schema" "example_float" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-float" location = "us" @@ -66,7 +66,7 @@ resource "google_document_ai_warehouse_document_schema" "example_float" { } resource "google_document_ai_warehouse_document_schema" "example_property" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-property" location = "us" document_is_folder = false @@ -105,7 +105,7 @@ resource "google_document_ai_warehouse_document_schema" "example_property" { } resource "google_document_ai_warehouse_document_schema" "example_enum" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-enum" location = "us" @@ -134,7 +134,7 @@ resource "google_document_ai_warehouse_document_schema" "example_enum" { } resource "google_document_ai_warehouse_document_schema" "example_datetime" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-date_time" location = "us" @@ -156,7 +156,7 @@ resource "google_document_ai_warehouse_document_schema" "example_datetime" { } resource "google_document_ai_warehouse_document_schema" "example_map" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-map" location = "us" @@ -178,7 +178,7 @@ resource "google_document_ai_warehouse_document_schema" "example_map" { } resource "google_document_ai_warehouse_document_schema" "example_timestamp" { - project_number = "406397197218" + project_number = data.google_project.project.number display_name = "test-property-timestamp" location = "us" From a83c90d5a299f3d76f9942edb99666a018e14f14 Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 25 Jul 2023 20:32:06 +0530 Subject: [PATCH 13/17] removed fields under properties --- .../documentaiwarehouse/DocumentSchema.yaml | 155 +++++++++++++----- 1 file changed, 113 insertions(+), 42 deletions(-) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 93ea0187cc15..5ba6addf619a 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -125,36 +125,21 @@ properties: 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 + properties: [] - !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 + 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::String - name: 'dummy' - description: | - Configurations for a text property. - send_empty_value: true + properties: [] - !ruby/object:Api::Type::NestedObject name: 'propertyTypeOptions' description: | @@ -223,18 +208,120 @@ properties: required: true description: | The Doc AI processor type name. + - !ruby/object:Api::Type::NestedObject + name: 'integerTypeOptions' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions + description: | + Integer property. + send_empty_value: true + allow_empty_object: true + properties: [] + - !ruby/object:Api::Type::NestedObject + name: 'floatTypeOptions' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions + description: | + Float property. + send_empty_value: true + allow_empty_object: true + properties: [] - !ruby/object:Api::Type::NestedObject name: 'textTypeOptions' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions description: | Text property. send_empty_value: true allow_empty_object: true + properties: [] + - !ruby/object:Api::Type::NestedObject + name: 'enumTypeOptions' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions + description: | + Enum/categorical property. + send_empty_value: true properties: - - !ruby/object:Api::Type::String - name: 'dummy' - description: | - Configurations for an text property. - send_empty_value: true + - !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' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions + 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' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - timestampTypeOptions + description: | + Map property. + send_empty_value: true + allow_empty_object: true + properties: [] + - !ruby/object:Api::Type::NestedObject + name: 'timestampTypeOptions' + exactly_one_of: + - integerTypeOptions + - floatTypeOptions + - textTypeOptions + - enumTypeOptions + - dateTimeTypeOptions + - mapTypeOptions + - 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: | @@ -257,35 +344,19 @@ properties: 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 + properties: [] - !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 + 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::String - name: 'dummy' - description: | - Configurations for a timestamp property. - send_empty_value: true - + properties: [] From 90538f13b8056d6c4687dcd1439bd60c06df8a55 Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 25 Jul 2023 21:49:00 +0530 Subject: [PATCH 14/17] added new line --- mmv1/products/documentaiwarehouse/product.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/documentaiwarehouse/product.yaml b/mmv1/products/documentaiwarehouse/product.yaml index 0a3d6158400d..5493a6660cb2 100644 --- a/mmv1/products/documentaiwarehouse/product.yaml +++ b/mmv1/products/documentaiwarehouse/product.yaml @@ -23,4 +23,4 @@ scopes: apis_required: - !ruby/object:Api::Product::ApiReference name: Document AI Warehouse API - url: https://console.cloud.google.com/apis/library/contentwarehouse.googleapis.com/ \ No newline at end of file + url: https://console.cloud.google.com/apis/library/contentwarehouse.googleapis.com/ From ec684fdfc6a2d20450b42d5e393d4a63796285c4 Mon Sep 17 00:00:00 2001 From: purvii Date: Tue, 25 Jul 2023 22:16:13 +0530 Subject: [PATCH 15/17] added enum tests --- ...t_ai_warehouse_document_schema_text.tf.erb | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb index bdc7500aad78..fd14d0e56041 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb @@ -104,6 +104,52 @@ resource "google_document_ai_warehouse_document_schema" "example_property" { } } +resource "google_document_ai_warehouse_document_schema" "example_property_enum" { + project_number = data.google_project.project.number + display_name = "test-property-property" + location = "us" + document_is_folder = false + + property_definitions { + name = "prop8" + display_name = "propdisp8" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + property_type_options { + property_definitions { + name = "prop8_nested" + display_name = "propdisp8_nested" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source_nested" + processor_type = "dummy_processor_nested" + } + enum_type_options { + possible_values = [ + "M", + "F", + "X" + ] + validation_check_disabled = false + } + } + } + } +} + resource "google_document_ai_warehouse_document_schema" "example_enum" { project_number = data.google_project.project.number display_name = "test-property-enum" From eca715964c713c6508b2580c6f3198fac8dbc91e Mon Sep 17 00:00:00 2001 From: purvii Date: Thu, 27 Jul 2023 20:01:24 +0530 Subject: [PATCH 16/17] separated tests into separate files --- .../documentaiwarehouse/DocumentSchema.yaml | 107 ++++----- ..._warehouse_document_schema_datetime.tf.erb | 24 ++ ...t_ai_warehouse_document_schema_enum.tf.erb | 31 +++ ..._ai_warehouse_document_schema_float.tf.erb | 23 ++ ...i_warehouse_document_schema_integer.tf.erb | 24 ++ ...nt_ai_warehouse_document_schema_map.tf.erb | 24 ++ ..._warehouse_document_schema_property.tf.erb | 41 ++++ ...house_document_schema_property_enum.tf.erb | 48 ++++ ...t_ai_warehouse_document_schema_text.tf.erb | 224 ------------------ ...warehouse_document_schema_timestamp.tf.erb | 24 ++ 10 files changed, 284 insertions(+), 286 deletions(-) create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_datetime.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_enum.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_float.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_integer.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_map.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property_enum.tf.erb create mode 100644 mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_timestamp.tf.erb diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 5ba6addf619a..2d5ea49fe9da 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -30,16 +30,58 @@ examples: 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' url_param_only: true required: true + immutable: true description: | The unique identifier of the project. - !ruby/object:Api::Type::String name: 'location' url_param_only: true + immutable: true required: true description: | The location of the resource. @@ -62,6 +104,7 @@ properties: 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 @@ -144,21 +187,21 @@ properties: name: 'propertyTypeOptions' description: | Nested structured data property. - send_empty_value: true properties: - !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 name: 'name' + required: true description: | The name of the metadata property. - !ruby/object:Api::Type::String name: 'displayName' - required: true description: | The display-name for the property, used for front-end. - !ruby/object:Api::Type::Boolean @@ -192,7 +235,6 @@ properties: - :MEDIUM - :LOW - :LOWEST - default_value: :MEDIUM - !ruby/object:Api::Type::Array name: 'schemaSources' description: | @@ -205,19 +247,10 @@ properties: The schema name in the source. - !ruby/object:Api::Type::String name: 'processorType' - required: true description: | The Doc AI processor type name. - !ruby/object:Api::Type::NestedObject name: 'integerTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Integer property. send_empty_value: true @@ -225,14 +258,6 @@ properties: properties: [] - !ruby/object:Api::Type::NestedObject name: 'floatTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Float property. send_empty_value: true @@ -240,14 +265,6 @@ properties: properties: [] - !ruby/object:Api::Type::NestedObject name: 'textTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Text property. send_empty_value: true @@ -255,17 +272,8 @@ properties: properties: [] - !ruby/object:Api::Type::NestedObject name: 'enumTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Enum/categorical property. - send_empty_value: true properties: - !ruby/object:Api::Type::Array name: 'possibleValues' @@ -279,14 +287,6 @@ properties: 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' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Date time property. Not supported by CMEK compliant deployment. send_empty_value: true @@ -294,14 +294,6 @@ properties: properties: [] - !ruby/object:Api::Type::NestedObject name: 'mapTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Map property. send_empty_value: true @@ -309,14 +301,6 @@ properties: properties: [] - !ruby/object:Api::Type::NestedObject name: 'timestampTypeOptions' - exactly_one_of: - - integerTypeOptions - - floatTypeOptions - - textTypeOptions - - enumTypeOptions - - dateTimeTypeOptions - - mapTypeOptions - - timestampTypeOptions description: | Timestamp property. Not supported by CMEK compliant deployment. send_empty_value: true @@ -326,7 +310,6 @@ properties: name: 'enumTypeOptions' description: | Enum/categorical property. - send_empty_value: true properties: - !ruby/object:Api::Type::Array name: 'possibleValues' diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_datetime.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_datetime.tf.erb new file mode 100644 index 000000000000..1e3e4f35b060 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_datetime.tf.erb @@ -0,0 +1,24 @@ +resource "google_document_ai_warehouse_document_schema" "example_datetime" { + project_number = data.google_project.project.number + display_name = "test-property-date_time" + location = "us" + + property_definitions { + name = "prop7" + display_name = "propdisp7" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + date_time_type_options {} + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_enum.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_enum.tf.erb new file mode 100644 index 000000000000..b763f2fad385 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_enum.tf.erb @@ -0,0 +1,31 @@ +resource "google_document_ai_warehouse_document_schema" "example_enum" { + project_number = data.google_project.project.number + display_name = "test-property-enum" + location = "us" + + property_definitions { + name = "prop6" + display_name = "propdisp6" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + enum_type_options { + possible_values = [ + "M", + "F", + "X" + ] + validation_check_disabled = false + } + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_float.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_float.tf.erb new file mode 100644 index 000000000000..96d30784152b --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_float.tf.erb @@ -0,0 +1,23 @@ +resource "google_document_ai_warehouse_document_schema" "example_float" { + project_number = data.google_project.project.number + display_name = "test-property-float" + location = "us" + + property_definitions { + name = "prop2" + display_name = "propdisp2" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + float_type_options {} + } +} +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_integer.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_integer.tf.erb new file mode 100644 index 000000000000..9c0ef30e6b4f --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_integer.tf.erb @@ -0,0 +1,24 @@ +resource "google_document_ai_warehouse_document_schema" "example_integer" { + project_number = data.google_project.project.number + display_name = "test-property-integer" + location = "us" + + property_definitions { + name = "prop1" + display_name = "propdisp1" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + integer_type_options {} + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_map.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_map.tf.erb new file mode 100644 index 000000000000..11796b01b0e8 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_map.tf.erb @@ -0,0 +1,24 @@ +resource "google_document_ai_warehouse_document_schema" "example_map" { + project_number = data.google_project.project.number + display_name = "test-property-map" + location = "us" + + property_definitions { + name = "prop4" + display_name = "propdisp4" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + map_type_options {} + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property.tf.erb new file mode 100644 index 000000000000..bd0ba6ee0976 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property.tf.erb @@ -0,0 +1,41 @@ +resource "google_document_ai_warehouse_document_schema" "example_property" { + project_number = data.google_project.project.number + display_name = "test-property-property" + location = "us" + document_is_folder = false + + property_definitions { + name = "prop8" + display_name = "propdisp8" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + property_type_options { + property_definitions { + name = "prop8_nested" + display_name = "propdisp8_nested" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source_nested" + processor_type = "dummy_processor_nested" + } + text_type_options {} + } + } + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property_enum.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property_enum.tf.erb new file mode 100644 index 000000000000..19eb0553b6c7 --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_property_enum.tf.erb @@ -0,0 +1,48 @@ +resource "google_document_ai_warehouse_document_schema" "example_property_enum" { + project_number = data.google_project.project.number + display_name = "test-property-property" + location = "us" + document_is_folder = false + + property_definitions { + name = "prop8" + display_name = "propdisp8" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + property_type_options { + property_definitions { + name = "prop8_nested" + display_name = "propdisp8_nested" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source_nested" + processor_type = "dummy_processor_nested" + } + enum_type_options { + possible_values = [ + "M", + "F", + "X" + ] + validation_check_disabled = false + } + } + } + } +} + +data "google_project" "project" { +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb index fd14d0e56041..d7f797fbe114 100644 --- a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_text.tf.erb @@ -21,229 +21,5 @@ resource "google_document_ai_warehouse_document_schema" "example_text" { } } -resource "google_document_ai_warehouse_document_schema" "example_integer" { - project_number = data.google_project.project.number - display_name = "test-property-integer" - location = "us" - - property_definitions { - name = "prop1" - display_name = "propdisp1" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - integer_type_options {} - } -} - -resource "google_document_ai_warehouse_document_schema" "example_float" { - project_number = data.google_project.project.number - display_name = "test-property-float" - location = "us" - - property_definitions { - name = "prop2" - display_name = "propdisp2" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - float_type_options {} - } -} - -resource "google_document_ai_warehouse_document_schema" "example_property" { - project_number = data.google_project.project.number - display_name = "test-property-property" - location = "us" - document_is_folder = false - - property_definitions { - name = "prop8" - display_name = "propdisp8" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - property_type_options { - property_definitions { - name = "prop8_nested" - display_name = "propdisp8_nested" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source_nested" - processor_type = "dummy_processor_nested" - } - text_type_options {} - } - } - } -} - -resource "google_document_ai_warehouse_document_schema" "example_property_enum" { - project_number = data.google_project.project.number - display_name = "test-property-property" - location = "us" - document_is_folder = false - - property_definitions { - name = "prop8" - display_name = "propdisp8" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - property_type_options { - property_definitions { - name = "prop8_nested" - display_name = "propdisp8_nested" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source_nested" - processor_type = "dummy_processor_nested" - } - enum_type_options { - possible_values = [ - "M", - "F", - "X" - ] - validation_check_disabled = false - } - } - } - } -} - -resource "google_document_ai_warehouse_document_schema" "example_enum" { - project_number = data.google_project.project.number - display_name = "test-property-enum" - location = "us" - - property_definitions { - name = "prop6" - display_name = "propdisp6" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - enum_type_options { - possible_values = [ - "M", - "F", - "X" - ] - validation_check_disabled = false - } - } -} - -resource "google_document_ai_warehouse_document_schema" "example_datetime" { - project_number = data.google_project.project.number - display_name = "test-property-date_time" - location = "us" - - property_definitions { - name = "prop7" - display_name = "propdisp7" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - date_time_type_options {} - } -} - -resource "google_document_ai_warehouse_document_schema" "example_map" { - project_number = data.google_project.project.number - display_name = "test-property-map" - location = "us" - - property_definitions { - name = "prop4" - display_name = "propdisp4" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - map_type_options {} - } -} - -resource "google_document_ai_warehouse_document_schema" "example_timestamp" { - project_number = data.google_project.project.number - display_name = "test-property-timestamp" - location = "us" - - property_definitions { - name = "prop5" - display_name = "propdisp5" - is_repeatable = false - is_filterable = true - is_searchable = true - is_metadata = false - is_required = false - retrieval_importance = "HIGHEST" - schema_sources { - name = "dummy_source" - processor_type = "dummy_processor" - } - timestamp_type_options {} - } -} - data "google_project" "project" { } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_timestamp.tf.erb b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_timestamp.tf.erb new file mode 100644 index 000000000000..417d81fe70fa --- /dev/null +++ b/mmv1/templates/terraform/examples/document_ai_warehouse_document_schema_timestamp.tf.erb @@ -0,0 +1,24 @@ +resource "google_document_ai_warehouse_document_schema" "example_timestamp" { + project_number = data.google_project.project.number + display_name = "test-property-timestamp" + location = "us" + + property_definitions { + name = "prop5" + display_name = "propdisp5" + is_repeatable = false + is_filterable = true + is_searchable = true + is_metadata = false + is_required = false + retrieval_importance = "HIGHEST" + schema_sources { + name = "dummy_source" + processor_type = "dummy_processor" + } + timestamp_type_options {} + } +} + +data "google_project" "project" { +} \ No newline at end of file From 4b8c3399896960f0d1c5252bc3dd0268338016e2 Mon Sep 17 00:00:00 2001 From: purvii Date: Fri, 28 Jul 2023 10:02:19 +0530 Subject: [PATCH 17/17] made Document Schema immutable --- mmv1/products/documentaiwarehouse/DocumentSchema.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml index 2d5ea49fe9da..9c8746f6b72e 100644 --- a/mmv1/products/documentaiwarehouse/DocumentSchema.yaml +++ b/mmv1/products/documentaiwarehouse/DocumentSchema.yaml @@ -16,6 +16,7 @@ name: 'DocumentSchema' 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'