Skip to content

Commit 9374042

Browse files
adding location and doc schema (#8371) (#15326)
* adding location and doc schema * added copyright * resolved required field, url_param_only field, description, autogen_async, async in Location * resolved required field, url_param_only field, description, autogen_async, async in Location * resolved hardcoded location, few fields in location, removed unnecessary enum values * resolved project_number, added fields in location example * DocumentSchema final changes * added timeouts in Location * adding missing fields from test report * added DocumentSchema tests * removed required field from processorType * changed dummy_values * removed fields under properties * added new line * added enum tests * separated tests into separate files * made Document Schema immutable Signed-off-by: Modular Magician <[email protected]>
1 parent c649ca8 commit 9374042

17 files changed

+3523
-2
lines changed

.changelog/8371.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:new-resource
2+
`google_document_ai_warehouse_document_schema`
3+
```
4+
```release-note:new-resource
5+
`google_document_ai_warehouse_location`
6+
```

.teamcity/components/generated/services.kt

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ var services = mapOf(
5656
"dialogflowcx" to "Dialogflowcx",
5757
"dns" to "Dns",
5858
"documentai" to "Documentai",
59+
"documentaiwarehouse" to "Documentaiwarehouse",
5960
"essentialcontacts" to "Essentialcontacts",
6061
"eventarc" to "Eventarc",
6162
"filestore" to "Filestore",

google/config_test_utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func configureTestBasePaths(c *transport_tpg.Config, url string) {
7070
c.DialogflowCXBasePath = url
7171
c.DNSBasePath = url
7272
c.DocumentAIBasePath = url
73+
c.DocumentAIWarehouseBasePath = url
7374
c.EssentialContactsBasePath = url
7475
c.FilestoreBasePath = url
7576
c.FirestoreBasePath = url

google/fwmodels/provider_model.go

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type ProviderModel struct {
7171
DialogflowCXCustomEndpoint types.String `tfsdk:"dialogflow_cx_custom_endpoint"`
7272
DNSCustomEndpoint types.String `tfsdk:"dns_custom_endpoint"`
7373
DocumentAICustomEndpoint types.String `tfsdk:"document_ai_custom_endpoint"`
74+
DocumentAIWarehouseCustomEndpoint types.String `tfsdk:"document_ai_warehouse_custom_endpoint"`
7475
EssentialContactsCustomEndpoint types.String `tfsdk:"essential_contacts_custom_endpoint"`
7576
FilestoreCustomEndpoint types.String `tfsdk:"filestore_custom_endpoint"`
7677
FirestoreCustomEndpoint types.String `tfsdk:"firestore_custom_endpoint"`

google/fwprovider/framework_provider.go

+6
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
395395
transport_tpg.CustomEndpointValidator(),
396396
},
397397
},
398+
"document_ai_warehouse_custom_endpoint": &schema.StringAttribute{
399+
Optional: true,
400+
Validators: []validator.String{
401+
transport_tpg.CustomEndpointValidator(),
402+
},
403+
},
398404
"essential_contacts_custom_endpoint": &schema.StringAttribute{
399405
Optional: true,
400406
Validators: []validator.String{

google/fwtransport/framework_config.go

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ type FrameworkProviderConfig struct {
9595
DialogflowCXBasePath string
9696
DNSBasePath string
9797
DocumentAIBasePath string
98+
DocumentAIWarehouseBasePath string
9899
EssentialContactsBasePath string
99100
FilestoreBasePath string
100101
FirestoreBasePath string
@@ -230,6 +231,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
230231
p.DialogflowCXBasePath = data.DialogflowCXCustomEndpoint.ValueString()
231232
p.DNSBasePath = data.DNSCustomEndpoint.ValueString()
232233
p.DocumentAIBasePath = data.DocumentAICustomEndpoint.ValueString()
234+
p.DocumentAIWarehouseBasePath = data.DocumentAIWarehouseCustomEndpoint.ValueString()
233235
p.EssentialContactsBasePath = data.EssentialContactsCustomEndpoint.ValueString()
234236
p.FilestoreBasePath = data.FilestoreCustomEndpoint.ValueString()
235237
p.FirestoreBasePath = data.FirestoreCustomEndpoint.ValueString()
@@ -773,6 +775,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
773775
data.DocumentAICustomEndpoint = types.StringValue(customEndpoint.(string))
774776
}
775777
}
778+
if data.DocumentAIWarehouseCustomEndpoint.IsNull() {
779+
customEndpoint := transport_tpg.MultiEnvDefault([]string{
780+
"GOOGLE_DOCUMENT_AI_WAREHOUSE_CUSTOM_ENDPOINT",
781+
}, transport_tpg.DefaultBasePaths[transport_tpg.DocumentAIWarehouseBasePathKey])
782+
if customEndpoint != nil {
783+
data.DocumentAIWarehouseCustomEndpoint = types.StringValue(customEndpoint.(string))
784+
}
785+
}
776786
if data.EssentialContactsCustomEndpoint.IsNull() {
777787
customEndpoint := transport_tpg.MultiEnvDefault([]string{
778788
"GOOGLE_ESSENTIAL_CONTACTS_CUSTOM_ENDPOINT",

google/gcp_sweeper_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import (
5454
_ "github.com/hashicorp/terraform-provider-google/google/services/dialogflowcx"
5555
_ "github.com/hashicorp/terraform-provider-google/google/services/dns"
5656
_ "github.com/hashicorp/terraform-provider-google/google/services/documentai"
57+
_ "github.com/hashicorp/terraform-provider-google/google/services/documentaiwarehouse"
5758
_ "github.com/hashicorp/terraform-provider-google/google/services/essentialcontacts"
5859
_ "github.com/hashicorp/terraform-provider-google/google/services/filestore"
5960
_ "github.com/hashicorp/terraform-provider-google/google/services/firestore"

google/provider/provider.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import (
5959
"github.com/hashicorp/terraform-provider-google/google/services/dialogflowcx"
6060
"github.com/hashicorp/terraform-provider-google/google/services/dns"
6161
"github.com/hashicorp/terraform-provider-google/google/services/documentai"
62+
"github.com/hashicorp/terraform-provider-google/google/services/documentaiwarehouse"
6263
"github.com/hashicorp/terraform-provider-google/google/services/essentialcontacts"
6364
"github.com/hashicorp/terraform-provider-google/google/services/filestore"
6465
"github.com/hashicorp/terraform-provider-google/google/services/firestore"
@@ -453,6 +454,11 @@ func Provider() *schema.Provider {
453454
Optional: true,
454455
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
455456
},
457+
"document_ai_warehouse_custom_endpoint": {
458+
Type: schema.TypeString,
459+
Optional: true,
460+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
461+
},
456462
"essential_contacts_custom_endpoint": {
457463
Type: schema.TypeString,
458464
Optional: true,
@@ -947,9 +953,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
947953
})
948954
}
949955

950-
// Generated resources: 303
956+
// Generated resources: 305
951957
// Generated IAM resources: 204
952-
// Total generated resources: 507
958+
// Total generated resources: 509
953959
func ResourceMap() map[string]*schema.Resource {
954960
resourceMap, _ := ResourceMapWithErrors()
955961
return resourceMap
@@ -1259,6 +1265,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
12591265
"google_dns_response_policy_rule": dns.ResourceDNSResponsePolicyRule(),
12601266
"google_document_ai_processor": documentai.ResourceDocumentAIProcessor(),
12611267
"google_document_ai_processor_default_version": documentai.ResourceDocumentAIProcessorDefaultVersion(),
1268+
"google_document_ai_warehouse_document_schema": documentaiwarehouse.ResourceDocumentAIWarehouseDocumentSchema(),
1269+
"google_document_ai_warehouse_location": documentaiwarehouse.ResourceDocumentAIWarehouseLocation(),
12621270
"google_essential_contacts_contact": essentialcontacts.ResourceEssentialContactsContact(),
12631271
"google_filestore_backup": filestore.ResourceFilestoreBackup(),
12641272
"google_filestore_instance": filestore.ResourceFilestoreInstance(),
@@ -1736,6 +1744,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
17361744
config.DialogflowCXBasePath = d.Get("dialogflow_cx_custom_endpoint").(string)
17371745
config.DNSBasePath = d.Get("dns_custom_endpoint").(string)
17381746
config.DocumentAIBasePath = d.Get("document_ai_custom_endpoint").(string)
1747+
config.DocumentAIWarehouseBasePath = d.Get("document_ai_warehouse_custom_endpoint").(string)
17391748
config.EssentialContactsBasePath = d.Get("essential_contacts_custom_endpoint").(string)
17401749
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
17411750
config.FirestoreBasePath = d.Get("firestore_custom_endpoint").(string)

0 commit comments

Comments
 (0)