aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

Typedefs for ClientConfiguration and EndpointProvider types in Client classes

Open rwie-aws opened this issue 2 years ago • 1 comments

Describe the feature

Add typedefs ClientConfigurationType and EndpointProviderType to service client classes.

Use Case

Makes it easier to use template functions to construct service clients while applying shared configuration values.

For example:

template<typename T>
std::shared_ptr<T> CreateAwsClient(const T::ClientConfigurationType& config) {
  auto config_ = config;
  config_.profile = "my_custom_profile";
  return std::make_shared<T>(config_);
}

Proposed Solution

Add the typedefs to the ServiceClient templates and regenerate the clients.

Other Information

This can currently be worked around by using deprecated constructors that take Aws::Client::ClientConfiguration instead of the service-specific configuration.

Acknowledgements

  • [X] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

rwie-aws avatar Apr 18 '23 08:04 rwie-aws

Thanks for opening this and making a PR. Reviewing the PR

jmklix avatar Apr 21 '23 17:04 jmklix