Skip to content

Commit 9ccc427

Browse files
Merge pull request #3636 from hashicorp/f/extending-botservice-workaround
tools/importer-rest-api-specs: extending the workaround for Azure/azure-rest-api-specs#27351 to account for the constant being incorrectly defined
2 parents bffd8b0 + 3bd283e commit 9ccc427

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/importer-rest-api-specs/components/parser/dataworkarounds/workaround_botservice_27351.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/hashicorp/go-azure-helpers/lang/pointer"
77
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
8+
"github.com/hashicorp/pandora/tools/sdk/resourcemanager"
89
)
910

1011
var _ workaround = workaroundBotService27351{}
@@ -66,6 +67,14 @@ func (workaroundBotService27351) Process(input models.AzureApiDefinition) (*mode
6667
resource.Operations[operationName] = operation
6768
}
6869

70+
// ensure the Constant `EmailChannelAuthMethod` is updated to be an Integer rather than a Float
71+
constant, ok := resource.Constants["EmailChannelAuthMethod"]
72+
if !ok {
73+
return nil, fmt.Errorf("expected a Constant named `EmailChannelAuthMethod` but didn't get one")
74+
}
75+
constant.Type = resourcemanager.IntegerConstant
76+
resource.Constants["EmailChannelAuthMethod"] = constant
77+
6978
output.Resources["Channel"] = resource
7079

7180
return &output, nil

0 commit comments

Comments
 (0)