aws / aws-sdk

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

TypeScript types for SNS client could be improved #626

Open kibertoad opened 8 months ago

kibertoad commented 8 months ago

This is the equivalent of https://github.com/aws/aws-sdk/issues/557 for the SNS

Describe the feature

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

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 SNS 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-sns/src/models/models_0.ts

Likely same solution that was used for SQS could be reused here (I assume these are autogenerated types as well).

Acknowledgements

SDK version used

3.433.0

Environment details (OS name and version, etc.)

Windows 11

tim-finnigan commented 21 hours ago

Thanks for creating this feature request, we'll try reaching out to the SNS team to see if they would consider these changes like the SQS team did. (ref: P138972038)