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

Feature Request: Expose a method of obtaining all Enum values #783

Closed
tombuildsstuff opened this issue Sep 26, 2017 · 2 comments
Closed
Assignees

Comments

@tombuildsstuff
Copy link
Contributor

👋

As mentioned in this issue - we make use of the Enum's provided by the Azure SDK for Go for validation purposes - by listing each value in the Enum into our validation function:

https://github.com/terraform-providers/terraform-provider-azurerm/blob/766261fa228fca0e2b3e1928346c95d86cd85946/azurerm/resource_arm_app_service.go#L213-L224

Whilst this works great - it means we're listing these constants out, and with the SDK being auto-generated - we're having to review each Model every time we upgrade to determine if any new Constants have been added. As such - I'm wondering if it'd make sense to expose a method of obtaining all of these values, pseudo code below:

types := web.AvailableConnectionStringTypes() # which returns [ web.APIHub, web.Custom ] (etc)

That would allow consumers to iterate over these as needed - in our case as a Validation function - but other consumers could use it for picking options dynamically from a CLI (for example). What do you think? :)

Thanks!

@jhendrixMSFT
Copy link
Member

The updated generator with support for this is 2.1.88.

@jhendrixMSFT
Copy link
Member

@ghost ghost removed the fix-available label Mar 27, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants