From 7dcc6518720d505b1093b66def8ec57323ad97c5 Mon Sep 17 00:00:00 2001 From: sbiscigl Date: Wed, 5 Jul 2023 13:53:40 -0400 Subject: [PATCH] Add codegen for crt copy object --- .../include/aws/s3-crt/S3CrtClient.h | 8 - .../aws/s3-crt/S3CrtServiceClientModel.h | 1 - .../aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp | 193 +++++++++--------- .../aws-cpp-sdk-s3/include/aws/s3/S3Client.h | 12 +- .../src/aws-cpp-sdk-s3/source/S3Client.cpp | 16 ++ .../cpp/s3/S3RestXmlCppClientGenerator.java | 1 + .../velocity/cpp/s3/S3ClientHeader.vm | 1 + .../cpp/s3/s3-crt/S3CrtSpecificOperations.vm | 16 ++ 8 files changed, 136 insertions(+), 112 deletions(-) diff --git a/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtClient.h b/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtClient.h index cfbae9dc043..16d920e3414 100644 --- a/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtClient.h +++ b/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtClient.h @@ -391,14 +391,6 @@ namespace Aws */ virtual Model::CopyObjectOutcome CopyObject(const Model::CopyObjectRequest& request) const; - /** - * A Callable wrapper for CopyObject that returns a future to the operation so that it can be executed in parallel to other requests. - */ - template - Model::CopyObjectOutcomeCallable CopyObjectCallable(const CopyObjectRequestT& request) const - { - return SubmitCallable(&S3CrtClient::CopyObject, request); - } /** * An Async wrapper for CopyObject that queues the request into a thread executor and triggers associated callback when operation has finished. diff --git a/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtServiceClientModel.h b/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtServiceClientModel.h index 57b4db2dc4a..912954a2f46 100644 --- a/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtServiceClientModel.h +++ b/generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtServiceClientModel.h @@ -308,7 +308,6 @@ namespace Aws /* Service model Outcome callable definitions */ typedef std::future AbortMultipartUploadOutcomeCallable; typedef std::future CompleteMultipartUploadOutcomeCallable; - typedef std::future CopyObjectOutcomeCallable; typedef std::future CreateBucketOutcomeCallable; typedef std::future CreateMultipartUploadOutcomeCallable; typedef std::future DeleteBucketOutcomeCallable; diff --git a/generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp b/generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp index 808c0ba99d1..d94d4490e95 100644 --- a/generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp +++ b/generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp @@ -390,13 +390,13 @@ static void S3CrtRequestFinishCallback(struct aws_s3_meta_request *meta_request, { AWS_UNREFERENCED_PARAM(meta_request); auto *userData = static_cast(user_data); - + if (meta_request_result->error_code != AWS_ERROR_SUCCESS && meta_request_result->response_status == 0) { /* client side error */ userData->response->SetClientErrorType(CoreErrors::NETWORK_CONNECTION); Aws::StringStream ss; - ss << "crtCode: " << meta_request_result->error_code - << ", " << aws_error_name(meta_request_result->error_code) + ss << "crtCode: " << meta_request_result->error_code + << ", " << aws_error_name(meta_request_result->error_code) << " - " << aws_error_str(meta_request_result->error_code); userData->response->SetClientErrorMessage(ss.str()); userData->response->SetResponseCode(HttpResponseCode::REQUEST_NOT_MADE); @@ -527,6 +527,103 @@ void S3CrtClient::InitCommonCrtRequestOption(CrtRequestCallbackUserData *userDat aws_uri_init_parse(options->endpoint, Aws::get_aws_allocator(), &endpointCursor); } +static void CopyObjectRequestShutdownCallback(void *user_data) +{ + auto *userData = static_cast(user_data); + // call user callback and release user_data + S3Crt::Model::CopyObjectOutcome outcome(userData->s3CrtClient->GenerateXmlOutcome(userData->response)); + userData->copyResponseHandler(userData->s3CrtClient, *(reinterpret_cast(userData->originalRequest)), std::move(outcome), userData->asyncCallerContext); + + Aws::Delete(userData); +} + +void S3CrtClient::CopyObjectAsync(const CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr& handlerContext) const +{ + if (!m_endpointProvider) { + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Endpoint provider is not initialized", false)), handlerContext); + } + if (!request.BucketHasBeenSet()) + { + AWS_LOGSTREAM_ERROR("CopyObject", "Required field: Bucket, is not set"); + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Bucket]", false)), handlerContext); + } + if (!request.CopySourceHasBeenSet()) + { + AWS_LOGSTREAM_ERROR("CopyObject", "Required field: CopySource, is not set"); + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CopySource]", false)), handlerContext); + } + if (!request.KeyHasBeenSet()) + { + AWS_LOGSTREAM_ERROR("CopyObject", "Required field: Key, is not set"); + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Key]", false)), handlerContext); + } + ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); + if (!endpointResolutionOutcome.IsSuccess()) { + handler(this, request, CopyObjectOutcome(Aws::Client::AWSError( + CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext); + return; + } + endpointResolutionOutcome.GetResult().AddPathSegments(request.GetKey()); + + // make aws_s3_meta_request with callbacks + CrtRequestCallbackUserData *userData = Aws::New(ALLOCATION_TAG); + aws_s3_meta_request_options options; + AWS_ZERO_STRUCT(options); + aws_uri endpoint; + AWS_ZERO_STRUCT(endpoint); + options.endpoint = &endpoint; + std::unique_ptr endpointCleanup { options.endpoint, &aws_uri_clean_up }; + + userData->copyResponseHandler = handler; + userData->asyncCallerContext = handlerContext; + InitCommonCrtRequestOption(userData, &options, &request, endpointResolutionOutcome.GetResult().GetURI(), Aws::Http::HttpMethod::HTTP_PUT); + if (userData != nullptr && + userData->request != nullptr && + userData->request->GetContentBody() != nullptr && + userData->request->GetContentBody()->fail()) + { + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); + } + options.shutdown_callback = CopyObjectRequestShutdownCallback; + options.type = AWS_S3_META_REQUEST_TYPE_COPY_OBJECT; + struct aws_signing_config_aws signing_config_override = m_s3CrtSigningConfig; + if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegion()) { + signing_config_override.region = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegion()->c_str()); + } + if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegionSet()) { + signing_config_override.region = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegionSet()->c_str()); + } + if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningName()) { + signing_config_override.service = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningName()->c_str()); + } + options.signing_config = &signing_config_override; + + std::shared_ptr crtHttpRequest = userData->request->ToCrtHttpRequest(); + options.message= crtHttpRequest->GetUnderlyingMessage(); + userData->crtHttpRequest = crtHttpRequest; + + if (aws_s3_client_make_meta_request(m_s3CrtClient, &options) == nullptr) + { + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); + } +} + +CopyObjectOutcome S3CrtClient::CopyObject(const CopyObjectRequest& request) const +{ + AWS_OPERATION_GUARD(CopyObject); + Aws::Utils::Threading::Semaphore sem(0, 1); + CopyObjectOutcome res; + + auto handler = CopyObjectResponseReceivedHandler{[&](const S3CrtClient*, const CopyObjectRequest&, const CopyObjectOutcome& outcome, const std::shared_ptr &) { + res = std::move(outcome); + sem.ReleaseAll(); + }}; + + S3CrtClient::CopyObjectAsync(request, handler, nullptr); + sem.WaitOne(); + return res; +} + static void GetObjectRequestShutdownCallback(void *user_data) { auto *userData = static_cast(user_data); @@ -761,96 +858,6 @@ CompleteMultipartUploadOutcome S3CrtClient::CompleteMultipartUpload(const Comple return CompleteMultipartUploadOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST)); } -static void CopyObjectRequestShutdownCallback(void *user_data) -{ - auto *userData = static_cast(user_data); - S3Crt::Model::CopyObjectOutcome outcome(userData->s3CrtClient->GenerateXmlOutcome(userData->response)); - - userData->copyResponseHandler(userData->s3CrtClient, *(reinterpret_cast(userData->originalRequest)), std::move(outcome), userData->asyncCallerContext); - Aws::Delete(userData); -} - -void S3CrtClient::CopyObjectAsync(const Model::CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr& handlerContext) const -{ - if (!m_endpointProvider) { - return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Endpoint provider is not initialized", false)), handlerContext); - } - if (!request.BucketHasBeenSet()) - { - AWS_LOGSTREAM_ERROR("CopyObject", "Required field: Bucket, is not set"); - return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Bucket]", false)), handlerContext); - } - if (!request.CopySourceHasBeenSet()) - { - AWS_LOGSTREAM_ERROR("CopyObject", "Required field: CopySource, is not set"); - return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CopySource]", false)), handlerContext); - } - if (!request.KeyHasBeenSet()) - { - AWS_LOGSTREAM_ERROR("CopyObject", "Required field: Key, is not set"); - return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Key]", false)), handlerContext); - } - - ResolveEndpointOutcome endpointResolutionOutcome = m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); - if (!endpointResolutionOutcome.IsSuccess()) { - handler(this, request, CopyObjectOutcome(Aws::Client::AWSError( - CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext); - return; - } - endpointResolutionOutcome.GetResult().AddPathSegments(request.GetKey()); - - CrtRequestCallbackUserData *userData = Aws::New(ALLOCATION_TAG); - aws_s3_meta_request_options options; - AWS_ZERO_STRUCT(options); - aws_uri endpoint; - AWS_ZERO_STRUCT(endpoint); - options.endpoint = &endpoint; - std::unique_ptr endpointCleanup { options.endpoint, &aws_uri_clean_up }; - - userData->copyResponseHandler = handler; - userData->asyncCallerContext = handlerContext; - InitCommonCrtRequestOption(userData, &options, &request, endpointResolutionOutcome.GetResult().GetURI(), Aws::Http::HttpMethod::HTTP_PUT); - options.shutdown_callback = CopyObjectRequestShutdownCallback; - options.type = AWS_S3_META_REQUEST_TYPE_COPY_OBJECT; - - struct aws_signing_config_aws signing_config_override = m_s3CrtSigningConfig; - if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegion()) { - signing_config_override.region = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegion()->c_str()); - } - if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegionSet()) { - signing_config_override.region = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningRegionSet()->c_str()); - } - if (endpointResolutionOutcome.GetResult().GetAttributes() && endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningName()) { - signing_config_override.service = Aws::Crt::ByteCursorFromCString(endpointResolutionOutcome.GetResult().GetAttributes()->authScheme.GetSigningName()->c_str()); - } - options.signing_config = &signing_config_override; - - std::shared_ptr crtHttpRequest = userData->request->ToCrtHttpRequest(); - options.message= crtHttpRequest->GetUnderlyingMessage(); - userData->crtHttpRequest = crtHttpRequest; - - if (aws_s3_client_make_meta_request(m_s3CrtClient, &options) == nullptr) - { - return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); - } -} - -CopyObjectOutcome S3CrtClient::CopyObject(const CopyObjectRequest& request) const -{ - AWS_OPERATION_GUARD(CopyObject); - Aws::Utils::Threading::Semaphore sem(0, 1); - CopyObjectOutcome res; - - auto handler = CopyObjectResponseReceivedHandler{[&](const S3CrtClient*, const CopyObjectRequest&, CopyObjectOutcome outcome, const std::shared_ptr &) { - res = std::move(outcome); - sem.ReleaseAll(); - }}; - - S3CrtClient::CopyObjectAsync(request, handler, nullptr); - sem.WaitOne(); - return res; -} - CreateBucketOutcome S3CrtClient::CreateBucket(const CreateBucketRequest& request) const { AWS_OPERATION_GUARD(CreateBucket); diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/S3Client.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/S3Client.h index a3558336786..692308d1ca0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/S3Client.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/S3Client.h @@ -408,20 +408,12 @@ namespace Aws /** * A Callable wrapper for CopyObject that returns a future to the operation so that it can be executed in parallel to other requests. */ - template - Model::CopyObjectOutcomeCallable CopyObjectCallable(const CopyObjectRequestT& request) const - { - return SubmitCallable(&S3Client::CopyObject, request); - } + virtual Model::CopyObjectOutcomeCallable CopyObjectCallable(const Model::CopyObjectRequest& request) const; /** * An Async wrapper for CopyObject that queues the request into a thread executor and triggers associated callback when operation has finished. */ - template - void CopyObjectAsync(const CopyObjectRequestT& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const - { - return SubmitAsync(&S3Client::CopyObject, request, handler, context); - } + virtual void CopyObjectAsync(const Model::CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Creates a new S3 bucket. To create a bucket, you must register with Amazon S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/S3Client.cpp b/generated/src/aws-cpp-sdk-s3/source/S3Client.cpp index fa271ca2626..4962c416e98 100644 --- a/generated/src/aws-cpp-sdk-s3/source/S3Client.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/S3Client.cpp @@ -341,6 +341,22 @@ CopyObjectOutcome S3Client::CopyObject(const CopyObjectRequest& request) const return CopyObjectOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_PUT)); } +CopyObjectOutcomeCallable S3Client::CopyObjectCallable(const CopyObjectRequest& request) const +{ + auto task = Aws::MakeShared< std::packaged_task< CopyObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CopyObject(request); } ); + auto packagedFunction = [task]() { (*task)(); }; + m_executor->Submit(packagedFunction); + return task->get_future(); +} + +void S3Client::CopyObjectAsync(const CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr& context) const +{ + m_executor->Submit( [this, request, handler, context]() + { + handler(this, request, CopyObject(request), context); + } ); +} + CreateBucketOutcome S3Client::CreateBucket(const CreateBucketRequest& request) const { AWS_OPERATION_GUARD(CreateBucket); diff --git a/tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/generators/cpp/s3/S3RestXmlCppClientGenerator.java b/tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/generators/cpp/s3/S3RestXmlCppClientGenerator.java index 112e9cd904c..1e3c9c2d9ef 100644 --- a/tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/generators/cpp/s3/S3RestXmlCppClientGenerator.java +++ b/tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/generators/cpp/s3/S3RestXmlCppClientGenerator.java @@ -47,6 +47,7 @@ public class S3RestXmlCppClientGenerator extends RestXmlCppClientGenerator { s3CrtEnabledOps.add("GetObject"); s3CrtEnabledOps.add("PutObject"); + s3CrtEnabledOps.add("CopyObject"); bucketLocationConstraints.add("us-east-1"); bucketLocationConstraints.add("us-east-2"); diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/S3ClientHeader.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/S3ClientHeader.vm index bd385694449..a982c0bd9db 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/S3ClientHeader.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/S3ClientHeader.vm @@ -192,6 +192,7 @@ namespace ${rootNamespace} const S3CrtClient *s3CrtClient; GetObjectResponseReceivedHandler getResponseHandler; PutObjectResponseReceivedHandler putResponseHandler; + CopyObjectResponseReceivedHandler copyResponseHandler; std::shared_ptr asyncCallerContext; const Aws::AmazonWebServiceRequest *originalRequest; std::shared_ptr request; diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/s3-crt/S3CrtSpecificOperations.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/s3-crt/S3CrtSpecificOperations.vm index 9dccf190e3d..63a1e8c3ab4 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/s3-crt/S3CrtSpecificOperations.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/s3-crt/S3CrtSpecificOperations.vm @@ -202,6 +202,8 @@ static void ${operation.name}RequestShutdownCallback(void *user_data) userData->putResponseHandler(userData->s3CrtClient, *(reinterpret_cast(userData->originalRequest)), std::move(outcome), userData->asyncCallerContext); #elseif($operation.name == "GetObject") userData->getResponseHandler(userData->s3CrtClient, *(reinterpret_cast(userData->originalRequest)), std::move(outcome), userData->asyncCallerContext); +#elseif($operation.name == "CopyObject") + userData->copyResponseHandler(userData->s3CrtClient, *(reinterpret_cast(userData->originalRequest)), std::move(outcome), userData->asyncCallerContext); #end #else (*handler)(userData->s3CrtClient, outcome, userData->userCallbackContext); @@ -262,6 +264,8 @@ void ${className}::${operation.name}Async(${constText}${operation.request.shape. userData->putResponseHandler = handler; #elseif($operation.name == "GetObject") userData->getResponseHandler = handler; +#elseif($operation.name == "CopyObject") + userData->copyResponseHandler = handler; #end userData->asyncCallerContext = handlerContext; #if($serviceModel.endpointRules) @@ -275,6 +279,8 @@ void ${className}::${operation.name}Async(${constText}${operation.request.shape. return handler(this, request, PutObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INVALID_PARAMETER_VALUE, "INVALID_PARAMETER_VALUE", "Input stream in bad state", false)), handlerContext); #elseif($operation.name == "GetObject") return handler(this, request, GetObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INVALID_PARAMETER_VALUE, "INVALID_PARAMETER_VALUE", "Output stream in bad state", false)), handlerContext); +#elseif($operation.name == "CopyObject") + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); #end } #else @@ -285,6 +291,8 @@ void ${className}::${operation.name}Async(${constText}${operation.request.shape. options.type = AWS_S3_META_REQUEST_TYPE_PUT_OBJECT; #elseif($operation.name == "GetObject") options.type = AWS_S3_META_REQUEST_TYPE_GET_OBJECT; +#elseif($operation.name == "CopyObject") + options.type = AWS_S3_META_REQUEST_TYPE_COPY_OBJECT; #else options.type = AWS_S3_META_REQUEST_TYPE_DEFAULT; #end @@ -315,6 +323,8 @@ void ${className}::${operation.name}Async(${constText}${operation.request.shape. return handler(this, request, PutObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); #elseif($operation.name == "GetObject") return handler(this, request, GetObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); +#elseif($operation.name == "CopyObject") + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); #end } } @@ -361,6 +371,8 @@ void ${className}::${operation.name}Async(${constText}${operation.name}ResponseR userData->putResponseHandler = handler; #elseif($operation.name == "GetObject") userData->getResponseHandler = handler; +#elseif($operation.name == "CopyObject") + userData->copyResponseHandler = handler; #end InitCommonCrtRequestOption(userData, &options, nullptr, ss.str(), Aws::Http::HttpMethod::HTTP_${operation.http.method}); options.shutdown_callback = ${operation.name}RequestShutdownCallback; @@ -368,6 +380,8 @@ void ${className}::${operation.name}Async(${constText}${operation.name}ResponseR options.type = AWS_S3_META_REQUEST_TYPE_PUT_OBJECT; #elseif($operation.name == "GetObject") options.type = AWS_S3_META_REQUEST_TYPE_GET_OBJECT; +#elseif($operation.name == "CopyObject") + options.type = AWS_S3_META_REQUEST_TYPE_COPY_OBJECT; #else options.type = AWS_S3_META_REQUEST_TYPE_DEFAULT; #end @@ -386,6 +400,8 @@ void ${className}::${operation.name}Async(${constText}${operation.name}ResponseR return handler(this, request, PutObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); #elseif($operation.name == "GetObject") return handler(this, request, GetObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); +#elseif($operation.name == "CopyObject") + return handler(this, request, CopyObjectOutcome(Aws::Client::AWSError(S3CrtErrors::INTERNAL_FAILURE, "INTERNAL_FAILURE", "Unable to create s3 meta request", false)), handlerContext); #end } }