Skip to content

Commit

Permalink
Merge pull request #3636 from hashicorp/f/extending-botservice-workar…
Browse files Browse the repository at this point in the history
…ound

tools/importer-rest-api-specs: extending the workaround for Azure/azure-rest-api-specs#27351 to account for the constant being incorrectly defined
  • Loading branch information
tombuildsstuff authored Jan 17, 2024
2 parents bffd8b0 + 3bd283e commit 9ccc427
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
"github.com/hashicorp/pandora/tools/sdk/resourcemanager"
)

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

// ensure the Constant `EmailChannelAuthMethod` is updated to be an Integer rather than a Float
constant, ok := resource.Constants["EmailChannelAuthMethod"]
if !ok {
return nil, fmt.Errorf("expected a Constant named `EmailChannelAuthMethod` but didn't get one")
}
constant.Type = resourcemanager.IntegerConstant
resource.Constants["EmailChannelAuthMethod"] = constant

output.Resources["Channel"] = resource

return &output, nil
Expand Down

0 comments on commit 9ccc427

Please sign in to comment.