Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
fix documentai so eu region is supported (#6229) (#836)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 11, 2022
1 parent 281801d commit e1528e9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion converters/google/resources/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ var DefaultBasePaths = map[string]string{
DialogflowBasePathKey: "https://dialogflow.googleapis.com/v2/",
DialogflowCXBasePathKey: "https://{{location}}-dialogflow.googleapis.com/v3/",
DNSBasePathKey: "https://dns.googleapis.com/dns/v1/",
DocumentAIBasePathKey: "https://documentai.googleapis.com/v1/",
DocumentAIBasePathKey: "https://{{location}}-documentai.googleapis.com/v1/",
EssentialContactsBasePathKey: "https://essentialcontacts.googleapis.com/v1/",
FilestoreBasePathKey: "https://file.googleapis.com/v1/",
FirestoreBasePathKey: "https://firestore.googleapis.com/v1/",
Expand Down
6 changes: 3 additions & 3 deletions converters/google/resources/documentai_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package google

import "reflect"

const DocumentAIProcessorAssetType string = "documentai.googleapis.com/Processor"
const DocumentAIProcessorAssetType string = "{{location}}-documentai.googleapis.com/Processor"

func resourceConverterDocumentAIProcessor() ResourceConverter {
return ResourceConverter{
Expand All @@ -26,7 +26,7 @@ func resourceConverterDocumentAIProcessor() ResourceConverter {
}

func GetDocumentAIProcessorCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
name, err := assetName(d, config, "//documentai.googleapis.com/{{name}}")
name, err := assetName(d, config, "//{{location}}-documentai.googleapis.com/projects/{{project}}/locations/{{location}}/processors/{{name}}")
if err != nil {
return []Asset{}, err
}
Expand All @@ -36,7 +36,7 @@ func GetDocumentAIProcessorCaiObject(d TerraformResourceData, config *Config) ([
Type: DocumentAIProcessorAssetType,
Resource: &AssetResource{
Version: "v1",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/documentai/v1/rest",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/{{location}}-documentai/v1/rest",
DiscoveryName: "Processor",
Data: obj,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package google

import "reflect"

const DocumentAIProcessorDefaultVersionAssetType string = "documentai.googleapis.com/ProcessorDefaultVersion"
const DocumentAIProcessorDefaultVersionAssetType string = "{{location}}-documentai.googleapis.com/ProcessorDefaultVersion"

func resourceConverterDocumentAIProcessorDefaultVersion() ResourceConverter {
return ResourceConverter{
Expand All @@ -26,7 +26,7 @@ func resourceConverterDocumentAIProcessorDefaultVersion() ResourceConverter {
}

func GetDocumentAIProcessorDefaultVersionCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
name, err := assetName(d, config, "//documentai.googleapis.com/{{processor}}")
name, err := assetName(d, config, "//{{location}}-documentai.googleapis.com/{{processor}}")
if err != nil {
return []Asset{}, err
}
Expand All @@ -36,7 +36,7 @@ func GetDocumentAIProcessorDefaultVersionCaiObject(d TerraformResourceData, conf
Type: DocumentAIProcessorDefaultVersionAssetType,
Resource: &AssetResource{
Version: "v1",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/documentai/v1/rest",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/{{location}}-documentai/v1/rest",
DiscoveryName: "ProcessorDefaultVersion",
Data: obj,
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/terraform-json v0.14.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.18.0
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711163803-490b3064b4c5
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711174116-c53d3225d484
github.com/kr/pretty v0.3.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/onsi/gomega v1.17.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ github.com/hashicorp/terraform-plugin-log v0.4.1 h1:xpbmVhvuU3mgHzLetOmx9pkOL2rm
github.com/hashicorp/terraform-plugin-log v0.4.1/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.18.0 h1:/cdI5di5XA+N80gXzXF4YcHq36DprBskubk6Z8i26ZQ=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.18.0/go.mod h1:L3SHkD/Q8zPVgXviQmpVwy9nKwpXXZscVIpVEnQ/T50=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711163803-490b3064b4c5 h1:BNtUhX4uoEdEth/ljJZR0UiHdnHGo71W1plftt3uT+A=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711163803-490b3064b4c5/go.mod h1:X9YycW7SpGYrJh/i/FGyvUOpl0/GlnxjbV7lYMKXRk0=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711174116-c53d3225d484 h1:T0NndxUVSz9SrUhIH1iqLnlAWtXIFI/3D/QPXF07bUc=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20220711174116-c53d3225d484/go.mod h1:X9YycW7SpGYrJh/i/FGyvUOpl0/GlnxjbV7lYMKXRk0=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down

0 comments on commit e1528e9

Please sign in to comment.