You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under service/redshift/types.go, for struct Cluster and member ClusterStatus. Add a constants and a array lookup for all the possible values, instead of just writing them in documentation.
Use Case
When writing a go program to check the status of Redshift clusters, I don't like that I need to hardcode the values that come back from the go sdk. I'd rather reference constants provided by the sdk.
Proposed Solution
I believe the solution should involve making these values constants. There may be more refactor, but I haven't looked too far. I wanted to get this issue up first.
Below is a proposal of changes to service/redshift/types/types.go
Note: The proposal only uses two possible values (available, and cancelling-resize), but their are others
// Enum values for ReservedNodeOfferingTypeconst (
ClusterClusterStatusTypeAvailableClusterClusterStatusType="available"ClusterClusterStatusTypeCancellingResizeClusterClusterStatusType="cancelling-resize"
)
// Values returns all known values for ClusterClusterStatusType. Note that this// can be expanded in the future, and so it is only as up to date as the client.//// The ordering of this slice is not guaranteed to be stable across updates.func (ClusterClusterStatusType) Values() []ClusterClusterStatusType {
return []ClusterClusterStatusType{
"available",
"cancelling-resize",
}
}
gogingersnap777
changed the title
Add public constants values from Redshift Cluster - ClusterStatus
Add public constant values for Redshift Cluster - ClusterStatus
May 17, 2024
Thanks for reaching out.
Unfortunately the SDK team cannot change the data type for any of the APIs. All of the AWS SDKs are code-generated from the model of each AWS service. In this case, the Redshift API is modeled with ClusterStatus as a string rather than an enum, and while I agree that it makes sense to model this as an enum (similar to other status fields that are modeled as enum), a change to a more restrictive type would be considered a backwards incompatible / breaking change from an API perspective so we are unable to upstream your request.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Describe the feature
Under
service/redshift/types.go
, for structCluster
and memberClusterStatus
. Add a constants and a array lookup for all the possible values, instead of just writing them in documentation.Use Case
When writing a go program to check the status of Redshift clusters, I don't like that I need to hardcode the values that come back from the go sdk. I'd rather reference constants provided by the sdk.
Proposed Solution
I believe the solution should involve making these values constants. There may be more refactor, but I haven't looked too far. I wanted to get this issue up first.
Below is a proposal of changes to
service/redshift/types/types.go
Note: The proposal only uses two possible values (available, and cancelling-resize), but their are others
Other Information
Reference to docs with ClusterStatus values - https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#Cluster
Acknowledgements
AWS Go SDK V2 Module Versions Used
module example
go 1.22.3
require (
github.com/aws/aws-sdk-go-v2/config v1.27.15
github.com/aws/aws-sdk-go-v2/service/redshift v1.44.3
)
require (
github.com/aws/aws-sdk-go-v2 v1.27.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.15 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.9 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
)
Go version used
go version go1.22.3 darwin/amd64
The text was updated successfully, but these errors were encountered: