aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.91k stars 1.04k forks source link

Requestless requests #3010

Closed sbiscigl closed 1 week ago

sbiscigl commented 1 week ago

Description of changes:

Create convenience functions for requests that have full optional input. This also grants backwards compatibility to operations that previously never had a optional request, but now support one. i.e.

#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/ListBucketsRequest.h>

using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::S3;
using namespace Aws::S3::Model;

auto main() -> int {
    SDKOptions options;
    options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;

    InitAPI(options);
    {
        const S3Client client;
        const auto result = client.ListBuckets();
        assert(result.IsSuccess());
        const auto otherResult = client.ListBuckets(ListBucketsRequest());
        assert(otherResult.IsSuccess());
    }
    ShutdownAPI(options);
    return 0;
}

Check all that applies:

Check which platforms you have built SDK on to verify the correctness of this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.