aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
68 stars 13 forks source link

TypeScript types for SQS client could be improved #557

Closed kibertoad closed 8 months ago

kibertoad commented 1 year ago

Describe the feature

See https://github.com/aws/aws-sdk-js-v3/blob/6c8730a9646e324cc2c01b6e86df974a9f39fc64/clients/client-sqs/src/models/models_0.ts#L719

Attributes are defined simply as Attributes?: Record<string, string>;, without any type-safety. Supported options are only listed in documentation.

Use Case

When project that relies on SQS client is using TypeScript, it is very helpful to have compilation time type-safety, so that compilation will fail, if unsupported parameter is passed. Otherwise this error will only be caught in the runtime, which may be too late.

Proposed Solution

Provide stronger types in /clients/client-sqs/src/models/models_0.ts

Other Information

No response

Acknowledgements

SDK version used

3.357.0

Environment details (OS name and version, etc.)

Windows 11

yenfryherrerafeliz commented 1 year ago

Hi @kibertoad, thanks for opening this feature request. I understand the value for this, but since this file is auto generated from the service model itself I have to relay this feature request to them so they can have it in consideration. I will post the ticket id here once is done.

Thanks!

yenfryherrerafeliz commented 1 year ago

V944691875

yenfryherrerafeliz commented 8 months ago

Hi @kibertoad, this feature has been implemented by the service now. You can confirm it here where attributes expect that the key for the record type provide to be one of the following options defined for QueueAttributeName type here.

Thanks!

github-actions[bot] commented 8 months ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

kibertoad commented 8 months ago

@yenfryherrerafeliz Thanks a lot for addressing this! I've also opened a symmetric entry for SNS, as it has the same problem now (even in the latest version) - https://github.com/aws/aws-sdk/issues/626