Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

adding location and doc schema #15326

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changelog/8371.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_document_ai_warehouse_document_schema`
```
```release-note:new-resource
`google_document_ai_warehouse_location`
```
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var services = mapOf(
"dialogflowcx" to "Dialogflowcx",
"dns" to "Dns",
"documentai" to "Documentai",
"documentaiwarehouse" to "Documentaiwarehouse",
"essentialcontacts" to "Essentialcontacts",
"eventarc" to "Eventarc",
"filestore" to "Filestore",
Expand Down
1 change: 1 addition & 0 deletions google/config_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func configureTestBasePaths(c *transport_tpg.Config, url string) {
c.DialogflowCXBasePath = url
c.DNSBasePath = url
c.DocumentAIBasePath = url
c.DocumentAIWarehouseBasePath = url
c.EssentialContactsBasePath = url
c.FilestoreBasePath = url
c.FirestoreBasePath = url
Expand Down
1 change: 1 addition & 0 deletions google/fwmodels/provider_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type ProviderModel struct {
DialogflowCXCustomEndpoint types.String `tfsdk:"dialogflow_cx_custom_endpoint"`
DNSCustomEndpoint types.String `tfsdk:"dns_custom_endpoint"`
DocumentAICustomEndpoint types.String `tfsdk:"document_ai_custom_endpoint"`
DocumentAIWarehouseCustomEndpoint types.String `tfsdk:"document_ai_warehouse_custom_endpoint"`
EssentialContactsCustomEndpoint types.String `tfsdk:"essential_contacts_custom_endpoint"`
FilestoreCustomEndpoint types.String `tfsdk:"filestore_custom_endpoint"`
FirestoreCustomEndpoint types.String `tfsdk:"firestore_custom_endpoint"`
Expand Down
6 changes: 6 additions & 0 deletions google/fwprovider/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"document_ai_warehouse_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"essential_contacts_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
Expand Down
10 changes: 10 additions & 0 deletions google/fwtransport/framework_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type FrameworkProviderConfig struct {
DialogflowCXBasePath string
DNSBasePath string
DocumentAIBasePath string
DocumentAIWarehouseBasePath string
EssentialContactsBasePath string
FilestoreBasePath string
FirestoreBasePath string
Expand Down Expand Up @@ -230,6 +231,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.DialogflowCXBasePath = data.DialogflowCXCustomEndpoint.ValueString()
p.DNSBasePath = data.DNSCustomEndpoint.ValueString()
p.DocumentAIBasePath = data.DocumentAICustomEndpoint.ValueString()
p.DocumentAIWarehouseBasePath = data.DocumentAIWarehouseCustomEndpoint.ValueString()
p.EssentialContactsBasePath = data.EssentialContactsCustomEndpoint.ValueString()
p.FilestoreBasePath = data.FilestoreCustomEndpoint.ValueString()
p.FirestoreBasePath = data.FirestoreCustomEndpoint.ValueString()
Expand Down Expand Up @@ -773,6 +775,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.DocumentAICustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.DocumentAIWarehouseCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_DOCUMENT_AI_WAREHOUSE_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.DocumentAIWarehouseBasePathKey])
if customEndpoint != nil {
data.DocumentAIWarehouseCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.EssentialContactsCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_ESSENTIAL_CONTACTS_CUSTOM_ENDPOINT",
Expand Down
1 change: 1 addition & 0 deletions google/gcp_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
_ "github.com/hashicorp/terraform-provider-google/google/services/dialogflowcx"
_ "github.com/hashicorp/terraform-provider-google/google/services/dns"
_ "github.com/hashicorp/terraform-provider-google/google/services/documentai"
_ "github.com/hashicorp/terraform-provider-google/google/services/documentaiwarehouse"
_ "github.com/hashicorp/terraform-provider-google/google/services/essentialcontacts"
_ "github.com/hashicorp/terraform-provider-google/google/services/filestore"
_ "github.com/hashicorp/terraform-provider-google/google/services/firestore"
Expand Down
13 changes: 11 additions & 2 deletions google/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
"github.com/hashicorp/terraform-provider-google/google/services/dialogflowcx"
"github.com/hashicorp/terraform-provider-google/google/services/dns"
"github.com/hashicorp/terraform-provider-google/google/services/documentai"
"github.com/hashicorp/terraform-provider-google/google/services/documentaiwarehouse"
"github.com/hashicorp/terraform-provider-google/google/services/essentialcontacts"
"github.com/hashicorp/terraform-provider-google/google/services/filestore"
"github.com/hashicorp/terraform-provider-google/google/services/firestore"
Expand Down Expand Up @@ -453,6 +454,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"document_ai_warehouse_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"essential_contacts_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -947,9 +953,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
})
}

// Generated resources: 303
// Generated resources: 305
// Generated IAM resources: 204
// Total generated resources: 507
// Total generated resources: 509
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1259,6 +1265,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_dns_response_policy_rule": dns.ResourceDNSResponsePolicyRule(),
"google_document_ai_processor": documentai.ResourceDocumentAIProcessor(),
"google_document_ai_processor_default_version": documentai.ResourceDocumentAIProcessorDefaultVersion(),
"google_document_ai_warehouse_document_schema": documentaiwarehouse.ResourceDocumentAIWarehouseDocumentSchema(),
"google_document_ai_warehouse_location": documentaiwarehouse.ResourceDocumentAIWarehouseLocation(),
"google_essential_contacts_contact": essentialcontacts.ResourceEssentialContactsContact(),
"google_filestore_backup": filestore.ResourceFilestoreBackup(),
"google_filestore_instance": filestore.ResourceFilestoreInstance(),
Expand Down Expand Up @@ -1736,6 +1744,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.DialogflowCXBasePath = d.Get("dialogflow_cx_custom_endpoint").(string)
config.DNSBasePath = d.Get("dns_custom_endpoint").(string)
config.DocumentAIBasePath = d.Get("document_ai_custom_endpoint").(string)
config.DocumentAIWarehouseBasePath = d.Get("document_ai_warehouse_custom_endpoint").(string)
config.EssentialContactsBasePath = d.Get("essential_contacts_custom_endpoint").(string)
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
config.FirestoreBasePath = d.Get("firestore_custom_endpoint").(string)
Expand Down
Loading