From 036a5a39ffb553ea619b7d62cf1f0884e4d65b25 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 19 Aug 2026 14:15:32 -0400 Subject: [PATCH 01/53] Smithy: per-service model transforms and awsQueryCompatible ResponseMetadata Add per-service Smithy model transforms (SourceRegion, Lambda, SQS, ApiGateway, ApiGatewayV2, EC2) and a shared TransformSupport helper, and wire them into the ModelCodegenPlugin transform pipeline. Extend GlobalTransforms to also inject the ResponseMetadata envelope for awsQueryCompatible services (e.g. SQS = awsJson1_0 + @awsQueryCompatible), matching legacy C2J CppClientGenerator.addRequestIdToResults. ResponseMetadata is now reserved via a shared constant and injection fails fast on any modeled collision rather than silently mis-generating. --- .../generators/model/ModelCodegenPlugin.java | 16 +- .../transforms/ApiGatewayTransforms.java | 54 ++++++ .../transforms/ApiGatewayV2Transforms.java | 46 +++++ .../model/transforms/Ec2Transforms.java | 148 ++++++++++++++++ .../model/transforms/GlobalTransforms.java | 45 +++-- .../model/transforms/LambdaTransforms.java | 57 +++++++ .../transforms/SourceRegionTransform.java | 85 ++++++++++ .../model/transforms/SqsTransforms.java | 49 ++++++ .../model/transforms/TransformSupport.java | 99 +++++++++++ .../model/GlobalTransformsTest.java | 146 +++++++++++++++- .../transforms/ApiGatewayTransformsTest.java | 75 +++++++++ .../ApiGatewayV2TransformsTest.java | 63 +++++++ .../model/transforms/Ec2TransformsTest.java | 158 ++++++++++++++++++ .../transforms/LambdaTransformsTest.java | 61 +++++++ .../transforms/SourceRegionTransformTest.java | 100 +++++++++++ .../model/transforms/SqsTransformsTest.java | 91 ++++++++++ 16 files changed, 1277 insertions(+), 16 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index d3eeee70276..a9066c5fd9d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -6,7 +6,13 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SqsTransforms; import software.amazon.smithy.build.PluginContext; import software.amazon.smithy.build.SmithyBuildPlugin; import software.amazon.smithy.model.Model; @@ -42,8 +48,14 @@ public void execute(PluginContext context) { // Build transform pipeline (service-level transforms will be registered here) TransformPipeline pipeline = new TransformPipeline(List.of( - GlobalTransforms.asTransform() - // Future: S3Transforms.asTransform(), Ec2Transforms.asTransform(), etc. + GlobalTransforms.asTransform(), + SourceRegionTransform.asTransform(), + LambdaTransforms.asTransform(), + SqsTransforms.asTransform(), + ApiGatewayTransforms.asTransform(), + ApiGatewayV2Transforms.asTransform(), + Ec2Transforms.asTransform() + // Future: S3Transforms.asTransform(), etc. )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java new file mode 100644 index 00000000000..221cadd326a --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java @@ -0,0 +1,54 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import java.util.ArrayList; +import java.util.List; + +/** + * Renames the reserved {@code body}/{@code headers} members of API Gateway's test-invoke requests to + * {@code requestBody}/{@code requestHeaders}. Mirrors the legacy C2J {@code APIGatewayRestJsonCppClientGenerator}. + */ +public final class ApiGatewayTransforms { + + private ApiGatewayTransforms() {} + + public static ModelTransform asTransform() { + return ApiGatewayTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"api-gateway".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + String ns = service.getId().getNamespace(); + List updated = new ArrayList<>(); + for (String requestName : List.of("TestInvokeMethodRequest", "TestInvokeAuthorizerRequest")) { + model.getShape(ShapeId.fromParts(ns, requestName)) + .flatMap(s -> s.asStructureShape()) + .ifPresent(struct -> { + StructureShape afterBody = TransformSupport + .renameMember(struct, "body", "requestBody").orElse(struct); + TransformSupport.renameMember(afterBody, "headers", "requestHeaders") + .ifPresentOrElse(updated::add, () -> { + if (afterBody != struct) { + updated.add(afterBody); + } + }); + }); + } + if (updated.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(updated).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java new file mode 100644 index 00000000000..afbb391a458 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java @@ -0,0 +1,46 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import java.util.ArrayList; +import java.util.List; + +/** + * Renames the reserved {@code Body} member of API Gateway V2's import requests to {@code requestBody}. + * Mirrors the legacy C2J {@code APIGatewayV2RestJsonCppClientGenerator}. + */ +public final class ApiGatewayV2Transforms { + + private ApiGatewayV2Transforms() {} + + public static ModelTransform asTransform() { + return ApiGatewayV2Transforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"apigatewayv2".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + String ns = service.getId().getNamespace(); + List updated = new ArrayList<>(); + for (String requestName : List.of("ImportApiRequest", "ReimportApiRequest")) { + model.getShape(ShapeId.fromParts(ns, requestName)) + .flatMap(s -> s.asStructureShape()) + .flatMap(struct -> TransformSupport.renameMember(struct, "Body", "requestBody")) + .ifPresent(updated::add); + } + if (updated.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(updated).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java new file mode 100644 index 00000000000..6a007880881 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java @@ -0,0 +1,148 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.BlobShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.EnumTrait; +import software.amazon.smithy.model.traits.SensitiveTrait; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * EC2 model parity with the legacy C2J {@code Ec2CppClientGenerator}: adds the unmodeled + * {@code disabled} value to {@code SpotInstanceState}, renames every {@code *Result} + * structure shape to {@code *Response} so nested domain structs (e.g. {@code MetricDataResult}) + * match C2J, and models {@code ModifyInstanceAttributeRequest.UserData} as the sensitive + * {@code SecureBlobAttributeValue} to match the C2J model. Operation-OUTPUT result files are + * handled centrally by {@code ShapeUtil.getResultSuffix}, but nested domain structs are rendered + * from the shape name by {@code SubObjectRenderer}, so those require a model-shape rename. Out of + * scope (client/endpoint path, left to C2J): the legacy error-code injection, CopySnapshot + * pre-signing, and endpoint template. + * + *

UserData / SecureBlobAttributeValue: the upstream {@code aws/aws-models} C2J model + * ({@code ec2//service-2.json}) marks {@code UserData} sensitive via + * {@code SecureBlobAttributeValue -> SecureBlob (@sensitive)}, but the upstream Smithy model + * ({@code ec2/smithy/model.json}) still targets the non-sensitive {@code BlobAttributeValue}. This + * transform mirrors the C2J modeling in the Smithy model so generated code matches. It self-retires + * (no-op) once the upstream Smithy model catches up, and is a temporary compensation for that + * upstream data lag — see docs/superpowers/plans/parity-deltas.md. + */ +public final class Ec2Transforms { + + private Ec2Transforms() {} + + public static ModelTransform asTransform() { + return Ec2Transforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"ec2".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + return renameResultShapesToResponse( + addSecureBlobUserData(addSpotInstanceStateDisabled(model))); + } + + /** + * Models {@code ModifyInstanceAttributeRequest.UserData} as {@code SecureBlobAttributeValue} + * (whose {@code Value} member targets a {@code @sensitive} {@code SecureBlob} blob), matching + * the C2J model. The upstream Smithy model still targets the non-sensitive + * {@code BlobAttributeValue}; after repointing, {@code BlobAttributeValue} is no longer + * referenced and drops out of the reachable (emitted) set, exactly as it does in C2J. + * + *

No-op — leaving the model untouched — when {@code SecureBlobAttributeValue} already exists + * (upstream Smithy caught up) or {@code UserData} no longer targets {@code BlobAttributeValue}, + * so the transform cannot introduce a duplicate shape or fight a corrected upstream model. + */ + private static Model addSecureBlobUserData(Model model) { + Optional requestOpt = model.shapes(StructureShape.class) + .filter(s -> "ModifyInstanceAttributeRequest".equals(s.getId().getName())) + .findFirst(); + if (requestOpt.isEmpty()) { + return model; + } + StructureShape request = requestOpt.get(); + MemberShape userData = request.getAllMembers().get("UserData"); + if (userData == null) { + return model; + } + + String namespace = request.getId().getNamespace(); + ShapeId secureBlobId = ShapeId.fromParts(namespace, "SecureBlob"); + ShapeId secureStructId = ShapeId.fromParts(namespace, "SecureBlobAttributeValue"); + ShapeId blobAttrId = ShapeId.fromParts(namespace, "BlobAttributeValue"); + + if (model.getShape(secureStructId).isPresent() || !userData.getTarget().equals(blobAttrId)) { + return model; + } + MemberShape originalValue = model.expectShape(blobAttrId, StructureShape.class) + .getAllMembers().get("Value"); + if (originalValue == null) { + return model; + } + + BlobShape secureBlob = BlobShape.builder() + .id(secureBlobId) + .addTrait(new SensitiveTrait()) + .build(); + // Copy BlobAttributeValue.Value's serde traits (ec2QueryName/xmlName), retargeting the blob. + MemberShape secureValue = originalValue.toBuilder() + .id(secureStructId.withMember("Value")) + .target(secureBlobId) + .build(); + StructureShape secureStruct = StructureShape.builder() + .id(secureStructId) + .addMember(secureValue) + .build(); + // Preserve UserData's own traits (ec2QueryName, documentation, xmlName); only retarget it. + MemberShape newUserData = userData.toBuilder().target(secureStructId).build(); + StructureShape newRequest = request.toBuilder().addMember(newUserData).build(); + + return model.toBuilder().addShapes(secureBlob, secureStruct, newRequest).build(); + } + + private static Model renameResultShapesToResponse(Model model) { + Map renames = new HashMap<>(); + for (StructureShape shape : model.shapes(StructureShape.class).toList()) { + String name = shape.getId().getName(); + if (name.endsWith("Result")) { + String target = name.substring(0, name.length() - "Result".length()) + "Response"; + ShapeId targetId = ShapeId.fromParts(shape.getId().getNamespace(), target); + if (!model.getShape(targetId).isPresent()) { + renames.put(shape.getId(), targetId); + } + } + } + if (renames.isEmpty()) { + return model; + } + return ModelTransformer.create().renameShapes(model, renames); + } + + private static Model addSpotInstanceStateDisabled(Model model) { + Optional enumShape = model.shapes() + .filter(s -> "SpotInstanceState".equals(s.getId().getName())) + .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) + .findFirst(); + if (enumShape.isEmpty()) { + return model; + } + return TransformSupport.appendValues(enumShape.get(), List.of("disabled")) + .map(updated -> model.toBuilder().addShape(updated).build()) + .orElse(model); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 587e926d047..926e51068f3 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -21,6 +21,7 @@ import software.amazon.smithy.model.traits.DeprecatedTrait; import software.amazon.smithy.model.traits.RequiredTrait; import software.amazon.smithy.model.transform.ModelTransformer; +import software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait; import java.util.ArrayList; import java.util.HashSet; @@ -51,6 +52,14 @@ public final class GlobalTransforms { "apigateway" ); + /** + * The framework-injected response-envelope member and shape name. It is reserved: no AWS model + * defines its own {@code ResponseMetadata}. {@link #injectResponseMetadata} adds it (and fails + * fast on any pre-existing collision), and {@code MemberRenderer} keys the "always-present" + * rendering (no {@code HasBeenSet} getter, flag initialized true) on this exact name. + */ + public static final String RESPONSE_METADATA = "ResponseMetadata"; + private GlobalTransforms() {} // NOTE: This reserved-member rename is intentionally NOT wired into the transform @@ -151,25 +160,38 @@ public static Model dropDeprecatedMembers(Model model, ServiceShape service) { } /** - * For awsQuery / ec2Query services, injects a {@code ResponseMetadata} structure (carrying + * For awsQuery / ec2Query services, and for any service carrying the + * {@code aws.protocols#awsQueryCompatible} trait (e.g. SQS = {@code awsJson1_0} + + * {@code @awsQueryCompatible}), injects a {@code ResponseMetadata} structure (carrying * a {@code RequestId} string member) and adds it as a {@code @required} member on every * result (operation output) shape. This mirrors the legacy C2J - * {@code QueryCppClientGenerator.addRequestIdToResults} injection, so that Query/EC2 result - * classes expose {@code GetResponseMetadata()} and back the {@code m_responseMetadata} - * deserialization emitted by {@code QueryXmlProtocolTraits}. Other protocols are unchanged. + * {@code CppClientGenerator.addRequestIdToResults} injection (which fires for query/ec2 + * protocols and, via its {@code awsQueryCompatible} branch, for awsQueryCompatible JSON + * services), so that those result classes expose {@code GetResponseMetadata()}. Other + * protocols are unchanged. * * @param model the current model * @param service the service being generated - * @return the model with ResponseMetadata injected, or the input model for non-query protocols + * @return the model with ResponseMetadata injected, or the input model for other protocols */ public static Model injectResponseMetadata(Model model, ServiceShape service) { Protocol protocol = ProtocolResolver.resolve(service, model); - if (protocol != Protocol.QUERY_XML && protocol != Protocol.EC2) { + boolean awsQueryCompatible = service.hasTrait(AwsQueryCompatibleTrait.class); + if (protocol != Protocol.QUERY_XML && protocol != Protocol.EC2 && !awsQueryCompatible) { return model; } String namespace = service.getId().getNamespace(); - ShapeId responseMetadataId = ShapeId.fromParts(namespace, "ResponseMetadata"); + ShapeId responseMetadataId = ShapeId.fromParts(namespace, RESPONSE_METADATA); + + // ResponseMetadata is reserved. If the model already defines a shape of that name, injecting + // ours would clobber it and MemberRenderer's name-based recognition could not tell them + // apart — fail fast rather than silently mis-generate. + if (model.getShape(responseMetadataId).isPresent()) { + throw new IllegalStateException("Service " + service.getId() + " already defines a shape '" + + responseMetadataId + "'; cannot inject the framework " + RESPONSE_METADATA + + " envelope"); + } // ResponseMetadata { RequestId: String } StructureShape responseMetadata = StructureShape.builder() @@ -192,12 +214,15 @@ public static Model injectResponseMetadata(Model model, ServiceShape service) { for (ShapeId outputId : outputIds) { model.getShape(outputId).flatMap(Shape::asStructureShape).ifPresent(result -> { - if (result.getMember("ResponseMetadata").isPresent()) { - return; + if (result.getMember(RESPONSE_METADATA).isPresent()) { + throw new IllegalStateException("Result shape " + result.getId() + + " already has a '" + RESPONSE_METADATA + "' member; cannot inject the " + + "framework " + RESPONSE_METADATA + " envelope. Rename the modeled member " + + "via a per-service transform first."); } StructureShape withMetadata = result.toBuilder() .addMember(MemberShape.builder() - .id(result.getId().withMember("ResponseMetadata")) + .id(result.getId().withMember(RESPONSE_METADATA)) .target(responseMetadataId) .addTrait(new RequiredTrait()) .build()) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java new file mode 100644 index 00000000000..344442d7543 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java @@ -0,0 +1,57 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; + +/** + * Removes the deprecated {@code InvokeAsync} operation (and its input/output shapes) from the + * Lambda service. Mirrors the legacy C2J {@code LambdaRestJsonCppClientGenerator}, which removed + * {@code InvokeAsync} because it collides with the generated async client. + */ +public final class LambdaTransforms { + + private static final ShapeId UNIT = ShapeId.from("smithy.api#Unit"); + + private LambdaTransforms() {} + + public static ModelTransform asTransform() { + return LambdaTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"lambda".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + Optional invokeAsync = TopDownIndex.of(model) + .getContainedOperations(service).stream() + .filter(op -> "InvokeAsync".equals(op.getId().getName())) + .findFirst(); + if (invokeAsync.isEmpty()) { + return model; + } + OperationShape op = invokeAsync.get(); + Set toRemove = new HashSet<>(); + toRemove.add(op); + if (!UNIT.equals(op.getInputShape())) { + model.getShape(op.getInputShape()).ifPresent(toRemove::add); + } + op.getOutput().filter(id -> !UNIT.equals(id)) + .flatMap(model::getShape).ifPresent(toRemove::add); + return ModelTransformer.create().removeShapes(model, toRemove); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java new file mode 100644 index 00000000000..adac53b7a71 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java @@ -0,0 +1,85 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Injects a synthetic {@code SourceRegion} string member into the request shapes of the + * cross-region copy operations for RDS-family services. Mirrors the legacy C2J + * {@code RDSCppClientGenerator}/{@code DocDBCppClientGenerator}/{@code NeptuneCppClientGenerator} + * injection that backs presigned-URL generation. Model-shape scope only: the presigned-URL + * client logic remains in the C2J path, which references this member. + */ +public final class SourceRegionTransform { + + private static final String SOURCE_REGION = "SourceRegion"; + + // smithy service name (lowercase-hyphenated sdkId) -> operation names whose input gets SourceRegion. + private static final Map> TARGETS = Map.of( + "rds", Set.of( + "CopyDBClusterSnapshot", + "CreateDBCluster", + "CopyDBSnapshot", + "CreateDBInstanceReadReplica", + "StartDBInstanceAutomatedBackupsReplication"), + "docdb", Set.of( + "CopyDBClusterSnapshot", + "CreateDBCluster"), + "neptune", Set.of( + "CopyDBClusterSnapshot", + "CreateDBCluster") + ); + + private SourceRegionTransform() {} + + public static ModelTransform asTransform() { + return SourceRegionTransform::apply; + } + + private static Model apply(Model model, ServiceShape service) { + String serviceName = ServiceNameUtil.getSmithyServiceName(service, null); + Set operations = TARGETS.get(serviceName); + if (operations == null) { + return model; + } + + List updated = new ArrayList<>(); + for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + if (!operations.contains(op.getId().getName())) { + continue; + } + model.getShape(op.getInputShape()).flatMap(s -> s.asStructureShape()).ifPresent(req -> { + if (req.getMember(SOURCE_REGION).isPresent()) { + return; + } + updated.add(req.toBuilder() + .addMember(MemberShape.builder() + .id(req.getId().withMember(SOURCE_REGION)) + .target(ShapeId.from("smithy.api#String")) + .build()) + .build()); + }); + } + + if (updated.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(updated).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java new file mode 100644 index 00000000000..68d55f1c46e --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java @@ -0,0 +1,49 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.traits.EnumTrait; + +import java.util.List; +import java.util.Optional; + +/** + * Adds the unmodeled {@code QueueAttributeName} enum values that the legacy C2J + * {@code SQSQueryXmlCppClientGenerator}/{@code SQSJsonCppClientGenerator} injected. These values are + * returned by the service but absent from the model. + */ +public final class SqsTransforms { + + private static final String ENUM_NAME = "QueueAttributeName"; + private static final List ADDED_VALUES = List.of( + "SentTimestamp", "ApproximateFirstReceiveTimestamp", "ApproximateReceiveCount", "SenderId"); + + private SqsTransforms() {} + + public static ModelTransform asTransform() { + return SqsTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"sqs".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + Optional target = model.shapes() + .filter(s -> ENUM_NAME.equals(s.getId().getName())) + .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) + .findFirst(); + if (target.isEmpty()) { + return model; + } + return TransformSupport.appendValues(target.get(), ADDED_VALUES) + .map(updated -> model.toBuilder().addShape(updated).build()) + .orElse(model); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java new file mode 100644 index 00000000000..c82fe57454d --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -0,0 +1,99 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; +import software.amazon.smithy.model.shapes.EnumShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.EnumDefinition; +import software.amazon.smithy.model.traits.EnumTrait; + +import java.util.List; +import java.util.Optional; + +/** + * Shared helpers for per-service model transforms. + */ +final class TransformSupport { + + /** + * Pattern for an identifier-safe Smithy enum member name: a leading letter or underscore + * followed by letters, digits, or underscores. + */ + private static final String IDENTIFIER_PATTERN = "[A-Za-z_][A-Za-z0-9_]*"; + + private TransformSupport() {} + + /** + * Appends the given wire {@code values} to an enum shape. + * + *

Precondition: each value MUST be an identifier-safe wire value, i.e. a + * valid Smithy enum member name matching {@code [A-Za-z_][A-Za-z0-9_]*}. Values containing + * characters such as {@code '-'}, {@code '.'}, or spaces are rejected. This precondition matters + * for two reasons: the idempotency dedup compares the incoming values against the shape's + * existing values (obtained via {@link EnumRenderer#getEnumValues(Shape)}), and the + * {@code EnumShape} branch uses each value directly as the Smithy member name via + * {@code builder.addMember(value, value)}. A non-identifier value would silently break dedup + * and fail deep inside Smithy, so it is rejected up front. + * + * @param enumShape the enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code StringShape} + * with an {@code @enum} trait) to append to + * @param values identifier-safe wire values to append + * @return the updated shape, or {@link Optional#empty()} if all values are already present + * @throws IllegalArgumentException if any value is not an identifier-safe enum member name + */ + static Optional appendValues(Shape enumShape, List values) { + for (String value : values) { + if (value == null || !value.matches(IDENTIFIER_PATTERN)) { + throw new IllegalArgumentException( + "Enum value \"" + value + "\" for shape " + enumShape.getId() + + " is not an identifier-safe enum member name (must match " + + IDENTIFIER_PATTERN + ")"); + } + } + List existing = EnumRenderer.getEnumValues(enumShape); + List toAdd = values.stream().filter(v -> !existing.contains(v)).toList(); + if (toAdd.isEmpty()) { + return Optional.empty(); + } + if (enumShape.isEnumShape()) { + EnumShape.Builder builder = enumShape.asEnumShape().get().toBuilder(); + for (String value : toAdd) { + builder.addMember(value, value); + } + return Optional.of(builder.build()); + } + EnumTrait existingTrait = enumShape.expectTrait(EnumTrait.class); + EnumTrait.Builder traitBuilder = EnumTrait.builder(); + existingTrait.getValues().forEach(traitBuilder::addEnum); + for (String value : toAdd) { + traitBuilder.addEnum(EnumDefinition.builder().value(value).build()); + } + return Optional.of(enumShape.asStringShape().get().toBuilder() + .addTrait(traitBuilder.build()) + .build()); + } + + /** + * Returns a copy of {@code struct} with member {@code oldName} renamed to {@code newName}, + * preserving member declaration order and copying all traits onto the renamed member. Returns + * {@link Optional#empty()} if {@code oldName} is absent or {@code newName} already exists. + */ + static Optional renameMember(StructureShape struct, String oldName, String newName) { + if (struct.getMember(oldName).isEmpty() || struct.getMember(newName).isPresent()) { + return Optional.empty(); + } + StructureShape.Builder builder = StructureShape.builder().id(struct.getId()); + struct.getAllTraits().values().forEach(builder::addTrait); + for (MemberShape member : struct.getAllMembers().values()) { + String name = member.getMemberName().equals(oldName) ? newName : member.getMemberName(); + builder.addMember(name, member.getTarget(), + b -> member.getAllTraits().values().forEach(b::addTrait)); + } + return Optional.of(builder.build()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index d4be7bdda09..ffa9a1e1fdc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -454,14 +454,102 @@ void dropDeprecatedMembers_orphanedTargetBecomesUnreachable() { "shape referenced only via a deprecated member must become unreachable"); } + @Test + void dropDeprecatedMembers_sharedTargetSurvivesViaNonDeprecatedReference() { + // A shape reached through BOTH a @deprecated member and a live member must stay reachable: + // dropping the deprecated reference must never orphan a shape the surviving model still uses. + // This guards against a pruning bug that would drop a shared shape and dangle the live ref. + StructureShape shared = StructureShape.builder() + .id("com.example#SharedDetail") + .addMember(MemberShape.builder() + .id("com.example#SharedDetail$x").target("smithy.api#String").build()) + .build(); + // Input references SharedDetail through a @deprecated member (dropped by the transform). + StructureShape input = StructureShape.builder() + .id("com.example#MyInput") + .addMember(MemberShape.builder() + .id("com.example#MyInput$legacyDetail").target(shared.getId()) + .addTrait(software.amazon.smithy.model.traits.DeprecatedTrait.builder().build()) + .build()) + .build(); + // Output references the same SharedDetail through a live (non-deprecated) member. + StructureShape output = StructureShape.builder() + .id("com.example#MyOutput") + .addMember(MemberShape.builder() + .id("com.example#MyOutput$detail").target(shared.getId()).build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#MyOperation").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#MyService").version("2024-01-01").addOperation(op.getId()).build(); + Model model = Model.assembler() + .addShapes(shared, input, output, op, service).assemble().unwrap(); + + Model out = GlobalTransforms.dropDeprecatedMembers(model, service); + StructureShape transformedInput = out.expectShape( + ShapeId.from("com.example#MyInput"), StructureShape.class); + assertFalse(transformedInput.getMember("legacyDetail").isPresent(), + "deprecated reference must be dropped from its container"); + + Set reachable = GlobalTransforms.computeReachableShapes(out, serviceOf(out, "MyService")); + assertTrue(reachable.contains(ShapeId.from("com.example#SharedDetail")), + "shape still referenced by a surviving member must remain reachable (and emitted)"); + } + private static ServiceShape serviceOf(Model model, String name) { return model.expectShape(ShapeId.from("com.example#" + name), ServiceShape.class); } + @Test + void injectResponseMetadata_failsFastOnModeledResponseMetadataMember() { + // ResponseMetadata is framework-reserved. A modeled member of that name on a result would + // make MemberRenderer's name-based recognition ambiguous, so injection fails fast rather + // than clobber the modeled member or silently mis-render it. + StructureShape input = StructureShape.builder().id("com.example#DoThingInput").build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput") + .addMember(MemberShape.builder() + .id("com.example#DoThingOutput$ResponseMetadata").target("smithy.api#String").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(new software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait()) + .addOperation(op.getId()).build(); + Model model = Model.assembler().addShapes(input, output, op, service).assemble().unwrap(); + + assertThrows(IllegalStateException.class, + () -> GlobalTransforms.injectResponseMetadata(model, serviceOf(model, "Example"))); + } + + @Test + void injectResponseMetadata_failsFastOnModeledResponseMetadataShape() { + // A modeled shape literally named ResponseMetadata collides with the framework envelope + // shape we create; injecting would clobber it, so fail fast. + StructureShape input = StructureShape.builder().id("com.example#DoThingInput").build(); + StructureShape output = StructureShape.builder().id("com.example#DoThingOutput").build(); + StructureShape modeled = StructureShape.builder() + .id("com.example#ResponseMetadata") + .addMember(MemberShape.builder() + .id("com.example#ResponseMetadata$foo").target("smithy.api#String").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(new software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait()) + .addOperation(op.getId()).build(); + Model model = Model.assembler().addShapes(input, output, modeled, op, service).assemble().unwrap(); + + assertThrows(IllegalStateException.class, + () -> GlobalTransforms.injectResponseMetadata(model, serviceOf(model, "Example"))); + } + // --- injectResponseMetadata tests --- - /** A single-operation service under the given protocol trait, output has one plain member. */ - private static Model oneOutputModel(software.amazon.smithy.model.traits.Trait protocolTrait) { + /** A single-operation service under the given protocol trait(s), output has one plain member. */ + private static Model oneOutputModel(software.amazon.smithy.model.traits.Trait... serviceTraits) { StructureShape input = StructureShape.builder().id("com.example#DoThingInput").build(); StructureShape output = StructureShape.builder() .id("com.example#DoThingOutput") @@ -470,9 +558,13 @@ private static Model oneOutputModel(software.amazon.smithy.model.traits.Trait pr .build(); OperationShape op = OperationShape.builder() .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); - ServiceShape service = ServiceShape.builder() + ServiceShape.Builder serviceBuilder = ServiceShape.builder() .id("com.example#Example").version("2024-01-01") - .addTrait(protocolTrait).addOperation(op.getId()).build(); + .addOperation(op.getId()); + for (software.amazon.smithy.model.traits.Trait trait : serviceTraits) { + serviceBuilder.addTrait(trait); + } + ServiceShape service = serviceBuilder.build(); return Model.assembler().addShapes(input, output, op, service).assemble().unwrap(); } @@ -529,4 +621,50 @@ void injectResponseMetadata_restJson_leavesResultUnchanged() { assertFalse(result.getMember("ResponseMetadata").isPresent(), "Non-query protocols must not get ResponseMetadata injected"); } + + @Test + void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataMemberToResult() { + // awsJson1_0 + @awsQueryCompatible (e.g. SQS) resolves to a JSON protocol, but C2J still + // injects ResponseMetadata { RequestId } into every result for awsQueryCompatible services. + Model model = oneOutputModel( + software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build(), + new software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait()); + Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + + StructureShape result = out.expectShape( + ShapeId.from("com.example#DoThingOutput"), StructureShape.class); + assertTrue(result.getMember("ResponseMetadata").isPresent(), + "awsQueryCompatible JSON result should carry an injected ResponseMetadata member"); + MemberShape rm = result.getMember("ResponseMetadata").get(); + assertTrue(rm.hasTrait(software.amazon.smithy.model.traits.RequiredTrait.class), + "ResponseMetadata member should be @required, matching C2J"); + } + + @Test + void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataStructureWithRequestId() { + Model model = oneOutputModel( + software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build(), + new software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait()); + Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + + ShapeId rmId = out.expectShape(ShapeId.from("com.example#DoThingOutput"), StructureShape.class) + .getMember("ResponseMetadata").get().getTarget(); + StructureShape rm = out.expectShape(rmId, StructureShape.class); + assertEquals("ResponseMetadata", rmId.getName()); + assertTrue(rm.getMember("RequestId").isPresent(), + "ResponseMetadata should have a RequestId member"); + } + + @Test + void injectResponseMetadata_awsJsonWithoutQueryCompatible_leavesResultUnchanged() { + // Plain awsJson1_0 (no @awsQueryCompatible) must NOT get ResponseMetadata injected. + Model model = oneOutputModel( + software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build()); + Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + + StructureShape result = out.expectShape( + ShapeId.from("com.example#DoThingOutput"), StructureShape.class); + assertFalse(result.getMember("ResponseMetadata").isPresent(), + "Plain JSON protocols must not get ResponseMetadata injected"); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java new file mode 100644 index 00000000000..ddacd6fe035 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java @@ -0,0 +1,75 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; + +import static org.junit.jupiter.api.Assertions.*; + +class ApiGatewayTransformsTest { + + private static Model apiGatewayModel(String sdkId) { + StructureShape testInvokeMethod = StructureShape.builder() + .id("com.example#TestInvokeMethodRequest") + .addMember(MemberShape.builder().id("com.example#TestInvokeMethodRequest$body") + .target("smithy.api#String").build()) + .addMember(MemberShape.builder().id("com.example#TestInvokeMethodRequest$headers") + .target("smithy.api#String").build()) + .build(); + StructureShape testInvokeAuth = StructureShape.builder() + .id("com.example#TestInvokeAuthorizerRequest") + .addMember(MemberShape.builder().id("com.example#TestInvokeAuthorizerRequest$body") + .target("smithy.api#String").build()) + .addMember(MemberShape.builder().id("com.example#TestInvokeAuthorizerRequest$headers") + .target("smithy.api#String").build()) + .build(); + StructureShape out = StructureShape.builder().id("com.example#EmptyOut").build(); + OperationShape op1 = OperationShape.builder().id("com.example#TestInvokeMethod") + .input(testInvokeMethod.getId()).output(out.getId()).build(); + OperationShape op2 = OperationShape.builder().id("com.example#TestInvokeAuthorizer") + .input(testInvokeAuth.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("apigateway") + .cloudFormationName("ApiGateway").cloudTrailEventSource("apigateway").build()) + .addOperation(op1.getId()).addOperation(op2.getId()) + .build(); + return Model.assembler() + .addShapes(testInvokeMethod, testInvokeAuth, out, op1, op2, service) + .assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + @Test + void renamesBodyAndHeaders() { + Model m = apiGatewayModel("API Gateway"); + Model out = ApiGatewayTransforms.asTransform().apply(m, service(m)); + + StructureShape r = out.expectShape( + ShapeId.from("com.example#TestInvokeMethodRequest"), StructureShape.class); + assertTrue(r.getMember("requestBody").isPresent()); + assertTrue(r.getMember("requestHeaders").isPresent()); + assertTrue(r.getMember("body").isEmpty()); + assertTrue(r.getMember("headers").isEmpty()); + + StructureShape a = out.expectShape( + ShapeId.from("com.example#TestInvokeAuthorizerRequest"), StructureShape.class); + assertTrue(a.getMember("requestBody").isPresent()); + assertTrue(a.getMember("requestHeaders").isPresent()); + } + + @Test + void noOpForOtherService() { + Model m = apiGatewayModel("SomeOther"); + Model out = ApiGatewayTransforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java new file mode 100644 index 00000000000..82dcb27db15 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java @@ -0,0 +1,63 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; + +import static org.junit.jupiter.api.Assertions.*; + +class ApiGatewayV2TransformsTest { + + private static StructureShape reqWithBody(String name) { + return StructureShape.builder() + .id("com.example#" + name) + .addMember(MemberShape.builder().id("com.example#" + name + "$Body") + .target("smithy.api#String").build()) + .build(); + } + + private static Model model(String sdkId) { + StructureShape importApi = reqWithBody("ImportApiRequest"); + StructureShape reimportApi = reqWithBody("ReimportApiRequest"); + StructureShape out = StructureShape.builder().id("com.example#EmptyOut").build(); + OperationShape op1 = OperationShape.builder().id("com.example#ImportApi") + .input(importApi.getId()).output(out.getId()).build(); + OperationShape op2 = OperationShape.builder().id("com.example#ReimportApi") + .input(reimportApi.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("apigatewayv2") + .cloudFormationName("ApiGatewayV2").cloudTrailEventSource("apigatewayv2").build()) + .addOperation(op1.getId()).addOperation(op2.getId()) + .build(); + return Model.assembler().addShapes(importApi, reimportApi, out, op1, op2, service) + .assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + @Test + void renamesBody() { + Model m = model("ApiGatewayV2"); + Model out = ApiGatewayV2Transforms.asTransform().apply(m, service(m)); + for (String name : new String[]{"ImportApiRequest", "ReimportApiRequest"}) { + StructureShape r = out.expectShape(ShapeId.from("com.example#" + name), StructureShape.class); + assertTrue(r.getMember("requestBody").isPresent(), name); + assertTrue(r.getMember("Body").isEmpty(), name); + } + } + + @Test + void noOpForOtherService() { + Model m = model("SomeOther"); + Model out = ApiGatewayV2Transforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java new file mode 100644 index 00000000000..0dbe9184ba3 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java @@ -0,0 +1,158 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.SensitiveTrait; + +import static org.junit.jupiter.api.Assertions.*; + +class Ec2TransformsTest { + + private static Model ec2Model(String sdkId) { + StructureShape in = StructureShape.builder().id("com.example#DescribeThingsRequest").build(); + StructureShape out = StructureShape.builder().id("com.example#DescribeThingsResult").build(); + OperationShape op = OperationShape.builder().id("com.example#DescribeThings") + .input(in.getId()).output(out.getId()).build(); + EnumShape spot = EnumShape.builder().id("com.example#SpotInstanceState") + .addMember("open", "open").addMember("active", "active").build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("ec2") + .cloudFormationName("EC2").cloudTrailEventSource("ec2").build()) + .addOperation(op.getId()) + .build(); + return Model.assembler().addShapes(in, out, op, spot, service).assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + private static ServiceShape ec2Service(String sdkId) { + return ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("ec2") + .cloudFormationName("EC2").cloudTrailEventSource("ec2").build()) + .build(); + } + + @Test + void addsDisabledToSpotInstanceState() { + Model m = ec2Model("EC2"); + Model out = Ec2Transforms.asTransform().apply(m, service(m)); + assertTrue(EnumRenderer.getEnumValues( + out.expectShape(ShapeId.from("com.example#SpotInstanceState"))).contains("disabled")); + } + + @Test + void noOpForOtherService() { + Model m = ec2Model("SomeOther"); + Model out = Ec2Transforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } + + @Test + void renamesNestedResultStructToResponse() { + StructureShape nested = StructureShape.builder() + .id("com.example#MetricDataResult").build(); + ServiceShape service = ec2Service("EC2"); + Model m = Model.assembler().addShapes(nested, service).assemble().unwrap(); + + Model out = Ec2Transforms.asTransform().apply(m, service); + + assertFalse(out.getShape(ShapeId.from("com.example#MetricDataResult")).isPresent()); + assertTrue(out.getShape(ShapeId.from("com.example#MetricDataResponse")).isPresent()); + } + + @Test + void collisionGuardLeavesResultUnchangedWhenResponseExists() { + StructureShape resultShape = StructureShape.builder() + .id("com.example#FooResult").build(); + StructureShape responseShape = StructureShape.builder() + .id("com.example#FooResponse").build(); + ServiceShape service = ec2Service("EC2"); + Model m = Model.assembler().addShapes(resultShape, responseShape, service).assemble().unwrap(); + + Model out = Ec2Transforms.asTransform().apply(m, service); + + assertTrue(out.getShape(ShapeId.from("com.example#FooResult")).isPresent()); + assertTrue(out.getShape(ShapeId.from("com.example#FooResponse")).isPresent()); + } + + /** + * Model mirroring the upstream Smithy EC2 shape: {@code ModifyInstanceAttributeRequest.UserData} + * targets the non-sensitive {@code BlobAttributeValue { Value: Blob }}. + */ + private static Model userDataModel() { + BlobShape blob = BlobShape.builder().id("com.example#Blob").build(); + StructureShape blobAttr = StructureShape.builder() + .id("com.example#BlobAttributeValue") + .addMember(MemberShape.builder() + .id("com.example#BlobAttributeValue$Value").target(blob.getId()).build()) + .build(); + StructureShape request = StructureShape.builder() + .id("com.example#ModifyInstanceAttributeRequest") + .addMember(MemberShape.builder() + .id("com.example#ModifyInstanceAttributeRequest$UserData").target(blobAttr.getId()).build()) + .build(); + StructureShape out = StructureShape.builder().id("com.example#ModifyInstanceAttributeResult").build(); + OperationShape op = OperationShape.builder().id("com.example#ModifyInstanceAttribute") + .input(request.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId("EC2").arnNamespace("ec2") + .cloudFormationName("EC2").cloudTrailEventSource("ec2").build()) + .addOperation(op.getId()) + .build(); + return Model.assembler().addShapes(blob, blobAttr, request, out, op, service).assemble().unwrap(); + } + + @Test + void modelsUserDataAsSensitiveSecureBlobAttributeValue() { + Model m = userDataModel(); + Model out = Ec2Transforms.asTransform().apply(m, service(m)); + + // SecureBlobAttributeValue exists with a Value member targeting a @sensitive blob + // (a @sensitive blob maps to Aws::Utils::CryptoBuffer, matching the C2J baseline). + StructureShape secure = out.expectShape( + ShapeId.from("com.example#SecureBlobAttributeValue"), StructureShape.class); + MemberShape value = secure.getAllMembers().get("Value"); + assertNotNull(value, "SecureBlobAttributeValue must have a Value member"); + Shape valueTarget = out.expectShape(value.getTarget()); + assertTrue(valueTarget.isBlobShape(), "Value must target a blob"); + assertTrue(valueTarget.hasTrait(SensitiveTrait.class), + "the blob must be @sensitive so it renders as CryptoBuffer"); + + // UserData is repointed to SecureBlobAttributeValue. + MemberShape userData = out.expectShape( + ShapeId.from("com.example#ModifyInstanceAttributeRequest"), StructureShape.class) + .getAllMembers().get("UserData"); + assertEquals(ShapeId.from("com.example#SecureBlobAttributeValue"), userData.getTarget()); + + // BlobAttributeValue is now unreferenced, so it drops out of the emitted set (matching C2J). + boolean stillReferenced = out.shapes(StructureShape.class) + .flatMap(s -> s.getAllMembers().values().stream()) + .anyMatch(mem -> mem.getTarget().equals(ShapeId.from("com.example#BlobAttributeValue"))); + assertFalse(stillReferenced, "BlobAttributeValue must be unreferenced after repointing UserData"); + } + + @Test + void secureBlobUserDataTransformIsIdempotent() { + // Re-applying must not throw or duplicate shapes: once SecureBlobAttributeValue exists the + // transform self-retires, so it is safe if the upstream Smithy model later adds the shape. + Model once = Ec2Transforms.asTransform().apply(userDataModel(), service(userDataModel())); + Model twice = Ec2Transforms.asTransform().apply(once, service(once)); + + MemberShape userData = twice.expectShape( + ShapeId.from("com.example#ModifyInstanceAttributeRequest"), StructureShape.class) + .getAllMembers().get("UserData"); + assertEquals(ShapeId.from("com.example#SecureBlobAttributeValue"), userData.getTarget()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java new file mode 100644 index 00000000000..49c31744cf5 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java @@ -0,0 +1,61 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; + +import static org.junit.jupiter.api.Assertions.*; + +class LambdaTransformsTest { + + private static Model lambdaModel(String sdkId) { + StructureShape invokeReq = StructureShape.builder().id("com.example#InvocationRequest").build(); + StructureShape invokeRes = StructureShape.builder().id("com.example#InvocationResponse").build(); + OperationShape invoke = OperationShape.builder() + .id("com.example#Invoke").input(invokeReq.getId()).output(invokeRes.getId()).build(); + + StructureShape asyncReq = StructureShape.builder().id("com.example#InvokeAsyncRequest").build(); + StructureShape asyncRes = StructureShape.builder().id("com.example#InvokeAsyncResult").build(); + OperationShape invokeAsync = OperationShape.builder() + .id("com.example#InvokeAsync").input(asyncReq.getId()).output(asyncRes.getId()).build(); + + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace(sdkId.toLowerCase()) + .cloudFormationName(sdkId).cloudTrailEventSource(sdkId.toLowerCase()).build()) + .addOperation(invoke.getId()).addOperation(invokeAsync.getId()) + .build(); + return Model.assembler() + .addShapes(invokeReq, invokeRes, invoke, asyncReq, asyncRes, invokeAsync, service) + .assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + @Test + void removesInvokeAsyncOperationAndShapes() { + Model m = lambdaModel("Lambda"); + Model out = LambdaTransforms.asTransform().apply(m, service(m)); + + assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsync")).isEmpty()); + assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsyncRequest")).isEmpty()); + assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsyncResult")).isEmpty()); + // Invoke and its shapes are untouched + assertTrue(out.getShape(ShapeId.from("com.example#Invoke")).isPresent()); + assertTrue(out.getShape(ShapeId.from("com.example#InvocationRequest")).isPresent()); + } + + @Test + void noOpForOtherService() { + Model m = lambdaModel("SomeOther"); + Model out = LambdaTransforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java new file mode 100644 index 00000000000..5993373c131 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java @@ -0,0 +1,100 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; + +import static org.junit.jupiter.api.Assertions.*; + +class SourceRegionTransformTest { + + // Builds a single-operation service model. sdkId drives ServiceNameUtil.getSmithyServiceName. + private static Model modelWithOp(String sdkId, String opName, String reqName) { + StructureShape req = StructureShape.builder() + .id("com.example#" + reqName) + .addMember(MemberShape.builder() + .id("com.example#" + reqName + "$ExistingMember") + .target("smithy.api#String") + .build()) + .build(); + StructureShape out = StructureShape.builder().id("com.example#" + opName + "Result").build(); + OperationShape op = OperationShape.builder() + .id("com.example#" + opName) + .input(req.getId()) + .output(out.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService") + .version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace(sdkId.toLowerCase()) + .cloudFormationName(sdkId).cloudTrailEventSource(sdkId.toLowerCase()).build()) + .addOperation(op.getId()) + .build(); + return Model.assembler().addShapes(req, out, op, service).assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + @Test + void injectsSourceRegionIntoRdsRequest() { + Model m = modelWithOp("RDS", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); + Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + + StructureShape req = out.expectShape( + ShapeId.from("com.example#CopyDBClusterSnapshotRequest"), StructureShape.class); + assertTrue(req.getMember("SourceRegion").isPresent()); + assertEquals("smithy.api#String", + req.getMember("SourceRegion").get().getTarget().toString()); + } + + @Test + void noOpForUntargetedOperation() { + // Operation not in the RDS table -> unchanged + Model m = modelWithOp("RDS", "DescribeDBClusters", "DescribeDBClustersRequest"); + Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + assertTrue(out.expectShape(ShapeId.from("com.example#DescribeDBClustersRequest"), + StructureShape.class).getMember("SourceRegion").isEmpty()); + } + + @Test + void noOpForUntargetedService() { + Model m = modelWithOp("SomeOther", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); + Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + assertSame(m, out); + } + + @Test + void idempotent_doesNotDuplicateExistingMember() { + Model m = modelWithOp("RDS", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); + Model once = SourceRegionTransform.asTransform().apply(m, service(m)); + Model twice = SourceRegionTransform.asTransform().apply(once, service(once)); + long count = twice.expectShape(ShapeId.from("com.example#CopyDBClusterSnapshotRequest"), + StructureShape.class).members().stream() + .filter(mem -> mem.getMemberName().equals("SourceRegion")).count(); + assertEquals(1, count); + } + + @Test + void injectsSourceRegionIntoDocDbRequest() { + Model m = modelWithOp("DocDB", "CreateDBCluster", "CreateDBClusterMessage"); + Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + assertTrue(out.expectShape(ShapeId.from("com.example#CreateDBClusterMessage"), + StructureShape.class).getMember("SourceRegion").isPresent()); + } + + @Test + void injectsSourceRegionIntoNeptuneRequest() { + Model m = modelWithOp("Neptune", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotMessage"); + Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + assertTrue(out.expectShape(ShapeId.from("com.example#CopyDBClusterSnapshotMessage"), + StructureShape.class).getMember("SourceRegion").isPresent()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java new file mode 100644 index 00000000000..849302eebaa --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java @@ -0,0 +1,91 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.EnumDefinition; +import software.amazon.smithy.model.traits.EnumTrait; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +class SqsTransformsTest { + + private static final List ADDED = List.of( + "SentTimestamp", "ApproximateFirstReceiveTimestamp", "ApproximateReceiveCount", "SenderId"); + + private static ServiceShape sqsService() { + return ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId("SQS").arnNamespace("sqs") + .cloudFormationName("SQS").cloudTrailEventSource("sqs").build()) + .build(); + } + + @Test + void addsValuesToEnumShape() { + EnumShape enumShape = EnumShape.builder() + .id("com.example#QueueAttributeName") + .addMember("All", "All") + .addMember("Policy", "Policy") + .build(); + Model m = Model.assembler().addShapes(enumShape, sqsService()).assemble().unwrap(); + ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + + Model out = SqsTransforms.asTransform().apply(m, svc); + List values = EnumRenderer.getEnumValues( + out.expectShape(ShapeId.from("com.example#QueueAttributeName"))); + assertTrue(values.containsAll(ADDED)); + assertTrue(values.contains("All")); // originals preserved + } + + @Test + void addsValuesToStringEnumTrait() { + StringShape s = StringShape.builder() + .id("com.example#QueueAttributeName") + .addTrait(EnumTrait.builder() + .addEnum(EnumDefinition.builder().value("All").build()) + .addEnum(EnumDefinition.builder().value("Policy").build()) + .build()) + .build(); + Model m = Model.assembler().addShapes(s, sqsService()).assemble().unwrap(); + ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + + Model out = SqsTransforms.asTransform().apply(m, svc); + List values = EnumRenderer.getEnumValues( + out.expectShape(ShapeId.from("com.example#QueueAttributeName"))); + assertTrue(values.containsAll(ADDED)); + } + + @Test + void appendValuesRejectsNonIdentifierValue() { + EnumShape enumShape = EnumShape.builder() + .id("com.example#QueueAttributeName").addMember("All", "All").build(); + IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, + () -> TransformSupport.appendValues(enumShape, List.of("bad-value"))); + assertTrue(ex.getMessage().contains("bad-value")); + assertTrue(ex.getMessage().contains("com.example#QueueAttributeName")); + } + + @Test + void idempotent() { + EnumShape enumShape = EnumShape.builder() + .id("com.example#QueueAttributeName").addMember("All", "All").build(); + Model m = Model.assembler().addShapes(enumShape, sqsService()).assemble().unwrap(); + ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + + Model once = SqsTransforms.asTransform().apply(m, svc); + Model twice = SqsTransforms.asTransform().apply(once, svc); + long senderId = EnumRenderer.getEnumValues( + twice.expectShape(ShapeId.from("com.example#QueueAttributeName"))) + .stream().filter("SenderId"::equals).count(); + assertEquals(1, senderId); + } +} From e61fa21e71c7f01034d124979b64291693bcf676 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 19 Aug 2026 14:15:42 -0400 Subject: [PATCH 02/53] Smithy: recursively include nested container element types in CppTypeMapper Descend through nested list/map shapes so leaf struct/enum headers reach the generated header even through nested containers (e.g. apigateway Deployment.apiSummary: Map>), matching C2J's recursive unwrap. Recursion is bounded by container-nesting depth, and @sparse still pulls in at each nested container level. --- .../generators/model/CppTypeMapper.java | 55 ++++-- .../generators/model/CppTypeMapperTest.java | 160 ++++++++++++++++++ 2 files changed, 197 insertions(+), 18 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java index 12d7e3ce8cd..d215e88d875 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java @@ -275,24 +275,10 @@ public static List getIncludesForShape(Shape structureShape, Model model } } else { addMemberInclude(includes, target, selfId, model, projectName); - // For list/map, also include the element/key/value types - if (target.isListShape()) { - ListShape list = target.asListShape().get(); - addMemberInclude(includes, model.expectShape(list.getMember().getTarget()), - selfId, model, projectName); - } - if (target.isMapShape()) { - MapShape map = target.asMapShape().get(); - addMemberInclude(includes, model.expectShape(map.getKey().getTarget()), - selfId, model, projectName); - addMemberInclude(includes, model.expectShape(map.getValue().getTarget()), - selfId, model, projectName); - } - // A @sparse list/map wraps its element/value in Aws::Crt::Optional, declared in - // . Matches C2J's generated SparseNullsOperationRequest.h. - if ((target.isListShape() || target.isMapShape()) && target.hasTrait(SparseTrait.class)) { - includes.add(""); - } + // For list/map, recursively include every nested element/key/value type so leaf + // struct/enum headers reach the surface even through nested containers (e.g. + // apigateway Deployment.apiSummary: Map>). + addContainerIncludes(includes, target, selfId, model, projectName); } // @idempotencyToken members are brace-initialized with // Aws::Utils::UUID::PseudoRandomUUID(), which requires UUID.h. Matches C2J @@ -316,6 +302,39 @@ private static void addMemberInclude(Set includes, Shape shape, ShapeId } } + /** + * Recursively adds member-type includes for every nested element/key/value of a list or map + * shape. Recursion only descends through further list/map shapes and stops at + * structures/enums/scalars, so it is bounded by the container-nesting depth (no infinite + * recursion). {@code addMemberInclude} remains a no-op for container/scalar shapes without + * their own header. This lets a member typed, e.g., {@code Map>} + * reach {@code Leaf}'s header, matching C2J's recursive unwrap. + * + *

The {@code @sparse}->{@code } handling fires at each nested + * container level that is sparse, matching C2J's generated headers. + */ + private static void addContainerIncludes(Set includes, Shape target, ShapeId selfId, + Model model, String projectName) { + if (target.isListShape()) { + Shape elem = model.expectShape(target.asListShape().get().getMember().getTarget()); + addMemberInclude(includes, elem, selfId, model, projectName); + addContainerIncludes(includes, elem, selfId, model, projectName); + } else if (target.isMapShape()) { + MapShape map = target.asMapShape().get(); + Shape key = model.expectShape(map.getKey().getTarget()); + Shape value = model.expectShape(map.getValue().getTarget()); + addMemberInclude(includes, key, selfId, model, projectName); + addMemberInclude(includes, value, selfId, model, projectName); + addContainerIncludes(includes, key, selfId, model, projectName); + addContainerIncludes(includes, value, selfId, model, projectName); + } + // A @sparse list/map wraps its element/value in Aws::Crt::Optional, declared in + // . Matches C2J's generated SparseNullsOperationRequest.h. + if ((target.isListShape() || target.isMapShape()) && target.hasTrait(SparseTrait.class)) { + includes.add(""); + } + } + /** * Returns the sorted C++ class names of every direct member whose target forms a reference * cycle with {@code structureShape} (see {@link #isRecursiveStructMember}). These are stored diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java index d5e1754668d..d29a3b6a107 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java @@ -641,4 +641,164 @@ void getIncludesForShape_withMapMember_includesMapKeyAndValue() { assertTrue(includes.contains("")); assertTrue(includes.contains("")); } + + @Test + void getIncludesForShape_withNestedMapOfMap_includesLeafStructHeader() { + // apigateway Deployment.apiSummary is Map>. The outer + // map's value is itself a map (no header of its own), so a one-level unwrap stops before + // reaching the leaf struct MethodSnapshot and its header is dropped — an incomplete-type + // compile error. C2J recursively unwraps nested containers to include all leaf headers. + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape leaf = StructureShape.builder().id("com.example#MethodSnapshot").build(); + MapShape innerMap = MapShape.builder() + .id("com.example#MapOfMethodSnapshot") + .key(MemberShape.builder().id("com.example#MapOfMethodSnapshot$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#MapOfMethodSnapshot$value") + .target("com.example#MethodSnapshot").build()) + .build(); + MapShape outerMap = MapShape.builder() + .id("com.example#PathToMapOfMethodSnapshot") + .key(MemberShape.builder().id("com.example#PathToMapOfMethodSnapshot$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#PathToMapOfMethodSnapshot$value") + .target("com.example#MapOfMethodSnapshot").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#Deployment") + .addMember("apiSummary", outerMap.getId()) + .build(); + Model model = Model.builder().addShapes(str, leaf, innerMap, outerMap, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "apigateway"); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), + "nested map-of-map must include leaf struct header: " + includes); + } + + @Test + void getIncludesForShape_withListOfMap_includesLeafStructHeader() { + // List>: the list element is a map (no header), so the leaf struct + // header lives two container levels deep and requires recursive unwrapping. + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape leaf = StructureShape.builder().id("com.example#Item").build(); + MapShape map = MapShape.builder() + .id("com.example#ItemMap") + .key(MemberShape.builder().id("com.example#ItemMap$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#ItemMap$value").target("com.example#Item").build()) + .build(); + ListShape list = ListShape.builder() + .id("com.example#ListOfItemMap") + .member(MemberShape.builder().id("com.example#ListOfItemMap$member").target("com.example#ItemMap").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#MyRequest") + .addMember("rows", list.getId()) + .build(); + Model model = Model.builder().addShapes(str, leaf, map, list, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "myservice"); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), + "list-of-map must include leaf struct header: " + includes); + } + + @Test + void getIncludesForShape_withMapOfList_includesLeafStructHeader() { + // Map>: the map value is a list (no header), so recursive unwrap + // is needed to reach the leaf struct header. + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape leaf = StructureShape.builder().id("com.example#Item").build(); + ListShape list = ListShape.builder() + .id("com.example#ItemList") + .member(MemberShape.builder().id("com.example#ItemList$member").target("com.example#Item").build()) + .build(); + MapShape map = MapShape.builder() + .id("com.example#MapOfItemList") + .key(MemberShape.builder().id("com.example#MapOfItemList$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#MapOfItemList$value").target("com.example#ItemList").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#MyRequest") + .addMember("grouped", map.getId()) + .build(); + Model model = Model.builder().addShapes(str, leaf, list, map, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "myservice"); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), includes.toString()); + assertTrue(includes.contains(""), + "map-of-list must include leaf struct header: " + includes); + } + + @Test + void getIncludesForShape_withNestedSparseMap_includesOptionalHeader() { + // An inner @sparse map nested inside an outer map must still contribute ; + // the sparse handling fires at each nested container level. + StringShape str = StringShape.builder().id("com.example#Str").build(); + MapShape innerMap = MapShape.builder() + .id("com.example#SparseInnerMap") + .key(MemberShape.builder().id("com.example#SparseInnerMap$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#SparseInnerMap$value").target("com.example#Str").build()) + .addTrait(new software.amazon.smithy.model.traits.SparseTrait()) + .build(); + MapShape outerMap = MapShape.builder() + .id("com.example#OuterMap") + .key(MemberShape.builder().id("com.example#OuterMap$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#OuterMap$value").target("com.example#SparseInnerMap").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#MyRequest") + .addMember("data", outerMap.getId()) + .build(); + Model model = Model.builder().addShapes(str, innerMap, outerMap, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "myservice"); + assertTrue(includes.contains(""), + "nested sparse map must include Optional.h: " + includes); + } + + @Test + void getIncludesForShape_singleLevelMapOfStruct_unchanged() { + // Regression guard: a single-level Map must include exactly the same + // headers after the recursive-unwrap change as before it. + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape leaf = StructureShape.builder().id("com.example#Item").build(); + MapShape map = MapShape.builder() + .id("com.example#ItemMap") + .key(MemberShape.builder().id("com.example#ItemMap$key").target("com.example#Str").build()) + .value(MemberShape.builder().id("com.example#ItemMap$value").target("com.example#Item").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#MyRequest") + .addMember("data", map.getId()) + .build(); + Model model = Model.builder().addShapes(str, leaf, map, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "myservice"); + assertEquals(List.of( + "", + "", + ""), includes); + } + + @Test + void getIncludesForShape_singleLevelListOfStruct_unchanged() { + // Regression guard: a single-level List is unchanged by the recursive-unwrap. + StructureShape leaf = StructureShape.builder().id("com.example#Item").build(); + ListShape list = ListShape.builder() + .id("com.example#ItemList") + .member(MemberShape.builder().id("com.example#ItemList$member").target("com.example#Item").build()) + .build(); + StructureShape struct = StructureShape.builder() + .id("com.example#MyRequest") + .addMember("items", list.getId()) + .build(); + Model model = Model.builder().addShapes(leaf, list, struct).build(); + + List includes = CppTypeMapper.getIncludesForShape(struct, model, "myservice"); + assertEquals(List.of( + "", + ""), includes); + } } From f0c62c14e58b1f42327b1bb7a1228ee81a10d440 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 19 Aug 2026 14:15:43 -0400 Subject: [PATCH 03/53] Smithy: guard Windows-macro-colliding enum constants in EnumRenderer Emit #if defined(_WIN32) && defined(X) / #undef X guards for enum constants that collide with a Windows preprocessor macro (DynamoDB IN, EC2 interface, S3Crt IGNORE), mirroring C2J PlatformAndKeywordSanitizer.PREDEFINED_SYMBOLS_MAPPING and ModelEnumHeader.vm. --- .../generators/model/EnumRenderer.java | 43 ++++++++++++++++ .../generators/model/EnumRendererTest.java | 51 +++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java index 4901d639a66..043fb5585ab 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -50,6 +51,20 @@ public static void renderHeader(CppWriter writer, Shape enumShape, String servic writer.write("#include ", projectName, serviceName); writer.write(""); + + // Windows defines some enum values as preprocessor macros (e.g. EC2's `interface` via + // ). Undefine them so the generated enum constant compiles, matching C2J's + // ModelEnumHeader.vm predefined-symbol guard. + List windowsMacros = predefinedWindowsSymbols(serviceName, values); + if (!windowsMacros.isEmpty()) { + for (String macro : windowsMacros) { + writer.write("#if defined(_WIN32) && defined($L)", macro); + writer.write("#undef $L", macro); + writer.write("#endif"); + } + writer.write(""); + } + writer.write("namespace Aws {"); writer.write("namespace $L {", serviceName); writer.write("namespace Model {"); @@ -225,6 +240,34 @@ private static List getEnumWireValues(Shape enumShape) { "STATIC", "T_CHAR", "DOMAIN", "OVERFLOW", "WINDOWS" ); + /** + * Per-service enum constant names that collide with a Windows preprocessor macro and must be + * {@code #undef}'d in the enum header. Keyed by C++ service namespace, mirroring C2J + * PlatformAndKeywordSanitizer.PREDEFINED_SYMBOLS_MAPPING. + */ + private static final Map> PREDEFINED_WINDOWS_SYMBOLS = Map.of( + "DynamoDB", Set.of("IN"), + "EC2", Set.of("interface"), + "S3Crt", Set.of("IGNORE") + ); + + /** + * Returns, in enum-declaration order, the sanitized enum constant names of {@code values} that + * collide with a Windows macro for {@code serviceNamespace} (see + * {@link #PREDEFINED_WINDOWS_SYMBOLS}). Empty when the service has no such symbols. + * + * @param serviceNamespace the C++ service namespace (e.g., "EC2") + * @param values the sanitized enum constant names in declaration order + * @return the subset needing a {@code #undef} guard, preserving declaration order + */ + static List predefinedWindowsSymbols(String serviceNamespace, List values) { + Set symbols = PREDEFINED_WINDOWS_SYMBOLS.get(serviceNamespace); + if (symbols == null) { + return List.of(); + } + return values.stream().filter(symbols::contains).collect(Collectors.toList()); + } + /** * Sanitizes an enum wire value into a valid C++ identifier, matching C2J * PlatformAndKeywordSanitizer.fixEnumValue() behavior. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java index 35dd58fd79a..f22a5581945 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java @@ -327,4 +327,55 @@ void sanitizeEnumValue_handlesCorrectedForbiddenWords() { // Verify module (was misspelled as moduel) is now correctly forbidden assertEquals("module_", EnumRenderer.sanitizeEnumValue("module")); } + + @Test + void renderHeader_emitsWindowsUndefGuardForEc2InterfaceEnumValue() { + // EC2's NetworkInterfaceType has an `interface` value that collides with the Windows + // `interface` macro (); C2J's ModelEnumHeader.vm #undef's it. + EnumShape enumShape = EnumShape.builder() + .id("com.example#NetworkInterfaceType") + .addMember("interface", "interface") + .addMember("natGateway", "natGateway") + .build(); + CppWriter writer = new CppWriter(); + EnumRenderer.renderHeader(writer, enumShape, "EC2", "AWS_EC2_API", "ec2"); + String output = writer.toString(); + assertTrue(output.contains("#if defined(_WIN32) && defined(interface)"), + "Missing Windows guard for `interface`: " + output); + assertTrue(output.contains("#undef interface"), "Missing #undef interface: " + output); + assertTrue(output.contains("#endif"), "Missing #endif: " + output); + // The guard must sit before the namespace block, matching C2J. + assertTrue(output.indexOf("#undef interface") < output.indexOf("namespace Aws {"), + "#undef must precede the namespace block: " + output); + } + + @Test + void renderHeader_noWindowsUndefGuardForOtherServicesWithInterfaceValue() { + // The mapping is per-service: only EC2 gets the `interface` guard. A different service + // with the same enum value must not emit it (matches C2J's namespace-keyed mapping). + EnumShape enumShape = EnumShape.builder() + .id("com.example#SomeType") + .addMember("interface", "interface") + .build(); + CppWriter writer = new CppWriter(); + EnumRenderer.renderHeader(writer, enumShape, "TestService", "AWS_TESTSERVICE_API", "testservice"); + String output = writer.toString(); + assertFalse(output.contains("#undef interface"), + "Only EC2 should get the interface guard: " + output); + } + + @Test + void predefinedWindowsSymbols_matchesC2jNamespaceKeyedMapping() { + // EC2 -> interface, DynamoDB -> IN, S3Crt -> IGNORE; order follows the value list. + assertEquals(List.of("interface"), + EnumRenderer.predefinedWindowsSymbols("EC2", List.of("natGateway", "interface", "efa"))); + assertEquals(List.of("IN"), + EnumRenderer.predefinedWindowsSymbols("DynamoDB", List.of("EQ", "IN", "LE"))); + assertEquals(List.of("IGNORE"), + EnumRenderer.predefinedWindowsSymbols("S3Crt", List.of("IGNORE"))); + // No collisions -> empty. + assertTrue(EnumRenderer.predefinedWindowsSymbols("EC2", List.of("natGateway")).isEmpty()); + // Unknown service -> empty even if a value matches another service's symbol. + assertTrue(EnumRenderer.predefinedWindowsSymbols("TestService", List.of("interface")).isEmpty()); + } } From 7a486482cba6c1db924b54be71b3a77ce7e27f1d Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 19 Aug 2026 14:15:55 -0400 Subject: [PATCH 04/53] Smithy: honor per-service result-class suffix in ResultRenderer Name result classes and files via ShapeUtil.getResultSuffix instead of a hardcoded "Result", so services like EC2 emit *Response result classes, matching the legacy C2J generator. --- .../model/renderers/ResultRenderer.java | 9 +++--- .../generators/model/ResultRendererTest.java | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java index dbd565fe9b5..438c2244e3e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java @@ -5,6 +5,7 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.ShapeUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper; import com.amazonaws.util.awsclientsmithygenerator.generators.model.MemberRenderer; @@ -64,7 +65,7 @@ private String streamingPayloadMemberName(StructureShape shape) { private void renderHeader(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { - String className = operation.getId().getName() + "Result"; + String className = operation.getId().getName() + ShapeUtil.getResultSuffix(ctx.model(), operation, ctx.smithyServiceName()); String fileName = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; writerDelegator.useFileWriter(fileName, writer -> { writer.write("#pragma once"); @@ -139,7 +140,7 @@ private void renderHeader(CppWriterDelegator writerDelegator, private void renderSource(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { - String className = operation.getId().getName() + "Result"; + String className = operation.getId().getName() + ShapeUtil.getResultSuffix(ctx.model(), operation, ctx.smithyServiceName()); String fileName = "source/model/" + className + ".cpp"; writerDelegator.useFileWriter(fileName, writer -> { @@ -164,7 +165,7 @@ private void renderSource(CppWriterDelegator writerDelegator, */ private void renderStreamingHeader(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { - String className = operation.getId().getName() + "Result"; + String className = operation.getId().getName() + ShapeUtil.getResultSuffix(ctx.model(), operation, ctx.smithyServiceName()); String streamMember = streamingPayloadMemberName(shape); String fileName = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; writerDelegator.useFileWriter(fileName, writer -> { @@ -257,7 +258,7 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, */ private void renderStreamingSource(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { - String className = operation.getId().getName() + "Result"; + String className = operation.getId().getName() + ShapeUtil.getResultSuffix(ctx.model(), operation, ctx.smithyServiceName()); String streamField = CppNames.fieldName(streamingPayloadMemberName(shape)); String fileName = "source/model/" + className + ".cpp"; writerDelegator.useFileWriter(fileName, writer -> { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java index eeea14d4920..cbbe716190b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java @@ -57,6 +57,38 @@ private static String renderResultHeader(Trait protocolTrait) { .filter(p -> p.toString().endsWith("DoThingResult.h")).findFirst().orElseThrow()).orElseThrow(); } + /** Renders the result header for the one-member model under the given smithyServiceName. */ + private static java.util.List renderResultFileNames(Trait protocolTrait, String smithyServiceName) { + Model model = oneMemberOutputModel(protocolTrait); + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + Protocol protocol = ProtocolResolver.resolve(service, model); + new ResultRenderer( + ShapeClassifier.classify(model, service, protocol).results(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", smithyServiceName)).render(delegator); + delegator.flushWriters(); + return manifest.getFiles().stream().map(java.nio.file.Path::toString) + .collect(java.util.stream.Collectors.toList()); + } + + @Test + void ec2Result_usesResponseSuffix() { + // ShapeUtil.getResultSuffix returns "Response" for the ec2 service, so EC2 result + // classes/files must be named *Response, matching the legacy C2J generator. + java.util.List ec2Files = + renderResultFileNames(software.amazon.smithy.aws.traits.protocols.RestJson1Trait.builder().build(), "ec2"); + assertTrue(ec2Files.stream().anyMatch(f -> f.endsWith("DoThingResponse.h")), ec2Files.toString()); + assertTrue(ec2Files.stream().anyMatch(f -> f.endsWith("DoThingResponse.cpp")), ec2Files.toString()); + assertFalse(ec2Files.stream().anyMatch(f -> f.endsWith("DoThingResult.h")), ec2Files.toString()); + + // Non-ec2 services keep the "Result" suffix. + java.util.List otherFiles = + renderResultFileNames(software.amazon.smithy.aws.traits.protocols.RestJson1Trait.builder().build(), "example"); + assertTrue(otherFiles.stream().anyMatch(f -> f.endsWith("DoThingResult.h")), otherFiles.toString()); + } + @Test void cborResult_omitsHasBeenSetAccessors() { // C2J's CborResultHeader.vm sets useRequiredField=false, so result classes never emit From 75e457a2bb1a538f12cbbb70e9ad9a80b7803b59 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 19 Aug 2026 14:15:55 -0400 Subject: [PATCH 05/53] Smithy: blob-payload event rendering and dual-role sub-object requestId stamp Classify @streaming-union events whose sole payload is a single @eventPayload blob member as header-only blob-carrier events (C2J eventPayloadType == "blob") and render them via a new EventPayloadRenderer instead of as JSON sub-objects. Stamp the top-level requestId onto dual-role sub-objects (operation outputs also referenced as members) for JSON-family protocols, gated out for Query/EC2 which inject ResponseMetadata instead. MemberRenderer now renders the injected ResponseMetadata envelope as always-present (no HasBeenSet getter, flag true), initializes required-member flags in useRequiredField contexts, and keeps event stream / raw streaming payload flags false, matching C2J. --- .../generators/model/MemberRenderer.java | 80 +++++++++- .../generators/model/ModelGenerator.java | 4 +- .../generators/model/ShapeClassifier.java | 73 ++++++++- .../model/renderers/EventPayloadRenderer.java | 116 ++++++++++++++ .../model/renderers/SubObjectRenderer.java | 57 ++++++- .../model/EventPayloadRendererTest.java | 86 ++++++++++ .../generators/model/MemberRendererTest.java | 72 +++++++++ .../generators/model/ShapeClassifierTest.java | 147 ++++++++++++++++++ .../model/SubObjectRendererTest.java | 80 ++++++++++ 9 files changed, 697 insertions(+), 18 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java index 03221bf1fc6..6894d604f18 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java @@ -7,13 +7,16 @@ import static com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper.isPrimitive; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ListShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.HttpPayloadTrait; import software.amazon.smithy.model.traits.IdempotencyTokenTrait; import software.amazon.smithy.model.traits.SparseTrait; +import software.amazon.smithy.model.traits.StreamingTrait; import java.util.Map; @@ -102,7 +105,12 @@ public void renderPublicAccessors(CppWriter writer) { writer.write("inline const $L& Get$L() const { return $L; }", cppType, methodName, fieldName); } - if (emitHasBeenSet) { + // The framework-injected ResponseMetadata envelope is always present, so — like C2J — + // it gets no HasBeenSet getter (and its flag is initialized true, below). Every other + // member, including modeled @required ones, tracks presence via HasBeenSet, matching + // C2J's mass-clear of required-ness. `emitHasBeenSet` is the useRequiredField context + // (true for sub-objects/requests, false for results). + if (emitHasBeenSet && !isInjectedResponseMetadata(member)) { writer.write("inline bool $LHasBeenSet() const { return $LHasBeenSet; }", methodName, fieldName); } @@ -255,10 +263,25 @@ public void renderPrivateSection(CppWriter writer) { * {@code m_requestId} field and its {@code HasBeenSet} flag in the private section. */ public static void renderRequestIdAccessors(CppWriter writer, String className) { + renderRequestIdAccessors(writer, className, false); + } + + /** + * Renders the top-level {@code RequestId} accessor group. When {@code withHasBeenSetGetter} is + * {@code true}, the {@code inline bool RequestIdHasBeenSet() const} getter is emitted after the + * {@code GetRequestId} getter — the MODEL-class variant C2J stamps onto an operation-output + * shape that is also referenced as a member (dual-role sub-object). Result classes pass + * {@code false} (no {@code HasBeenSet} getter), matching {@link #forResult}. + */ + public static void renderRequestIdAccessors(CppWriter writer, String className, + boolean withHasBeenSetGetter) { writer.write(""); writer.write("///@{"); writer.write(""); writer.write("inline const Aws::String& GetRequestId() const { return m_requestId; }"); + if (withHasBeenSetGetter) { + writer.write("inline bool RequestIdHasBeenSet() const { return m_requestIdHasBeenSet; }"); + } writer.write("template "); writer.openBlock("void SetRequestId(RequestIdT&& value) {", "}", () -> { writer.write("m_requestIdHasBeenSet = true;"); @@ -299,14 +322,57 @@ private static void writeDataMember(CppWriter writer, MemberShape member, String } /** - * Writes a single HasBeenSet flag. {@code @idempotencyToken} members default to {@code true} - * because they are auto-populated at construction; all others default to {@code false}. - * Matches C2J's ModelClassMembersAndInlines.vm. + * Writes a single HasBeenSet flag. Matches C2J's ModelClassMembersAndInlines.vm: the flag is + * initialized to {@code true} for an {@code @idempotencyToken} member (auto-populated at + * construction) or a {@code @required} member in a useRequiredField context ({@code emitHasBeenSet} + * — sub-objects/requests, but not results), except when the member is an event stream or a raw + * streaming payload. All other members default to {@code false}. */ - private static void writeHasBeenSetFlag(CppWriter writer, MemberShape member, String memberName) { + private void writeHasBeenSetFlag(CppWriter writer, MemberShape member, String memberName) { String fieldName = CppNames.fieldName(memberName); - boolean initialValue = member.hasTrait(IdempotencyTokenTrait.class); - writer.write("bool $LHasBeenSet = $L;", fieldName, initialValue); + writer.write("bool $LHasBeenSet = $L;", fieldName, initialHasBeenSet(member)); + } + + /** True if this member's HasBeenSet flag is initialized to {@code true}. Mirrors C2J. */ + private boolean initialHasBeenSet(MemberShape member) { + if (isEventStreamMember(member) || isRawStreamingPayloadMember(member)) { + return false; + } + return member.hasTrait(IdempotencyTokenTrait.class) + || (emitHasBeenSet && isInjectedResponseMetadata(member)); + } + + /** + * True if this member is the framework-injected {@code ResponseMetadata} envelope + * ({@code GlobalTransforms.injectResponseMetadata}): a member named {@code ResponseMetadata} + * whose target is the injected {@code ResponseMetadata} structure. It is the only member + * rendered as always-present (no {@code HasBeenSet} getter; flag initialized true in a + * HasBeenSet context), matching C2J, which likewise identifies ResponseMetadata by name. + * {@code injectResponseMetadata} fails fast on any modeled ResponseMetadata collision, so this + * name-based check is unambiguous. + */ + private boolean isInjectedResponseMetadata(MemberShape member) { + return GlobalTransforms.RESPONSE_METADATA.equals(member.getMemberName()) + && GlobalTransforms.RESPONSE_METADATA.equals( + model.expectShape(member.getTarget()).getId().getName()); + } + + /** True if the member targets a {@code @streaming} union (an event stream member). */ + private boolean isEventStreamMember(MemberShape member) { + Shape target = model.expectShape(member.getTarget()); + return target.isUnionShape() && target.hasTrait(StreamingTrait.class); + } + + /** + * True if the member is a raw streaming {@code @httpPayload} (blob/string, or explicitly + * {@code @streaming}) that is not an event stream. Mirrors {@code ShapeClassifier}'s predicate. + */ + private boolean isRawStreamingPayloadMember(MemberShape member) { + if (!member.hasTrait(HttpPayloadTrait.class) || StreamingTrait.isEventStream(model, member)) { + return false; + } + Shape target = model.expectShape(member.getTarget()); + return target.isBlobShape() || target.isStringShape() || target.hasTrait(StreamingTrait.class); } /** diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java index f8e4eb7f84f..1b07839704d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java @@ -8,6 +8,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.ClassifiedShapes; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EnumShapeRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EventPayloadRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EventStreamRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.OutgoingEventStreamRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestRenderer; @@ -64,11 +65,12 @@ public void generateAll() { private List buildRenderers(ClassifiedShapes classified, RenderContext ctx) { List renderers = new ArrayList<>(); renderers.add(new EnumShapeRenderer(classified.enums(), ctx)); - renderers.add(new SubObjectRenderer(classified.subObjects(), ctx)); + renderers.add(new SubObjectRenderer(classified.subObjects(), classified.resultOutputIds(), ctx)); renderers.add(new RequestRenderer(classified.requests(), ctx)); renderers.add(new ResultRenderer(classified.results(), ctx)); renderers.add(new EventStreamRenderer(classified.eventStreamHandlers(), ctx)); renderers.add(new OutgoingEventStreamRenderer(classified.outgoingEventStreams(), ctx)); + renderers.add(new EventPayloadRenderer(classified.blobPayloadEvents(), ctx)); return renderers; } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index 5d57f27da33..0dc0eaf46ad 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -18,6 +18,7 @@ import software.amazon.smithy.model.shapes.UnionShape; import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.ErrorTrait; +import software.amazon.smithy.model.traits.EventPayloadTrait; import software.amazon.smithy.model.traits.HttpPayloadTrait; import software.amazon.smithy.model.traits.StreamingTrait; @@ -72,6 +73,13 @@ public record EventStreamInfo(String operationName, StructureShape requestShape, * @param enums EnumShape or StringShape with @enum trait * @param eventStreamHandlers operation + request/result shape tuples for event stream handlers * @param outgoingEventStreams outgoing event stream shapes (header only) + * @param blobPayloadEvents event structs (members of a {@code @streaming} union) whose sole + * payload is a single {@code @eventPayload} blob member; rendered + * header-only as a blob-carrier event (C2J {@code eventPayloadType == + * "blob"}), never as a JSON sub-object + * @param resultOutputIds shape ids of every operation output; a sub-object whose id is in + * this set is "dual-role" (an output that is also a member) and, for + * JSON-family protocols, receives the C2J {@code requestId} stamp */ public record ClassifiedShapes( List requests, @@ -79,7 +87,9 @@ public record ClassifiedShapes( List subObjects, List enums, List eventStreamHandlers, - List outgoingEventStreams + List outgoingEventStreams, + List blobPayloadEvents, + Set resultOutputIds ) {} private ShapeClassifier() {} @@ -109,6 +119,7 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto List enums = new ArrayList<>(); List eventStreamHandlers = new ArrayList<>(); List outgoingEventStreams = new ArrayList<>(); + List blobPayloadEvents = new ArrayList<>(); // Collect operation inputs/outputs and identify event stream handlers for (OperationShape op : index.getContainedOperations(service)) { @@ -151,15 +162,38 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto }); } + // Shape ids referenced as a member by any reachable shape (includes list/map element targets). + Set memberTargetIds = new HashSet<>(); + for (ShapeId id : reachable) { + model.expectShape(id).members().forEach(m -> memberTargetIds.add(m.getTarget())); + } + + // Structs that are members of a reachable @streaming union — i.e. events. A blob-payload + // event is only recognised among these (analogous to memberTargetIds but restricted to + // event unions), so a plain data struct that merely happens to carry an @eventPayload blob + // is never mis-claimed. + Set eventStructIds = new HashSet<>(); + for (ShapeId id : reachable) { + Shape shape = model.expectShape(id); + if (shape.isUnionShape() && shape.hasTrait(StreamingTrait.class)) { + shape.members().forEach(m -> eventStructIds.add(m.getTarget())); + } + } + // Walk all reachable shapes and classify remaining ones for (ShapeId id : reachable) { Shape shape = model.expectShape(id); - if (inputShapeIds.contains(id) || outputShapeIds.contains(id)) { - // Already classified as request/result above + if ((inputShapeIds.contains(id) || outputShapeIds.contains(id)) && !memberTargetIds.contains(id)) { + // classified as request/result and not referenced as a member — nothing more to emit } else if (shape.isEnumShape() || (shape.isStringShape() && shape.hasTrait(EnumTrait.class))) { enums.add(shape); } else if (outgoingEventStreamIds.contains(id)) { // Already collected as an outgoing event stream; do not also render as a data union. + } else if (isBlobPayloadEvent(shape, model, eventStructIds)) { + // A @streaming-union event whose payload is a single @eventPayload blob member is a + // header-only blob-carrier event (C2J eventPayloadType == "blob"), not a JSON + // sub-object. Routed here before the generic structure branch below. + blobPayloadEvents.add(shape); } else if (shape.hasTrait(ErrorTrait.class)) { if (isModeledException(shape.asStructureShape().get(), protocol)) { subObjects.add(shape); @@ -170,7 +204,7 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } return new ClassifiedShapes(requests, results, subObjects, enums, - eventStreamHandlers, outgoingEventStreams); + eventStreamHandlers, outgoingEventStreams, blobPayloadEvents, outputShapeIds); } /** @@ -212,6 +246,37 @@ private static boolean hasRawStreamingPayload(StructureShape shape, Model model) return false; } + /** + * True if {@code shape} is a blob-payload event: a structure that is a member of a reachable + * {@code @streaming} union (i.e. an event) and carries a member whose trait set includes + * {@code smithy.api#eventPayload} and whose target is a blob. This mirrors C2J's + * {@code eventPayloadType == "blob"} case (C2jModelToGeneratorModelTransformer): a blob member + * is a raw blob payload only when explicitly {@code @eventPayload}. Non-blob eventPayload + * events (e.g. a CompleteEvent with only string members) are NOT claimed — they remain + * sub-objects. + */ + private static boolean isBlobPayloadEvent(Shape shape, Model model, Set eventStructIds) { + if (!shape.isStructureShape() || !eventStructIds.contains(shape.getId())) { + return false; + } + return blobPayloadMemberName(shape.asStructureShape().get(), model).isPresent(); + } + + /** + * Returns the member name of the single {@code @eventPayload} blob member of {@code shape}, or + * empty if the shape has no such member. Used by both the classifier predicate and the + * blob-payload event renderer so they agree on which member becomes the blob payload. + */ + public static Optional blobPayloadMemberName(StructureShape shape, Model model) { + for (MemberShape member : shape.getAllMembers().values()) { + if (member.hasTrait(EventPayloadTrait.class) + && model.expectShape(member.getTarget()).isBlobShape()) { + return Optional.of(member.getMemberName()); + } + } + return Optional.empty(); + } + /** * Returns true if the structure has a member targeting a union with the @streaming trait * (i.e., an event stream member). diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java new file mode 100644 index 00000000000..820f6644f81 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java @@ -0,0 +1,116 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.MemberRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.DocumentationTrait; + +import java.util.List; + +/** + * Renders header-only blob-carrier events: an event struct (member of a {@code @streaming} union) + * whose sole payload is a single {@code @eventPayload} blob member (C2J {@code eventPayloadType == + * "blob"}). C2J renders these via {@code EventHeader.vm} as a plain value type carrying an + * {@code Aws::Vector} payload — a bytes constructor, non-template const-ref / rvalue + * accessors, and a {@code GetWithOwnership()} move-out — with NO {@code Jsonize} / + * {@code JsonView} serde and NO {@code .cpp}. + * + *

These shapes are routed here by {@link ShapeClassifier} instead of {@code subObjects}, so the + * generic {@code SubObjectRenderer} JSON path never sees them. + */ +public final class EventPayloadRenderer implements ShapeRenderer { + + private final List blobPayloadEvents; + private final RenderContext ctx; + + public EventPayloadRenderer(List blobPayloadEvents, RenderContext ctx) { + this.blobPayloadEvents = blobPayloadEvents; + this.ctx = ctx; + } + + @Override + public void render(CppWriterDelegator writerDelegator) { + for (Shape shape : blobPayloadEvents) { + shape.asStructureShape().ifPresent(s -> renderHeader(writerDelegator, s)); + } + } + + private void renderHeader(CppWriterDelegator writerDelegator, StructureShape shape) { + String className = CppTypeMapper.cppShapeName(shape); + String memberName = ShapeClassifier.blobPayloadMemberName(shape, ctx.model()) + .orElseThrow(() -> new IllegalStateException( + "Blob-payload event " + shape.getId() + " has no @eventPayload blob member")); + MemberShape payload = shape.getAllMembers().get(memberName); + String methodName = CppNames.capitalize(memberName); + String fieldName = CppNames.fieldName(memberName); + String fileName = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; + + writerDelegator.useFileWriter(fileName, writer -> { + writer.write("#pragma once"); + java.util.List includes = new java.util.ArrayList<>(); + includes.add("aws/core/utils/Array.h"); + includes.add("aws/" + ctx.smithyServiceName() + "/" + ctx.namespace() + "_EXPORTS.h"); + IncludeSets.emitAngleIncludes(writer, includes); + writer.write(""); + writer.write("#include "); + writer.write(""); + + ModelFile.modelNamespace(writer, ctx.namespace(), () -> { + MemberRenderer.renderClassDocComment(writer, shape, ctx.smithyServiceName(), ctx.service().getVersion()); + writer.openBlock("class $L {", "};", className, () -> { + writer.write("public:"); + writer.write("$L $L() = default;", ctx.exportMacro(), className); + writer.write("$L $L(Aws::Vector&& value) { $L = std::move(value); }", + ctx.exportMacro(), className, fieldName); + writer.write(""); + writer.write("///@{"); + writeMemberDoc(writer, payload); + writer.write("inline const Aws::Vector& Get$L() const { return $L; }", + methodName, fieldName); + writer.write("inline Aws::Vector&& Get$LWithOwnership() { return std::move($L); }", + methodName, fieldName); + writer.write("inline void Set$L(const Aws::Vector& value) { $LHasBeenSet = true; $L = value; }", + methodName, fieldName, fieldName); + writer.write("inline void Set$L(Aws::Vector&& value) { $LHasBeenSet = true; $L = std::move(value); }", + methodName, fieldName, fieldName); + writer.write("inline $L& With$L(const Aws::Vector& value) { Set$L(value); return *this;}", + className, methodName, methodName); + writer.write("inline $L& With$L(Aws::Vector&& value) { Set$L(std::move(value)); return *this;}", + className, methodName, methodName); + writer.write("///@}"); + writer.write(""); + writer.dedent(); + writer.write("private:"); + writer.indent(); + writer.write("Aws::Vector $L;", fieldName); + writer.write("bool $LHasBeenSet = false;", fieldName); + }); + writer.write(""); + }); + }); + } + + /** + * Emits the payload member's doc comment. Matches C2J's {@code EventHeader.vm}, which always + * renders a {@code /** ... *}{@code /} block from the member's {@code @documentation} + * (whitespace-collapsed). + */ + private void writeMemberDoc(CppWriter writer, MemberShape payload) { + String doc = payload.getTrait(DocumentationTrait.class) + .map(t -> MemberRenderer.collapseWhitespace(t.getValue())) + .orElse(""); + MemberRenderer.writeDocComment(writer, doc); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java index 837c62e72f2..7a6dfdbf970 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java @@ -12,9 +12,11 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.traits.StreamingTrait; import java.util.List; +import java.util.Set; /** * Renders C++ headers and sources for sub-object (intermediate structure) shapes. @@ -22,13 +24,20 @@ public final class SubObjectRenderer implements ShapeRenderer { private final List subObjects; + private final Set resultOutputIds; private final RenderContext ctx; - public SubObjectRenderer(List subObjects, RenderContext ctx) { + public SubObjectRenderer(List subObjects, Set resultOutputIds, RenderContext ctx) { this.subObjects = subObjects; + this.resultOutputIds = resultOutputIds; this.ctx = ctx; } + /** Convenience overload for callers with no dual-role output shapes (e.g. characterization tests). */ + public SubObjectRenderer(List subObjects, RenderContext ctx) { + this(subObjects, java.util.Collections.emptySet(), ctx); + } + @Override public void render(CppWriterDelegator writerDelegator) { for (Shape shape : subObjects) { @@ -48,12 +57,22 @@ public void render(CppWriterDelegator writerDelegator) { private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { String className = CppTypeMapper.cppShapeName(shape); String fileName = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; + // A shape that is BOTH an operation output AND referenced as a member ("dual-role") is + // stamped with the top-level requestId by C2J — but only for JSON-family protocols. Query/EC2 + // instead inject a ResponseMetadata member (GlobalTransforms.injectResponseMetadata), so they + // are gated out here via resultHasTopLevelRequestId(). + boolean stampRequestId = resultOutputIds.contains(shape.getId()) + && ctx.protocolTraits().resultHasTopLevelRequestId(); writerDelegator.useFileWriter(fileName, writer -> { writer.write("#pragma once"); // Includes List includes = new java.util.ArrayList<>(); includes.add("aws/" + ctx.smithyServiceName() + "/" + ctx.namespace() + "_EXPORTS.h"); + if (stampRequestId) { + // The stamped m_requestId is an Aws::String; mirror the result-header include hygiene. + includes.add("aws/core/utils/memory/stl/AWSString.h"); + } for (String memberInc : CppTypeMapper.getIncludesForShape(shape, ctx.model(), ctx.smithyServiceName())) { includes.add(memberInc); } @@ -86,16 +105,42 @@ private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { ctx.protocolTraits().writeSerdeMethodDecls(writer, ctx.exportMacro(), className, null); // A memberless shape ends right after its serde decls: C2J emits no accessors // and no private: section (ModelClassMembersAndInlines.vm gates both on - // $shape.members.size() > 0). - if (!shape.getAllMembers().isEmpty()) { + // $shape.members.size() > 0) — unless it is a dual-role output, in which case the + // stamped requestId group still needs a private: section. + boolean hasMembers = !shape.getAllMembers().isEmpty(); + if (hasMembers || stampRequestId) { MemberRenderer members = MemberRenderer.forStructure(ctx.model(), shape, className) .wideIntegers(ctx.protocolTraits().widensIntegers()); - writer.write(""); - members.renderPublicAccessors(writer); + if (hasMembers) { + writer.write(""); + members.renderPublicAccessors(writer); + } + if (stampRequestId) { + // MODEL-class requestId group (includes the RequestIdHasBeenSet() getter), + // emitted after the modeled-member accessors. The helper writes its own + // leading blank-line separator. + MemberRenderer.renderRequestIdAccessors(writer, className, true); + } writer.dedent(); writer.write("private:"); writer.indent(); - members.renderPrivateSection(writer); + if (hasMembers) { + members.renderDataMembers(writer); + } + if (stampRequestId) { + // m_requestId trails the modeled data members (blank-line separated, matching + // MemberRenderer's data-member spacing); its flag trails the modeled flags. + if (hasMembers) { + writer.write(""); + } + writer.write("Aws::String m_requestId;"); + } + if (hasMembers) { + members.renderHasBeenSetFlags(writer); + } + if (stampRequestId) { + writer.write("bool m_requestIdHasBeenSet = false;"); + } } }); writer.write(""); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java new file mode 100644 index 00000000000..0b4bf2a5e11 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java @@ -0,0 +1,86 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.ProtocolTraits; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EventPayloadRenderer; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.build.MockManifest; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.BlobShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.EventPayloadTrait; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies {@link EventPayloadRenderer} produces a header-only blob-carrier event (C2J + * {@code EventHeader.vm} form): an {@code Aws::Vector} payload with a bytes + * constructor, non-template accessors, and a {@code GetWithOwnership()} move-out — and + * NO JSON serde and NO {@code .cpp}. + */ +class EventPayloadRendererTest { + + private static Model model() { + BlobShape blob = BlobShape.builder().id("com.example#Blob").build(); + StructureShape event = StructureShape.builder() + .id("com.example#InvokeResponseStreamUpdate") + .addTrait(new DocumentationTrait("

A chunk of the streamed response payload.

")) + .addMember(MemberShape.builder() + .id("com.example#InvokeResponseStreamUpdate$Payload").target(blob.getId()) + .addTrait(new EventPayloadTrait()) + .addTrait(new DocumentationTrait("

Data returned by your Lambda function.

")) + .build()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2015-03-31").build(); + return Model.builder().addShapes(blob, event, service).build(); + } + + private static String renderHeader() { + Model model = model(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + ProtocolTraits traits = ProtocolResolver.traitsFor(Protocol.JSON); + new EventPayloadRenderer( + java.util.List.of(model.expectShape(ShapeId.from("com.example#InvokeResponseStreamUpdate"))), + new RenderContext(model, service, traits, "Lambda", "AWS_LAMBDA_API", "lambda")) + .render(delegator); + delegator.flushWriters(); + java.util.Map out = new java.util.TreeMap<>(); + for (java.nio.file.Path path : manifest.getFiles()) { + out.put(path.getFileName().toString(), manifest.getFileString(path).orElseThrow()); + } + assertFalse(out.containsKey("InvokeResponseStreamUpdate.cpp"), + "Blob-payload event must be header-only (no .cpp): " + out.keySet()); + return out.get("InvokeResponseStreamUpdate.h"); + } + + @Test + void rendersBlobCarrierHeader() { + String h = renderHeader(); + assertTrue(h.contains("Aws::Vector"), h); + assertTrue(h.contains("InvokeResponseStreamUpdate(Aws::Vector&& value)"), h); + assertTrue(h.contains("GetPayloadWithOwnership"), h); + assertTrue(h.contains("bool m_payloadHasBeenSet = false;"), h); + // Payload member documentation flows through. + assertTrue(h.contains("Data returned by your Lambda function."), h); + } + + @Test + void hasNoJsonSerde() { + String h = renderHeader(); + assertFalse(h.contains("Jsonize"), h); + assertFalse(h.contains("JsonView"), h); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java index 7bd57f1e0cc..598095009a8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java @@ -394,4 +394,76 @@ void renderRequestIdAccessors_emitsTemplatedGetSetWith() { assertTrue(out.contains("///@{")); assertTrue(out.contains("///@}")); } + + /** + * A structure carrying: the framework ResponseMetadata envelope member (targeting a + * ResponseMetadata structure), a modeled {@code @required} member, and a plain member. + */ + private static Model responseMetadataModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape responseMetadata = StructureShape.builder() + .id("com.example#ResponseMetadata") + .addMember(MemberShape.builder() + .id("com.example#ResponseMetadata$RequestId").target(str.getId()).build()) + .build(); + StructureShape shape = StructureShape.builder() + .id("com.example#MyShape") + .addMember(MemberShape.builder() + .id("com.example#MyShape$ResponseMetadata").target(responseMetadata.getId()).build()) + .addMember(MemberShape.builder() + .id("com.example#MyShape$RequiredName").target(str.getId()) + .addTrait(new software.amazon.smithy.model.traits.RequiredTrait()).build()) + .addMember(MemberShape.builder() + .id("com.example#MyShape$Name").target(str.getId()).build()) + .build(); + return Model.builder().addShapes(str, responseMetadata, shape).build(); + } + + private static StructureShape myShape(Model model) { + return model.expectShape( + software.amazon.smithy.model.shapes.ShapeId.from("com.example#MyShape"), StructureShape.class); + } + + @Test + void injectedResponseMetadata_inStructure_omitsGetter_whileOthersKeepIt() { + // The injected ResponseMetadata envelope is always present -> no HasBeenSet getter. A + // modeled @required member is NOT special-cased (C2J clears required), so it keeps its + // getter just like a plain member. + Model model = responseMetadataModel(); + CppWriter writer = new CppWriter(); + MemberRenderer.forStructure(model, myShape(model), "MyShape").renderPublicAccessors(writer); + String out = writer.toString(); + assertFalse(out.contains("ResponseMetadataHasBeenSet()"), + "injected ResponseMetadata must not get a HasBeenSet getter: " + out); + assertTrue(out.contains("inline bool RequiredNameHasBeenSet() const"), + "modeled @required member must still get a HasBeenSet getter: " + out); + assertTrue(out.contains("inline bool NameHasBeenSet() const"), + "plain member must get a HasBeenSet getter: " + out); + } + + @Test + void injectedResponseMetadata_inStructure_initsFlagTrue_whileOthersFalse() { + Model model = responseMetadataModel(); + CppWriter writer = new CppWriter(); + MemberRenderer.forStructure(model, myShape(model), null).renderHasBeenSetFlags(writer); + String out = writer.toString(); + assertTrue(out.contains("bool m_responseMetadataHasBeenSet = true;"), + "injected ResponseMetadata flag must init true: " + out); + assertTrue(out.contains("bool m_requiredNameHasBeenSet = false;"), + "modeled @required member flag must init false: " + out); + assertTrue(out.contains("bool m_nameHasBeenSet = false;"), + "plain member flag must init false: " + out); + } + + @Test + void injectedResponseMetadata_inResult_initsFlagFalse() { + // Results use useRequiredField=false (emitHasBeenSet=false), so even the injected + // ResponseMetadata inits false there (and results emit no HasBeenSet getters). + Model model = responseMetadataModel(); + CppWriter writer = new CppWriter(); + MemberRenderer.forResult(model, myShape(model), null).renderHasBeenSetFlags(writer); + String out = writer.toString(); + assertTrue(out.contains("bool m_responseMetadataHasBeenSet = false;"), + "injected ResponseMetadata flag stays false in a result context: " + out); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java index 7c709a1e062..d00b8c63544 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java @@ -423,6 +423,153 @@ void noInputOperation_stillProducesRequest() { "Expected a RequestInfo for the no-input operation Ping"); } + /** + * A structure that is BOTH an operation output AND referenced as a member (via a list + * element). Mirrors Lambda's FunctionConfiguration, which is the output of + * GetFunctionConfiguration and also the element of FunctionList / a member of another + * response. Such a dual-role shape must end up in BOTH results (per-op output) and + * subObjects (standalone model file), matching C2J. + */ + private Model buildDualRoleModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + // Thing is the output of GetThing AND the element of ThingList. + StructureShape thing = StructureShape.builder() + .id("com.example#Thing") + .addMember("name", str.getId()) + .build(); + ListShape thingList = ListShape.builder() + .id("com.example#ThingList") + .member(thing.getId()) + .build(); + StructureShape getThingRequest = StructureShape.builder() + .id("com.example#GetThingRequest") + .addMember("id", str.getId()) + .build(); + StructureShape listThingsRequest = StructureShape.builder() + .id("com.example#ListThingsRequest") + .build(); + StructureShape listThingsResponse = StructureShape.builder() + .id("com.example#ListThingsResponse") + .addMember("things", thingList.getId()) + .build(); + OperationShape getThing = OperationShape.builder() + .id("com.example#GetThing") + .input(getThingRequest.getId()) + .output(thing.getId()) + .build(); + OperationShape listThings = OperationShape.builder() + .id("com.example#ListThings") + .input(listThingsRequest.getId()) + .output(listThingsResponse.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService") + .version("2023-01-01") + .addOperation(getThing.getId()) + .addOperation(listThings.getId()) + .addTrait(ServiceTrait.builder().sdkId("test").arnNamespace("test").cloudFormationName("Test").cloudTrailEventSource("test").build()) + .build(); + return Model.builder() + .addShapes(str, thing, thingList, getThingRequest, listThingsRequest, listThingsResponse, getThing, listThings, service) + .build(); + } + + @Test + void dualRoleOutputAndMember_appearsInBothResultsAndSubObjects() { + Model model = buildDualRoleModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertTrue(classified.results().stream() + .anyMatch(r -> r.shape().getId().getName().equals("Thing")), + "Dual-role Thing must be classified as a result (GetThing output): " + classified.results()); + assertTrue(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("Thing")), + "Dual-role Thing must also be classified as a sub-object (referenced via ThingList): " + + classified.subObjects()); + } + + @Test + void outputOnly_appearsInResultsButNotSubObjects() { + // GetItemResponse is ONLY an operation output; it is not referenced as a member anywhere. + Model model = buildSimpleModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertTrue(classified.results().stream() + .anyMatch(r -> r.shape().getId().getName().equals("GetItemResponse")), + "Output-only GetItemResponse must be in results"); + assertTrue(classified.subObjects().stream() + .noneMatch(s -> s.getId().getName().equals("GetItemResponse")), + "Output-only GetItemResponse must NOT be over-emitted as a sub-object: " + classified.subObjects()); + } + + /** + * A @streaming union with two event members: one whose sole payload is an @eventPayload blob + * (like Lambda's InvokeResponseStreamUpdate / the PayloadChunk member) and one with only a + * plain string member (like a CompleteEvent). Bound to an operation output so both event + * structs are reachable. + */ + private Model eventStreamBlobPayloadModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + BlobShape blob = BlobShape.builder().id("com.example#Blob").build(); + // Blob-payload event: single @eventPayload blob member. + StructureShape updateEvent = StructureShape.builder() + .id("com.example#UpdateEvent") + .addMember(MemberShape.builder() + .id("com.example#UpdateEvent$Payload").target(blob.getId()) + .addTrait(new EventPayloadTrait()).build()) + .build(); + // Non-blob event: plain string member -> must stay a sub-object. + StructureShape completeEvent = StructureShape.builder() + .id("com.example#CompleteEvent") + .addMember("Details", str.getId()) + .build(); + UnionShape eventStream = UnionShape.builder() + .id("com.example#ResponseStreamEvent") + .addTrait(new StreamingTrait()) + .addMember("PayloadChunk", updateEvent.getId()) + .addMember("Complete", completeEvent.getId()) + .build(); + StructureShape request = StructureShape.builder() + .id("com.example#InvokeRequest").addMember("name", str.getId()).build(); + StructureShape response = StructureShape.builder() + .id("com.example#InvokeResponse").addMember("events", eventStream.getId()).build(); + OperationShape op = OperationShape.builder() + .id("com.example#Invoke").input(request.getId()).output(response.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2023-01-01").addOperation(op.getId()) + .addTrait(ServiceTrait.builder().sdkId("test").arnNamespace("test").cloudFormationName("Test").cloudTrailEventSource("test").build()) + .build(); + return Model.builder() + .addShapes(str, blob, updateEvent, completeEvent, eventStream, request, response, op, service) + .build(); + } + + @Test + void blobEventPayload_isClassifiedAsBlobPayloadEventNotSubObject() { + Model model = eventStreamBlobPayloadModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertTrue(classified.blobPayloadEvents().stream() + .anyMatch(s -> s.getId().getName().equals("UpdateEvent")), + "Blob @eventPayload event must be in blobPayloadEvents: " + classified.blobPayloadEvents()); + assertTrue(classified.subObjects().stream() + .noneMatch(s -> s.getId().getName().equals("UpdateEvent")), + "Blob @eventPayload event must NOT be a sub-object: " + classified.subObjects()); + } + + @Test + void nonBlobEvent_staysSubObject() { + Model model = eventStreamBlobPayloadModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertTrue(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("CompleteEvent")), + "Non-blob event struct must stay a sub-object: " + classified.subObjects()); + assertTrue(classified.blobPayloadEvents().stream() + .noneMatch(s -> s.getId().getName().equals("CompleteEvent")), + "Non-blob event struct must NOT be a blob-payload event: " + classified.blobPayloadEvents()); + } + @Test void classifiesEnumShape() { // StringShape with @enum trait -> classified as enum diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java index 9052f7abd91..6bd4b31f34e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StringShape; @@ -19,6 +20,7 @@ import software.amazon.smithy.model.shapes.UnionShape; import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.traits.StreamingTrait; +import software.amazon.smithy.model.traits.Trait; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -168,4 +170,82 @@ void streamingUnion_isNotRenderedBySubObjectRenderer() { assertFalse(files.containsKey("BidirectionalInput.cpp"), "Streaming union must NOT be rendered by SubObjectRenderer: " + files.keySet()); } + + // --- dual-role (operation output that is also a member) requestId stamp --- + + /** + * A model where {@code Thing} is BOTH the output of {@code DoThing} AND a member of {@code Plain} + * (dual-role: an output referenced as a member). {@code Plain} is a plain member-only sub-object. + * The service carries the given protocol trait. + */ + private static Model dualRoleModel(Trait protocolTrait) { + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape thing = StructureShape.builder() + .id("com.example#Thing").addMember("name", str.getId()).build(); + // Plain references Thing (making Thing a member target) and is itself a member of the input, + // so both Plain and Thing are reachable sub-objects; only Thing is an operation output. + StructureShape plain = StructureShape.builder() + .id("com.example#Plain") + .addMember("label", str.getId()) + .addMember("thing", thing.getId()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoThingInput").addMember("plain", plain.getId()).build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(thing.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(protocolTrait).addOperation(op.getId()).build(); + return Model.builder().addShapes(str, thing, plain, input, op, service).build(); + } + + /** Classifies {@code dualRoleModel} and renders its sub-objects, returning filename -> content. */ + private static java.util.Map renderDualRole(Trait protocolTrait) { + Model model = dualRoleModel(protocolTrait); + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + Protocol protocol = ProtocolResolver.resolve(service, model); + ShapeClassifier.ClassifiedShapes classified = ShapeClassifier.classify(model, service, protocol); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + new SubObjectRenderer(classified.subObjects(), classified.resultOutputIds(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", "example")).render(delegator); + delegator.flushWriters(); + java.util.Map out = new java.util.TreeMap<>(); + for (java.nio.file.Path path : manifest.getFiles()) { + out.put(path.getFileName().toString(), manifest.getFileString(path).orElseThrow()); + } + return out; + } + + @Test + void dualRoleOutput_jsonProtocol_stampsRequestId() { + String h = renderDualRole( + software.amazon.smithy.aws.traits.protocols.RestJson1Trait.builder().build()).get("Thing.h"); + assertTrue(h.contains("inline const Aws::String& GetRequestId() const { return m_requestId; }"), h); + assertTrue(h.contains("inline bool RequestIdHasBeenSet() const { return m_requestIdHasBeenSet; }"), h); + assertTrue(h.contains("Aws::String m_requestId;"), h); + assertTrue(h.contains("bool m_requestIdHasBeenSet = false;"), h); + // The stamped Aws::String field pulls in AWSString.h. + assertTrue(h.contains("#include "), h); + } + + @Test + void memberOnlySubObject_jsonProtocol_hasNoRequestId() { + String h = renderDualRole( + software.amazon.smithy.aws.traits.protocols.RestJson1Trait.builder().build()).get("Plain.h"); + assertFalse(h.contains("GetRequestId"), + "A member-only (non-output) sub-object must not receive the requestId stamp: " + h); + assertFalse(h.contains("m_requestId"), h); + } + + @Test + void dualRoleOutput_queryProtocol_hasNoRequestId() { + // Query/EC2 dual-role outputs get a ResponseMetadata member instead (injectResponseMetadata), + // so resultHasTopLevelRequestId() is false and no requestId block is stamped here. + String h = renderDualRole( + new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait()).get("Thing.h"); + assertFalse(h.contains("GetRequestId"), + "Query dual-role output must not receive the requestId stamp: " + h); + } } From 34f7dcebb8e5de98ddc809bafae33866e823239f Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 24 Aug 2026 13:36:26 -0400 Subject: [PATCH 06/53] Smithy: EC2 transforms fast-fail on Result/Response and SecureBlob collisions Smithy: renameMember fast-fails on member collision, adds jsonName overload --- .../model/transforms/Ec2Transforms.java | 32 ++++++---- .../model/transforms/TransformSupport.java | 35 +++++++++-- .../model/transforms/Ec2TransformsTest.java | 43 ++++++------- .../transforms/TransformSupportTest.java | 60 +++++++++++++++++++ 4 files changed, 134 insertions(+), 36 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java index 6a007880881..49d7cd1607a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java @@ -37,9 +37,11 @@ * ({@code ec2//service-2.json}) marks {@code UserData} sensitive via * {@code SecureBlobAttributeValue -> SecureBlob (@sensitive)}, but the upstream Smithy model * ({@code ec2/smithy/model.json}) still targets the non-sensitive {@code BlobAttributeValue}. This - * transform mirrors the C2J modeling in the Smithy model so generated code matches. It self-retires - * (no-op) once the upstream Smithy model catches up, and is a temporary compensation for that - * upstream data lag — see docs/superpowers/plans/parity-deltas.md. + * transform mirrors the C2J modeling in the Smithy model so generated code matches. It is a + * temporary compensation for that upstream data lag; once the upstream Smithy model catches up and + * already defines {@code SecureBlobAttributeValue}, this transform throws {@code IllegalStateException} + * so a human removes it rather than letting it silently self-retire — see + * docs/superpowers/plans/parity-deltas.md. */ public final class Ec2Transforms { @@ -64,9 +66,11 @@ private static Model apply(Model model, ServiceShape service) { * {@code BlobAttributeValue}; after repointing, {@code BlobAttributeValue} is no longer * referenced and drops out of the reachable (emitted) set, exactly as it does in C2J. * - *

No-op — leaving the model untouched — when {@code SecureBlobAttributeValue} already exists - * (upstream Smithy caught up) or {@code UserData} no longer targets {@code BlobAttributeValue}, - * so the transform cannot introduce a duplicate shape or fight a corrected upstream model. + *

Throws {@code IllegalStateException} when {@code SecureBlobAttributeValue} already exists + * (upstream Smithy caught up), signalling this compensating transform is obsolete and must be + * removed. No-op — leaving the model untouched — when {@code ModifyInstanceAttributeRequest} or + * its {@code UserData} member is absent, or {@code UserData} no longer targets + * {@code BlobAttributeValue} (source-absent, not a collision). */ private static Model addSecureBlobUserData(Model model) { Optional requestOpt = model.shapes(StructureShape.class) @@ -86,8 +90,13 @@ private static Model addSecureBlobUserData(Model model) { ShapeId secureStructId = ShapeId.fromParts(namespace, "SecureBlobAttributeValue"); ShapeId blobAttrId = ShapeId.fromParts(namespace, "BlobAttributeValue"); - if (model.getShape(secureStructId).isPresent() || !userData.getTarget().equals(blobAttrId)) { - return model; + if (model.getShape(secureStructId).isPresent()) { + throw new IllegalStateException("EC2 SecureBlobAttributeValue already exists in the model; " + + "the upstream Smithy model has caught up and this compensating transform is obsolete " + + "and must be removed."); + } + if (!userData.getTarget().equals(blobAttrId)) { + return model; // UserData no longer targets BlobAttributeValue: nothing to repoint (no-op). } MemberShape originalValue = model.expectShape(blobAttrId, StructureShape.class) .getAllMembers().get("Value"); @@ -122,9 +131,12 @@ private static Model renameResultShapesToResponse(Model model) { if (name.endsWith("Result")) { String target = name.substring(0, name.length() - "Result".length()) + "Response"; ShapeId targetId = ShapeId.fromParts(shape.getId().getNamespace(), target); - if (!model.getShape(targetId).isPresent()) { - renames.put(shape.getId(), targetId); + if (model.getShape(targetId).isPresent()) { + throw new IllegalStateException("EC2 *Result->*Response rename collision: '" + + targetId + "' already exists (would clobber '" + shape.getId() + + "'). Upstream model likely changed; review the EC2 transform."); } + renames.put(shape.getId(), targetId); } } if (renames.isEmpty()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java index c82fe57454d..dd1d5aa35aa 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -81,18 +81,43 @@ static Optional appendValues(Shape enumShape, List values) { /** * Returns a copy of {@code struct} with member {@code oldName} renamed to {@code newName}, * preserving member declaration order and copying all traits onto the renamed member. Returns - * {@link Optional#empty()} if {@code oldName} is absent or {@code newName} already exists. + * {@link Optional#empty()} if {@code oldName} is absent (nothing to rename). + * + * @throws IllegalStateException if {@code newName} is already a distinct member — a genuine + * collision that would silently drop a member. Callers must not mask this. */ static Optional renameMember(StructureShape struct, String oldName, String newName) { - if (struct.getMember(oldName).isEmpty() || struct.getMember(newName).isPresent()) { + return renameMember(struct, oldName, newName, new software.amazon.smithy.model.traits.Trait[0]); + } + + /** + * As {@link #renameMember(StructureShape, String, String)}, additionally attaching + * {@code extraTraits} to the renamed member (e.g. a {@code @jsonName} to preserve the original + * wire name when the C++ member name changes). Existing member traits are copied first, then the + * extras are added. + */ + static Optional renameMember(StructureShape struct, String oldName, String newName, + software.amazon.smithy.model.traits.Trait... extraTraits) { + if (struct.getMember(oldName).isEmpty()) { return Optional.empty(); } + if (struct.getMember(newName).isPresent()) { + throw new IllegalStateException("Cannot rename member '" + oldName + "' to '" + newName + + "' on " + struct.getId() + ": a distinct '" + newName + "' member already exists"); + } StructureShape.Builder builder = StructureShape.builder().id(struct.getId()); struct.getAllTraits().values().forEach(builder::addTrait); for (MemberShape member : struct.getAllMembers().values()) { - String name = member.getMemberName().equals(oldName) ? newName : member.getMemberName(); - builder.addMember(name, member.getTarget(), - b -> member.getAllTraits().values().forEach(b::addTrait)); + boolean isTarget = member.getMemberName().equals(oldName); + String name = isTarget ? newName : member.getMemberName(); + builder.addMember(name, member.getTarget(), b -> { + member.getAllTraits().values().forEach(b::addTrait); + if (isTarget) { + for (software.amazon.smithy.model.traits.Trait t : extraTraits) { + b.addTrait(t); + } + } + }); } return Optional.of(builder.build()); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java index 0dbe9184ba3..0f0e352e7c9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java @@ -72,18 +72,23 @@ void renamesNestedResultStructToResponse() { } @Test - void collisionGuardLeavesResultUnchangedWhenResponseExists() { - StructureShape resultShape = StructureShape.builder() - .id("com.example#FooResult").build(); - StructureShape responseShape = StructureShape.builder() - .id("com.example#FooResponse").build(); - ServiceShape service = ec2Service("EC2"); - Model m = Model.assembler().addShapes(resultShape, responseShape, service).assemble().unwrap(); - - Model out = Ec2Transforms.asTransform().apply(m, service); - - assertTrue(out.getShape(ShapeId.from("com.example#FooResult")).isPresent()); - assertTrue(out.getShape(ShapeId.from("com.example#FooResponse")).isPresent()); + void throwsWhenResponseShapeAlreadyExists() { + // A *Result domain struct colliding with an existing *Response is a genuine collision: + // fail loudly rather than silently skip (the obsolete-transform / drift signal). + StructureShape result = StructureShape.builder().id("com.example#FooResult").build(); + StructureShape response = StructureShape.builder().id("com.example#FooResponse").build(); + StructureShape in = StructureShape.builder().id("com.example#DescribeThingsRequest").build(); + StructureShape out = StructureShape.builder().id("com.example#DescribeThingsResult").build(); + OperationShape op = OperationShape.builder().id("com.example#DescribeThings") + .input(in.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(ServiceTrait.builder().sdkId("EC2").arnNamespace("ec2") + .cloudFormationName("EC2").cloudTrailEventSource("ec2").build()) + .addOperation(op.getId()).build(); + Model m = Model.assembler().addShapes(result, response, in, out, op, service).assemble().unwrap(); + assertThrows(IllegalStateException.class, + () -> Ec2Transforms.asTransform().apply(m, service(m))); } /** @@ -144,15 +149,11 @@ void modelsUserDataAsSensitiveSecureBlobAttributeValue() { } @Test - void secureBlobUserDataTransformIsIdempotent() { - // Re-applying must not throw or duplicate shapes: once SecureBlobAttributeValue exists the - // transform self-retires, so it is safe if the upstream Smithy model later adds the shape. + void throwsWhenSecureBlobAttributeValueAlreadyExists() { + // Once upstream aws-models adds SecureBlobAttributeValue, this compensating transform is + // obsolete. Fail loudly so a human removes it, rather than silently self-retiring. Model once = Ec2Transforms.asTransform().apply(userDataModel(), service(userDataModel())); - Model twice = Ec2Transforms.asTransform().apply(once, service(once)); - - MemberShape userData = twice.expectShape( - ShapeId.from("com.example#ModifyInstanceAttributeRequest"), StructureShape.class) - .getAllMembers().get("UserData"); - assertEquals(ShapeId.from("com.example#SecureBlobAttributeValue"), userData.getTarget()); + assertThrows(IllegalStateException.class, + () -> Ec2Transforms.asTransform().apply(once, service(once))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java new file mode 100644 index 00000000000..1bc07bf6656 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java @@ -0,0 +1,60 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.JsonNameTrait; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +class TransformSupportTest { + + private static StructureShape struct(String... memberNames) { + StructureShape.Builder b = StructureShape.builder().id("com.example#Req"); + for (String m : memberNames) { + b.addMember(m, ShapeId.from("smithy.api#String")); + } + return b.build(); + } + + @Test + void renameMember_sourceAbsent_returnsEmpty() { + assertTrue(TransformSupport.renameMember(struct("name"), "body", "requestBody").isEmpty()); + } + + @Test + void renameMember_targetExists_throws() { + StructureShape s = struct("body", "requestBody"); + assertThrows(IllegalStateException.class, + () -> TransformSupport.renameMember(s, "body", "requestBody")); + } + + @Test + void renameMember_success_renamesAndPreservesOrder() { + StructureShape s = struct("a", "body", "z"); + StructureShape out = TransformSupport.renameMember(s, "body", "requestBody").orElseThrow(); + assertFalse(out.getMember("body").isPresent()); + assertTrue(out.getMember("requestBody").isPresent()); + List order = new ArrayList<>(out.getAllMembers().keySet()); + assertEquals(List.of("a", "requestBody", "z"), order); + } + + @Test + void renameMember_withJsonName_attachesTraitToRenamedMember() { + StructureShape s = struct("generatedPolicyResult"); + StructureShape out = TransformSupport.renameMember( + s, "generatedPolicyResult", "generatedPolicyResults", + new JsonNameTrait("generatedPolicyResult")).orElseThrow(); + MemberShape renamed = out.getMember("generatedPolicyResults").orElseThrow(); + assertEquals("generatedPolicyResult", renamed.expectTrait(JsonNameTrait.class).getValue()); + } +} From 4b8e193a4e381bd8c26df00c48f50bf17843f945 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 24 Aug 2026 13:47:22 -0400 Subject: [PATCH 07/53] Smithy: wire reserved request-member rename with raw-smithy-name skip-lists --- .../model/transforms/GlobalTransforms.java | 98 ++++++++++----- .../model/GlobalTransformsTest.java | 118 ++++++++++-------- 2 files changed, 129 insertions(+), 87 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 926e51068f3..29879827cf7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -4,6 +4,7 @@ */ package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; @@ -26,6 +27,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -37,19 +39,21 @@ public final class GlobalTransforms { /** - * Services that skip the "body" -> "requestBody" member rename. - * These services use "body" as a meaningful domain member (e.g., HTTP payload). + * Services that skip the "body" -> "requestBody" member rename (raw smithy service names). + * These use "body" as a meaningful domain/payload member. API Gateway (api-gateway) and + * API Gateway V2 (apigatewayv2) are skipped here because their dedicated transforms own the + * rename; the rest use "body" as an HTTP payload. */ private static final Set BODY_RENAME_SKIP_SERVICES = Set.of( - "amplifyuibuilder", "apigateway", "apigateway2", "bedrock-runtime", "glacier", "repostspace" + "amplifyuibuilder", "api-gateway", "apigatewayv2", "bedrock-runtime", "glacier", "repostspace" ); /** - * Services that skip the "headers" -> "headerValues" member rename. - * These services use "headers" as a meaningful domain member. + * Services that skip the "headers" -> "headerValues" member rename (raw smithy service name). + * api-gateway renames headers to "requestHeaders" in its dedicated transform instead. */ private static final Set HEADERS_RENAME_SKIP_SERVICES = Set.of( - "apigateway" + "api-gateway" ); /** @@ -62,37 +66,63 @@ public final class GlobalTransforms { private GlobalTransforms() {} - // NOTE: This reserved-member rename is intentionally NOT wired into the transform - // pipeline yet. It encodes a known C2J-parity requirement (body -> requestBody, - // headers -> headerValues) that is validated by GlobalTransformsTest but not applied - // during generation. Do not delete it and do not hook it up as part of a cleanup pass — - // wiring it in changes generated output and must be its own reviewed change. /** - * Returns the renamed C++ member name if this member is reserved. - * Only applies to request shape members (caller must filter). + * Renames reserved request members on every operation-input structure: {@code body -> + * requestBody}, {@code headers -> headerValues}, {@code Headers -> headerValues}, honoring the + * per-service skip-lists. Mirrors the legacy C2J {@code RESERVED_REQUEST_MEMBER_MAPPING}. Only + * operation-input shapes are touched (never arbitrary domain shapes that happen to end in + * "Request"). A collision (the target member name already present) throws via + * {@link TransformSupport#renameMember}. * - * Reserved members and their renames: - * - "body" -> "requestBody" (unless service is in BODY_RENAME_SKIP_SERVICES) - * - "headers" -> "headerValues" (unless service is in HEADERS_RENAME_SKIP_SERVICES) - * - "Headers" -> "headerValues" (always renamed, no skip list) - * - * @param memberName the original member name from the model - * @param smithyServiceName the service name (lowercase hyphenated, e.g., "bedrock-runtime") - * @return the renamed member name, or empty if no rename is needed + * @param model the current model + * @param service the service being generated (its raw smithy name drives the skip-lists) + * @return the model with reserved input members renamed, or the input model if none applied */ - public static Optional getReservedMemberRename(String memberName, String smithyServiceName) { - if ("body".equals(memberName)) { - if (BODY_RENAME_SKIP_SERVICES.contains(smithyServiceName)) return Optional.empty(); - return Optional.of("requestBody"); + static Model renameReservedRequestMembers(Model model, ServiceShape service) { + String smithyServiceName = ServiceNameUtil.getSmithyServiceName(service, null); + Set inputIds = new HashSet<>(); + for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + inputIds.add(op.getInputShape()); + } + List updated = new ArrayList<>(); + for (ShapeId inputId : inputIds) { + model.getShape(inputId).flatMap(Shape::asStructureShape).ifPresent(struct -> { + StructureShape current = struct; + boolean changed = false; + for (Map.Entry rename : reservedRenames(current, smithyServiceName)) { + Optional next = + TransformSupport.renameMember(current, rename.getKey(), rename.getValue()); + if (next.isPresent()) { + current = next.get(); + changed = true; + } + } + if (changed) { + updated.add(current); + } + }); + } + if (updated.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(updated).build(); + } + + /** Ordered (oldName -> newName) reserved-member renames applicable to this input struct. */ + private static List> reservedRenames(StructureShape struct, + String smithyServiceName) { + List> out = new ArrayList<>(); + if (struct.getMember("body").isPresent() && !BODY_RENAME_SKIP_SERVICES.contains(smithyServiceName)) { + out.add(Map.entry("body", "requestBody")); } - if ("headers".equals(memberName)) { - if (HEADERS_RENAME_SKIP_SERVICES.contains(smithyServiceName)) return Optional.empty(); - return Optional.of("headerValues"); + if (struct.getMember("headers").isPresent() + && !HEADERS_RENAME_SKIP_SERVICES.contains(smithyServiceName)) { + out.add(Map.entry("headers", "headerValues")); } - if ("Headers".equals(memberName)) { - return Optional.of("headerValues"); + if (struct.getMember("Headers").isPresent()) { + out.add(Map.entry("Headers", "headerValues")); } - return Optional.empty(); + return out; } /** @@ -125,10 +155,12 @@ private static void addReachableFrom(ShapeId root, Walker walker, Model model, S * Returns this class as a ModelTransform. * *

Runs {@link #dropDeprecatedMembers} first (so reachability filtering sees the pruned - * model and orphaned targets drop out), then {@link #injectResponseMetadata}. + * model and orphaned targets drop out), then {@link #renameReservedRequestMembers} to apply the + * C2J-parity request-member renames, then {@link #injectResponseMetadata}. */ public static ModelTransform asTransform() { - return (model, service) -> injectResponseMetadata(dropDeprecatedMembers(model, service), service); + return (model, service) -> injectResponseMetadata( + renameReservedRequestMembers(dropDeprecatedMembers(model, service), service), service); } /** diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index ffa9a1e1fdc..a1c388cda2b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -9,89 +9,99 @@ import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; -import java.util.Optional; import java.util.Set; import static org.junit.jupiter.api.Assertions.*; class GlobalTransformsTest { - @Test - void reservedMemberRename_body_becomesRequestBody() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "kinesis"); - assertEquals(Optional.of("requestBody"), result); - } - - @Test - void reservedMemberRename_body_skippedForApiGateway() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "apigateway"); - assertTrue(result.isEmpty()); - } - - @Test - void reservedMemberRename_body_skippedForBedrockRuntime() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "bedrock-runtime"); - assertTrue(result.isEmpty()); - } - - @Test - void reservedMemberRename_body_skippedForAmplifyUiBuilder() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "amplifyuibuilder"); - assertTrue(result.isEmpty()); - } - - @Test - void reservedMemberRename_body_skippedForApiGateway2() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "apigateway2"); - assertTrue(result.isEmpty()); + /** One-operation service under sdkId with an input struct carrying the given members. */ + private static Model inputModel(String sdkId, String... inputMembers) { + StructureShape.Builder in = StructureShape.builder().id("com.example#DoThingRequest"); + for (String m : inputMembers) { + in.addMember(m, ShapeId.from("smithy.api#String")); + } + StructureShape input = in.build(); + StructureShape output = StructureShape.builder().id("com.example#DoThingResponse").build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(software.amazon.smithy.aws.traits.ServiceTrait.builder() + .sdkId(sdkId).arnNamespace("x").cloudFormationName("X").cloudTrailEventSource("x").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(input, output, op, service).assemble().unwrap(); } - @Test - void reservedMemberRename_body_skippedForGlacier() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "glacier"); - assertTrue(result.isEmpty()); + private static StructureShape input(Model m) { + return m.expectShape(ShapeId.from("com.example#DoThingRequest"), StructureShape.class); } @Test - void reservedMemberRename_body_skippedForRepostSpace() { - Optional result = GlobalTransforms.getReservedMemberRename("body", "repostspace"); - assertTrue(result.isEmpty()); + void reservedRename_body_becomesRequestBody_forNonSkippedService() { + Model m = inputModel("Security IR", "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertFalse(input(out).getMember("body").isPresent()); + assertTrue(input(out).getMember("requestBody").isPresent()); } @Test - void reservedMemberRename_headers_becomesHeaderValues() { - Optional result = GlobalTransforms.getReservedMemberRename("headers", "kinesis"); - assertEquals(Optional.of("headerValues"), result); + void reservedRename_body_skippedForBedrockRuntime() { + Model m = inputModel("Bedrock Runtime", "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertTrue(input(out).getMember("body").isPresent(), "skip-listed service keeps body"); } @Test - void reservedMemberRename_headers_skippedForApiGateway() { - Optional result = GlobalTransforms.getReservedMemberRename("headers", "apigateway"); - assertTrue(result.isEmpty()); + void reservedRename_body_skippedForApiGateway_rawName() { + // C2J name is "apigateway" but the raw smithy name is "api-gateway"; the skip-list must use + // the raw name or API Gateway's dedicated transform gets pre-empted. + Model m = inputModel("API Gateway", "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertTrue(input(out).getMember("body").isPresent(), "api-gateway must be skipped"); } @Test - void reservedMemberRename_headers_notSkippedForBedrockRuntime() { - Optional result = GlobalTransforms.getReservedMemberRename("headers", "bedrock-runtime"); - assertEquals(Optional.of("headerValues"), result); + void reservedRename_headers_becomesHeaderValues_forNonSkippedService() { + Model m = inputModel("Kinesis", "headers"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertTrue(input(out).getMember("headerValues").isPresent()); + assertFalse(input(out).getMember("headers").isPresent()); } @Test - void reservedMemberRename_Headers_alwaysRenamed() { - Optional result = GlobalTransforms.getReservedMemberRename("Headers", "apigateway"); - assertEquals(Optional.of("headerValues"), result); + void reservedRename_capitalHeaders_alwaysRenamed() { + Model m = inputModel("API Gateway", "Headers"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertTrue(input(out).getMember("headerValues").isPresent()); } @Test - void reservedMemberRename_Headers_alwaysRenamed_anyService() { - Optional result = GlobalTransforms.getReservedMemberRename("Headers", "kinesis"); - assertEquals(Optional.of("headerValues"), result); + void reservedRename_onlyTouchesOperationInputs_notArbitraryShapes() { + // A non-input structure that happens to have a 'body' member must NOT be renamed. + StructureShape domain = StructureShape.builder().id("com.example#HttpThing") + .addMember("body", ShapeId.from("smithy.api#String")).build(); + StructureShape input = StructureShape.builder().id("com.example#DoThingRequest") + .addMember("thing", domain.getId()).build(); + StructureShape output = StructureShape.builder().id("com.example#DoThingResponse").build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(software.amazon.smithy.aws.traits.ServiceTrait.builder() + .sdkId("Kinesis").arnNamespace("x").cloudFormationName("X").cloudTrailEventSource("x").build()) + .addOperation(op.getId()).build(); + Model m = Model.assembler().addShapes(domain, input, output, op, service).assemble().unwrap(); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + assertTrue(out.expectShape(ShapeId.from("com.example#HttpThing"), StructureShape.class) + .getMember("body").isPresent(), "domain shape body must not be renamed"); } @Test - void reservedMemberRename_normalMember_returnsEmpty() { - Optional result = GlobalTransforms.getReservedMemberRename("name", "kinesis"); - assertTrue(result.isEmpty()); + void reservedRename_collision_throws() { + Model m = inputModel("Kinesis", "body", "requestBody"); + assertThrows(IllegalStateException.class, + () -> GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example"))); } // --- computeReachableShapes tests --- From 1e0e6da772b77cdbdccabb80a7a71d8934bcd0d0 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 24 Aug 2026 13:53:36 -0400 Subject: [PATCH 08/53] Smithy: AccessAnalyzerTransforms renames GeneratedPolicyResult(s) with jsonName parity Smithy: drop superseded accessanalyzer + dead cloudsearchdomain collision-map entries --- .../generators/ShapeUtil.java | 8 +- .../generators/model/ModelCodegenPlugin.java | 4 +- .../transforms/AccessAnalyzerTransforms.java | 68 ++++++++++++++ .../model/ShapeUtilExtensionsTest.java | 11 --- .../AccessAnalyzerTransformsTest.java | 89 +++++++++++++++++++ 5 files changed, 165 insertions(+), 15 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java index d10a51b689b..c36f1c5d9d8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java @@ -71,9 +71,11 @@ public class ShapeUtil { * Map: service-name -> Map of original-shape-name -> resolved-name */ private static final Map> HARDCODED_COLLISION_RESOLUTIONS = Map.of( - "s3", Map.of("CopyObjectResult", "CopyObjectResultDetails"), - "accessanalyzer", Map.of("GeneratedPolicyResult", "GeneratedPolicyResults"), - "cloudsearchdomain", Map.of("SearchResult", "SearchResultDetails") + // accessanalyzer GeneratedPolicyResult->GeneratedPolicyResults is handled by + // AccessAnalyzerTransforms (a model transform), not this render-time map. + // cloudsearchdomain SearchResult->SearchResultDetails is dead: the current model has no + // colliding SearchResult shape. The s3 entry stays for the deferred S3 transform work. + "s3", Map.of("CopyObjectResult", "CopyObjectResultDetails") ); /** diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index a9066c5fd9d..99024a729a3 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -6,6 +6,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.AccessAnalyzerTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; @@ -54,7 +55,8 @@ public void execute(PluginContext context) { SqsTransforms.asTransform(), ApiGatewayTransforms.asTransform(), ApiGatewayV2Transforms.asTransform(), - Ec2Transforms.asTransform() + Ec2Transforms.asTransform(), + AccessAnalyzerTransforms.asTransform() // Future: S3Transforms.asTransform(), etc. )); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java new file mode 100644 index 00000000000..9277e94ba86 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java @@ -0,0 +1,68 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.JsonNameTrait; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.Map; +import java.util.Optional; + +/** + * Access Analyzer model parity with the legacy C2J transformer, which resolves the collision + * between the {@code GetGeneratedPolicy} result wrapper and the domain shape + * {@code GeneratedPolicyResult} by renaming the domain shape (and its referencing member) to + * {@code GeneratedPolicyResults}. C2J preserves the JSON wire key ({@code generatedPolicyResult}) + * via {@code locationName}; this transform mirrors that with a {@code @jsonName} trait so the model + * stays serde-correct even though serde is currently stubbed. + * + *

Self-guards on the raw smithy service name {@code accessanalyzer} (transforms never remap). + * No-op when the domain shape is absent (upstream already clean). Throws if the target name + * {@code GeneratedPolicyResults} is already occupied by a distinct shape — a genuine collision. + */ +public final class AccessAnalyzerTransforms { + + private AccessAnalyzerTransforms() {} + + public static ModelTransform asTransform() { + return AccessAnalyzerTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"accessanalyzer".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + String ns = service.getId().getNamespace(); + ShapeId oldShape = ShapeId.fromParts(ns, "GeneratedPolicyResult"); + ShapeId newShape = ShapeId.fromParts(ns, "GeneratedPolicyResults"); + + if (model.getShape(oldShape).isEmpty()) { + return model; // upstream already renamed / removed the shape: nothing to do. + } + if (model.getShape(newShape).isPresent()) { + throw new IllegalStateException("AccessAnalyzer collision: '" + newShape + + "' already exists; cannot rename '" + oldShape + "' onto it."); + } + + Model renamed = ModelTransformer.create().renameShapes(model, Map.of(oldShape, newShape)); + + ShapeId respId = ShapeId.fromParts(ns, "GetGeneratedPolicyResponse"); + Optional resp = renamed.getShape(respId).flatMap(Shape::asStructureShape); + if (resp.isEmpty()) { + return renamed; + } + Optional updated = TransformSupport.renameMember( + resp.get(), "generatedPolicyResult", "generatedPolicyResults", + new JsonNameTrait("generatedPolicyResult")); + return updated.map(s -> renamed.toBuilder().addShape(s).build()).orElse(renamed); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java index 7f57785b441..5daec8ce043 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java @@ -19,17 +19,6 @@ void hardcodedCollisionResolution_s3CopyObjectResult() { ShapeUtil.getHardcodedResolution("s3", "CopyObjectResult")); } - @Test - void hardcodedCollisionResolution_accessAnalyzer() { - assertEquals(Optional.of("GeneratedPolicyResults"), - ShapeUtil.getHardcodedResolution("accessanalyzer", "GeneratedPolicyResult")); - } - - @Test - void hardcodedCollisionResolution_cloudSearchDomain() { - assertEquals(Optional.of("SearchResultDetails"), - ShapeUtil.getHardcodedResolution("cloudsearchdomain", "SearchResult")); - } @Test void hardcodedCollisionResolution_noMatch_returnsEmpty() { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java new file mode 100644 index 00000000000..8ad9cda0120 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java @@ -0,0 +1,89 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.JsonNameTrait; + +import static org.junit.jupiter.api.Assertions.*; + +class AccessAnalyzerTransformsTest { + + private static Model model(String sdkId, boolean withResultShape) { + String ns = "com.amazonaws.accessanalyzer"; + StructureShape.Builder respB = StructureShape.builder().id(ns + "#GetGeneratedPolicyResponse"); + StructureShape gpr = StructureShape.builder().id(ns + "#GeneratedPolicyResult") + .addMember("x", ShapeId.from("smithy.api#String")).build(); + if (withResultShape) { + respB.addMember("generatedPolicyResult", gpr.getId()); + } + StructureShape resp = respB.build(); + StructureShape req = StructureShape.builder().id(ns + "#GetGeneratedPolicyRequest").build(); + OperationShape op = OperationShape.builder().id(ns + "#GetGeneratedPolicy") + .input(req.getId()).output(resp.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(ns + "#AccessAnalyzer").version("2019-11-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("access-analyzer") + .cloudFormationName("AccessAnalyzer").cloudTrailEventSource("access-analyzer").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(req, resp, op, svc).addShape(gpr).assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.amazonaws.accessanalyzer#AccessAnalyzer"), ServiceShape.class); + } + + @Test + void renamesShapeAndMember_withJsonNamePreserved() { + Model m = model("AccessAnalyzer", true); + Model out = AccessAnalyzerTransforms.asTransform().apply(m, service(m)); + + assertTrue(out.getShape( + ShapeId.from("com.amazonaws.accessanalyzer#GeneratedPolicyResults")).isPresent(), + "shape renamed to GeneratedPolicyResults"); + assertFalse(out.getShape( + ShapeId.from("com.amazonaws.accessanalyzer#GeneratedPolicyResult")).isPresent(), + "old shape name gone"); + + StructureShape resp = out.expectShape( + ShapeId.from("com.amazonaws.accessanalyzer#GetGeneratedPolicyResponse"), StructureShape.class); + MemberShape member = resp.getMember("generatedPolicyResults").orElseThrow(); + assertEquals("com.amazonaws.accessanalyzer#GeneratedPolicyResults", + member.getTarget().toString(), "member repointed to renamed shape"); + assertEquals("generatedPolicyResult", + member.expectTrait(JsonNameTrait.class).getValue(), "wire name preserved"); + assertFalse(resp.getMember("generatedPolicyResult").isPresent(), "old member name gone"); + } + + @Test + void noOpForOtherService() { + Model m = model("SomethingElse", true); + Model out = AccessAnalyzerTransforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } + + @Test + void throwsWhenTargetShapeAlreadyExists() { + String ns = "com.amazonaws.accessanalyzer"; + StructureShape gpr = StructureShape.builder().id(ns + "#GeneratedPolicyResult") + .addMember("x", ShapeId.from("smithy.api#String")).build(); + StructureShape gprs = StructureShape.builder().id(ns + "#GeneratedPolicyResults") + .addMember("y", ShapeId.from("smithy.api#String")).build(); + StructureShape resp = StructureShape.builder().id(ns + "#GetGeneratedPolicyResponse") + .addMember("generatedPolicyResult", gpr.getId()).build(); + StructureShape req = StructureShape.builder().id(ns + "#GetGeneratedPolicyRequest").build(); + OperationShape op = OperationShape.builder().id(ns + "#GetGeneratedPolicy") + .input(req.getId()).output(resp.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(ns + "#AccessAnalyzer").version("2019-11-01") + .addTrait(ServiceTrait.builder().sdkId("AccessAnalyzer").arnNamespace("access-analyzer") + .cloudFormationName("AccessAnalyzer").cloudTrailEventSource("access-analyzer").build()) + .addOperation(op.getId()).build(); + Model m = Model.assembler().addShapes(gpr, gprs, resp, req, op, svc).assemble().unwrap(); + assertThrows(IllegalStateException.class, + () -> AccessAnalyzerTransforms.asTransform().apply(m, service(m))); + } +} From 2df9ef7c9a3ac016a14f9e22b99a98c6ac041e1a Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 26 Aug 2026 16:48:43 -0400 Subject: [PATCH 09/53] Carry over serde traits when we rename members --- .../transforms/AccessAnalyzerTransforms.java | 14 +-- .../transforms/ApiGatewayTransforms.java | 7 +- .../transforms/ApiGatewayV2Transforms.java | 5 +- .../model/transforms/GlobalTransforms.java | 16 +-- .../transforms/SourceRegionTransform.java | 24 ++--- .../model/transforms/TransformSupport.java | 96 ++++++++++++++--- .../model/GlobalTransformsTest.java | 63 +++++++++++ .../transforms/ApiGatewayTransformsTest.java | 5 + .../ApiGatewayV2TransformsTest.java | 3 + .../transforms/TransformSupportTest.java | 100 ++++++++++++++++-- 10 files changed, 278 insertions(+), 55 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java index 9277e94ba86..94f8150efb7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java @@ -6,12 +6,13 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; -import software.amazon.smithy.model.traits.JsonNameTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.Map; @@ -21,9 +22,10 @@ * Access Analyzer model parity with the legacy C2J transformer, which resolves the collision * between the {@code GetGeneratedPolicy} result wrapper and the domain shape * {@code GeneratedPolicyResult} by renaming the domain shape (and its referencing member) to - * {@code GeneratedPolicyResults}. C2J preserves the JSON wire key ({@code generatedPolicyResult}) - * via {@code locationName}; this transform mirrors that with a {@code @jsonName} trait so the model - * stays serde-correct even though serde is currently stubbed. + * {@code GeneratedPolicyResults}. C2J preserves the wire key ({@code generatedPolicyResult}) via + * {@code locationName}; {@link TransformSupport#renameMember} mirrors that by pinning the original + * wire name through the service's protocol-appropriate trait, so the model stays serde-correct even + * though serde is currently stubbed. * *

Self-guards on the raw smithy service name {@code accessanalyzer} (transforms never remap). * No-op when the domain shape is absent (upstream already clean). Throws if the target name @@ -60,9 +62,9 @@ private static Model apply(Model model, ServiceShape service) { if (resp.isEmpty()) { return renamed; } + Protocol protocol = ProtocolResolver.resolve(service, renamed); Optional updated = TransformSupport.renameMember( - resp.get(), "generatedPolicyResult", "generatedPolicyResults", - new JsonNameTrait("generatedPolicyResult")); + resp.get(), "generatedPolicyResult", "generatedPolicyResults", protocol); return updated.map(s -> renamed.toBuilder().addShape(s).build()).orElse(renamed); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java index 221cadd326a..5aff1662174 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java @@ -6,6 +6,8 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; @@ -31,14 +33,15 @@ private static Model apply(Model model, ServiceShape service) { return model; } String ns = service.getId().getNamespace(); + Protocol protocol = ProtocolResolver.resolve(service, model); List updated = new ArrayList<>(); for (String requestName : List.of("TestInvokeMethodRequest", "TestInvokeAuthorizerRequest")) { model.getShape(ShapeId.fromParts(ns, requestName)) .flatMap(s -> s.asStructureShape()) .ifPresent(struct -> { StructureShape afterBody = TransformSupport - .renameMember(struct, "body", "requestBody").orElse(struct); - TransformSupport.renameMember(afterBody, "headers", "requestHeaders") + .renameMember(struct, "body", "requestBody", protocol).orElse(struct); + TransformSupport.renameMember(afterBody, "headers", "requestHeaders", protocol) .ifPresentOrElse(updated::add, () -> { if (afterBody != struct) { updated.add(afterBody); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java index afbb391a458..a1636497b07 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java @@ -6,6 +6,8 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; @@ -31,11 +33,12 @@ private static Model apply(Model model, ServiceShape service) { return model; } String ns = service.getId().getNamespace(); + Protocol protocol = ProtocolResolver.resolve(service, model); List updated = new ArrayList<>(); for (String requestName : List.of("ImportApiRequest", "ReimportApiRequest")) { model.getShape(ShapeId.fromParts(ns, requestName)) .flatMap(s -> s.asStructureShape()) - .flatMap(struct -> TransformSupport.renameMember(struct, "Body", "requestBody")) + .flatMap(struct -> TransformSupport.renameMember(struct, "Body", "requestBody", protocol)) .ifPresent(updated::add); } if (updated.isEmpty()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 29879827cf7..19f27ff1965 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -71,8 +71,9 @@ private GlobalTransforms() {} * requestBody}, {@code headers -> headerValues}, {@code Headers -> headerValues}, honoring the * per-service skip-lists. Mirrors the legacy C2J {@code RESERVED_REQUEST_MEMBER_MAPPING}. Only * operation-input shapes are touched (never arbitrary domain shapes that happen to end in - * "Request"). A collision (the target member name already present) throws via - * {@link TransformSupport#renameMember}. + * "Request"). {@link TransformSupport#renameMember} preserves each renamed member's wire name + * via the service's protocol-appropriate trait (matching C2J's {@code setLocationName}), and + * throws on a collision (the target member name already present). * * @param model the current model * @param service the service being generated (its raw smithy name drives the skip-lists) @@ -80,6 +81,7 @@ private GlobalTransforms() {} */ static Model renameReservedRequestMembers(Model model, ServiceShape service) { String smithyServiceName = ServiceNameUtil.getSmithyServiceName(service, null); + Protocol protocol = ProtocolResolver.resolve(service, model); Set inputIds = new HashSet<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { inputIds.add(op.getInputShape()); @@ -91,7 +93,7 @@ static Model renameReservedRequestMembers(Model model, ServiceShape service) { boolean changed = false; for (Map.Entry rename : reservedRenames(current, smithyServiceName)) { Optional next = - TransformSupport.renameMember(current, rename.getKey(), rename.getValue()); + TransformSupport.renameMember(current, rename.getKey(), rename.getValue(), protocol); if (next.isPresent()) { current = next.get(); changed = true; @@ -248,9 +250,11 @@ public static Model injectResponseMetadata(Model model, ServiceShape service) { model.getShape(outputId).flatMap(Shape::asStructureShape).ifPresent(result -> { if (result.getMember(RESPONSE_METADATA).isPresent()) { throw new IllegalStateException("Result shape " + result.getId() - + " already has a '" + RESPONSE_METADATA + "' member; cannot inject the " - + "framework " + RESPONSE_METADATA + " envelope. Rename the modeled member " - + "via a per-service transform first."); + + " already has a '" + RESPONSE_METADATA + "' member, which collides with the " + + "framework " + RESPONSE_METADATA + " envelope. Resolve the collision in the " + + "raw model, or rename the modeled member earlier within GlobalTransforms: " + + "per-service transforms run after GlobalTransforms and cannot pre-empt this " + + "injection."); } StructureShape withMetadata = result.toBuilder() .addMember(MemberShape.builder() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java index adac53b7a71..c844dc49107 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java @@ -61,20 +61,18 @@ private static Model apply(Model model, ServiceShape service) { List updated = new ArrayList<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { - if (!operations.contains(op.getId().getName())) { - continue; + if (operations.contains(op.getId().getName())) { + model.getShape(op.getInputShape()).flatMap(s -> s.asStructureShape()).ifPresent(req -> { + if (req.getMember(SOURCE_REGION).isEmpty()) { + updated.add(req.toBuilder() + .addMember(MemberShape.builder() + .id(req.getId().withMember(SOURCE_REGION)) + .target(ShapeId.from("smithy.api#String")) + .build()) + .build()); + } + }); } - model.getShape(op.getInputShape()).flatMap(s -> s.asStructureShape()).ifPresent(req -> { - if (req.getMember(SOURCE_REGION).isPresent()) { - return; - } - updated.add(req.toBuilder() - .addMember(MemberShape.builder() - .id(req.getId().withMember(SOURCE_REGION)) - .target(ShapeId.from("smithy.api#String")) - .build()) - .build()); - }); } if (updated.isEmpty()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java index dd1d5aa35aa..67e31b6a511 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -5,13 +5,19 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.traits.EnumDefinition; import software.amazon.smithy.model.traits.EnumTrait; +import software.amazon.smithy.model.traits.JsonNameTrait; +import software.amazon.smithy.model.traits.Trait; +import software.amazon.smithy.model.traits.XmlNameTrait; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -83,28 +89,29 @@ static Optional appendValues(Shape enumShape, List values) { * preserving member declaration order and copying all traits onto the renamed member. Returns * {@link Optional#empty()} if {@code oldName} is absent (nothing to rename). * + *

The renamed member keeps its original wire name. A member with no explicit wire-name trait + * serializes under its member name, so renaming it would silently change the wire key; to + * prevent that this method pins the original name via the protocol-appropriate trait(s) + * ({@link #wireNamePreservingTraits}). This mirrors the legacy C2J rename primitive, which + * couples {@code setLocationName(originalMemberKey)} into the same step that changes the member + * key so a rename can never drop the wire name. + * * @throws IllegalStateException if {@code newName} is already a distinct member — a genuine - * collision that would silently drop a member. Callers must not mask this. - */ - static Optional renameMember(StructureShape struct, String oldName, String newName) { - return renameMember(struct, oldName, newName, new software.amazon.smithy.model.traits.Trait[0]); - } - - /** - * As {@link #renameMember(StructureShape, String, String)}, additionally attaching - * {@code extraTraits} to the renamed member (e.g. a {@code @jsonName} to preserve the original - * wire name when the C++ member name changes). Existing member traits are copied first, then the - * extras are added. + * collision that would silently drop a member; or if the protocol has no wire-name trait + * to preserve the original key (see {@link #wireNamePreservingTrait}). Callers must not + * mask either. */ static Optional renameMember(StructureShape struct, String oldName, String newName, - software.amazon.smithy.model.traits.Trait... extraTraits) { - if (struct.getMember(oldName).isEmpty()) { + Protocol protocol) { + Optional target = struct.getMember(oldName); + if (target.isEmpty()) { return Optional.empty(); } if (struct.getMember(newName).isPresent()) { throw new IllegalStateException("Cannot rename member '" + oldName + "' to '" + newName + "' on " + struct.getId() + ": a distinct '" + newName + "' member already exists"); } + List wireNameTraits = wireNamePreservingTraits(target.get(), oldName, protocol); StructureShape.Builder builder = StructureShape.builder().id(struct.getId()); struct.getAllTraits().values().forEach(builder::addTrait); for (MemberShape member : struct.getAllMembers().values()) { @@ -113,12 +120,69 @@ static Optional renameMember(StructureShape struct, String oldNa builder.addMember(name, member.getTarget(), b -> { member.getAllTraits().values().forEach(b::addTrait); if (isTarget) { - for (software.amazon.smithy.model.traits.Trait t : extraTraits) { - b.addTrait(t); - } + wireNameTraits.forEach(b::addTrait); } }); } return Optional.of(builder.build()); } + + /** + * The trait(s) to add to the renamed member so its wire name(s) stay equal to what {@code oldName} + * produced. Existing wire-name traits are always copied verbatim by the rename, so this only + * synthesizes what the member lacks; if a protocol's trait is already present, nothing is added + * for it. + * + *

    + *
  • JSON-family ({@code awsJson}, {@code restJson1}): {@code @jsonName}.
  • + *
  • {@code restXml} / {@code awsQuery}: {@code @xmlName}.
  • + *
  • {@code ec2Query}: request and response use different names, so both are pinned. + * The request query key is authoritative from {@code @ec2QueryName} (used verbatim); the + * response XML element is {@code @xmlName}. EC2 models routinely carry an {@code @xmlName} + * that is not merely the camelCase of the request key (e.g. member {@code Ipv6Addresses} + * has {@code ec2QueryName=Ipv6Addresses} but {@code xmlName=ipv6AddressesSet}), so + * reconstructing the request key from {@code capitalize(@xmlName)} — what legacy C2J does — + * is unreliable. We instead pin {@code @ec2QueryName} to the member's current request key + * ({@code capitalize(@xmlName ?? memberName)} when it has none of its own) so it survives + * the member-name change without depending on any serde-time fallback.
  • + *
  • Any other protocol (e.g. {@code rpcv2Cbor}, which has no wire-name trait and always + * serializes under the member name): fail fast rather than emit an inert trait and + * mis-generate later.
  • + *
+ */ + private static List wireNamePreservingTraits(MemberShape member, String oldName, + Protocol protocol) { + if (protocol == Protocol.EC2) { + List traits = new ArrayList<>(); + if (!member.hasTrait(Ec2QueryNameTrait.class)) { + String responseName = member.getTrait(XmlNameTrait.class) + .map(XmlNameTrait::getValue).orElse(oldName); + traits.add(new Ec2QueryNameTrait(capitalizeFirst(responseName))); + } + if (!member.hasTrait(XmlNameTrait.class)) { + traits.add(new XmlNameTrait(oldName)); + } + return traits; + } + if (protocol.isXmlLike()) { + return member.hasTrait(XmlNameTrait.class) + ? List.of() : List.of(new XmlNameTrait(oldName)); + } + if (protocol.isJsonLike()) { + return member.hasTrait(JsonNameTrait.class) + ? List.of() : List.of(new JsonNameTrait(oldName)); + } + throw new IllegalStateException("Cannot preserve the wire name of renamed member '" + oldName + + "' under protocol " + protocol + ": it has no wire-name trait (rpcv2Cbor always " + + "serializes under the member name), so the rename would silently change the wire key. " + + "Add explicit wire-name handling for this protocol before renaming its members."); + } + + /** Uppercases the first character; the EC2 query-key casing rule. */ + private static String capitalizeFirst(String value) { + if (value.isEmpty()) { + return value; + } + return Character.toUpperCase(value.charAt(0)) + value.substring(1); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index a1c388cda2b..727706c24aa 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -8,6 +8,8 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.JsonNameTrait; +import software.amazon.smithy.model.traits.XmlNameTrait; import java.util.Set; @@ -104,6 +106,67 @@ void reservedRename_collision_throws() { () -> GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example"))); } + @Test + void reservedRename_jsonService_preservesWireNameWithJsonName() { + Model m = inputModel("Kinesis", "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); + assertEquals("body", renamed.expectTrait(JsonNameTrait.class).getValue(), + "JSON service must keep the 'body' wire key via @jsonName"); + assertFalse(renamed.hasTrait(XmlNameTrait.class)); + } + + @Test + void reservedRename_queryXmlService_preservesWireNameWithXmlName() { + Model m = inputModelWithProtocol("Kinesis", + new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait(), "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); + assertEquals("body", renamed.expectTrait(XmlNameTrait.class).getValue(), + "awsQuery service must keep the 'body' wire key via @xmlName"); + assertFalse(renamed.hasTrait(JsonNameTrait.class)); + assertFalse(renamed.hasTrait( + software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait.class), + "awsQuery must not use the ec2Query request-key trait"); + } + + @Test + void reservedRename_ec2Service_pinsRequestKeyAndResponseName() { + // ec2Query request key (@ec2QueryName, capitalized, verbatim on the wire) and response XML + // name (@xmlName) differ, so both are pinned rather than relying on capitalize(@xmlName). + Model m = inputModelWithProtocol("Kinesis", + new software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait(), "body"); + Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); + assertEquals("Body", renamed.expectTrait( + software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait.class).getValue(), + "ec2Query request key must be preserved verbatim as the capitalized original member name"); + assertEquals("body", renamed.expectTrait(XmlNameTrait.class).getValue(), + "ec2Query response XML name must be preserved as the original member name"); + assertFalse(renamed.hasTrait(JsonNameTrait.class)); + } + + /** As {@link #inputModel} but with the given protocol trait(s) on the service. */ + private static Model inputModelWithProtocol(String sdkId, + software.amazon.smithy.model.traits.Trait protocolTrait, + String... inputMembers) { + StructureShape.Builder in = StructureShape.builder().id("com.example#DoThingRequest"); + for (String member : inputMembers) { + in.addMember(member, ShapeId.from("smithy.api#String")); + } + StructureShape input = in.build(); + StructureShape output = StructureShape.builder().id("com.example#DoThingResponse").build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(software.amazon.smithy.aws.traits.ServiceTrait.builder() + .sdkId(sdkId).arnNamespace("x").cloudFormationName("X").cloudTrailEventSource("x").build()) + .addTrait(protocolTrait) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(input, output, op, service).assemble().unwrap(); + } + // --- computeReachableShapes tests --- @Test diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java index ddacd6fe035..cc70ad9c1c6 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java @@ -8,6 +8,7 @@ import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.JsonNameTrait; import static org.junit.jupiter.api.Assertions.*; @@ -59,6 +60,10 @@ void renamesBodyAndHeaders() { assertTrue(r.getMember("requestHeaders").isPresent()); assertTrue(r.getMember("body").isEmpty()); assertTrue(r.getMember("headers").isEmpty()); + assertEquals("body", r.getMember("requestBody").orElseThrow() + .expectTrait(JsonNameTrait.class).getValue(), "body wire key preserved"); + assertEquals("headers", r.getMember("requestHeaders").orElseThrow() + .expectTrait(JsonNameTrait.class).getValue(), "headers wire key preserved"); StructureShape a = out.expectShape( ShapeId.from("com.example#TestInvokeAuthorizerRequest"), StructureShape.class); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java index 82dcb27db15..9ac34b20a9e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java @@ -8,6 +8,7 @@ import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.traits.JsonNameTrait; import static org.junit.jupiter.api.Assertions.*; @@ -51,6 +52,8 @@ void renamesBody() { StructureShape r = out.expectShape(ShapeId.from("com.example#" + name), StructureShape.class); assertTrue(r.getMember("requestBody").isPresent(), name); assertTrue(r.getMember("Body").isEmpty(), name); + assertEquals("Body", r.getMember("requestBody").orElseThrow() + .expectTrait(JsonNameTrait.class).getValue(), name + " wire key preserved"); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java index 1bc07bf6656..e5d23270cb4 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java @@ -4,15 +4,17 @@ */ package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.traits.JsonNameTrait; +import software.amazon.smithy.model.traits.XmlNameTrait; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import static org.junit.jupiter.api.Assertions.*; @@ -28,20 +30,22 @@ private static StructureShape struct(String... memberNames) { @Test void renameMember_sourceAbsent_returnsEmpty() { - assertTrue(TransformSupport.renameMember(struct("name"), "body", "requestBody").isEmpty()); + assertTrue(TransformSupport.renameMember(struct("name"), "body", "requestBody", Protocol.JSON) + .isEmpty()); } @Test void renameMember_targetExists_throws() { StructureShape s = struct("body", "requestBody"); assertThrows(IllegalStateException.class, - () -> TransformSupport.renameMember(s, "body", "requestBody")); + () -> TransformSupport.renameMember(s, "body", "requestBody", Protocol.JSON)); } @Test void renameMember_success_renamesAndPreservesOrder() { StructureShape s = struct("a", "body", "z"); - StructureShape out = TransformSupport.renameMember(s, "body", "requestBody").orElseThrow(); + StructureShape out = TransformSupport.renameMember(s, "body", "requestBody", Protocol.JSON) + .orElseThrow(); assertFalse(out.getMember("body").isPresent()); assertTrue(out.getMember("requestBody").isPresent()); List order = new ArrayList<>(out.getAllMembers().keySet()); @@ -49,12 +53,86 @@ void renameMember_success_renamesAndPreservesOrder() { } @Test - void renameMember_withJsonName_attachesTraitToRenamedMember() { - StructureShape s = struct("generatedPolicyResult"); - StructureShape out = TransformSupport.renameMember( - s, "generatedPolicyResult", "generatedPolicyResults", - new JsonNameTrait("generatedPolicyResult")).orElseThrow(); - MemberShape renamed = out.getMember("generatedPolicyResults").orElseThrow(); - assertEquals("generatedPolicyResult", renamed.expectTrait(JsonNameTrait.class).getValue()); + void renameMember_jsonProtocol_pinsWireNameWithJsonName() { + StructureShape out = TransformSupport.renameMember(struct("body"), "body", "requestBody", + Protocol.REST_JSON).orElseThrow(); + MemberShape renamed = out.getMember("requestBody").orElseThrow(); + assertEquals("body", renamed.expectTrait(JsonNameTrait.class).getValue()); + assertFalse(renamed.hasTrait(XmlNameTrait.class), "JSON protocol must not add @xmlName"); + } + + @Test + void renameMember_xmlProtocol_pinsWireNameWithXmlName() { + StructureShape out = TransformSupport.renameMember(struct("body"), "body", "requestBody", + Protocol.QUERY_XML).orElseThrow(); + MemberShape renamed = out.getMember("requestBody").orElseThrow(); + assertEquals("body", renamed.expectTrait(XmlNameTrait.class).getValue()); + assertFalse(renamed.hasTrait(JsonNameTrait.class), "XML protocol must not add @jsonName"); + } + + @Test + void renameMember_ec2Protocol_bareMember_pinsRequestKeyAndResponseName() { + StructureShape out = TransformSupport.renameMember(struct("body"), "body", "requestBody", + Protocol.EC2).orElseThrow(); + MemberShape renamed = out.getMember("requestBody").orElseThrow(); + assertEquals("Body", renamed.expectTrait(Ec2QueryNameTrait.class).getValue(), + "request key = capitalized original member name, verbatim"); + assertEquals("body", renamed.expectTrait(XmlNameTrait.class).getValue(), + "response name = original member name"); + } + + @Test + void renameMember_ec2Protocol_derivesRequestKeyFromExistingXmlName() { + // CapacityReservationFleetIds: @xmlName present, no @ec2QueryName. The request key is + // capitalize(@xmlName), pinned verbatim so it no longer depends on the member name. + StructureShape s = StructureShape.builder().id("com.example#Req") + .addMember(MemberShape.builder().id("com.example#Req$capacityReservationFleetIds") + .target("smithy.api#String") + .addTrait(new XmlNameTrait("CapacityReservationFleetId")).build()) + .build(); + MemberShape renamed = TransformSupport.renameMember(s, "capacityReservationFleetIds", + "renamed", Protocol.EC2).orElseThrow().getMember("renamed").orElseThrow(); + assertEquals("CapacityReservationFleetId", + renamed.expectTrait(Ec2QueryNameTrait.class).getValue(), "request key from capitalize(@xmlName)"); + assertEquals("CapacityReservationFleetId", + renamed.expectTrait(XmlNameTrait.class).getValue(), "existing @xmlName preserved verbatim"); + } + + @Test + void renameMember_ec2Protocol_existingEc2QueryName_isNotOverridden() { + // Ipv6Addresses: @ec2QueryName is NOT camelCase(@xmlName), so capitalize(@xmlName) would be + // wrong for the request. Both existing traits must ride along verbatim. + StructureShape s = StructureShape.builder().id("com.example#Req") + .addMember(MemberShape.builder().id("com.example#Req$ipv6Addresses") + .target("smithy.api#String") + .addTrait(new Ec2QueryNameTrait("Ipv6Addresses")) + .addTrait(new XmlNameTrait("ipv6AddressesSet")).build()) + .build(); + MemberShape renamed = TransformSupport.renameMember(s, "ipv6Addresses", "renamed", + Protocol.EC2).orElseThrow().getMember("renamed").orElseThrow(); + assertEquals("Ipv6Addresses", renamed.expectTrait(Ec2QueryNameTrait.class).getValue()); + assertEquals("ipv6AddressesSet", renamed.expectTrait(XmlNameTrait.class).getValue()); + } + + @Test + void renameMember_cborProtocol_throws_noWireNameTrait() { + // rpcv2Cbor has no wire-name trait and ignores @jsonName, so a rename cannot preserve the + // wire key — fail fast rather than silently mis-generate. + StructureShape s = struct("body"); + assertThrows(IllegalStateException.class, + () -> TransformSupport.renameMember(s, "body", "requestBody", Protocol.CBOR)); + } + + @Test + void renameMember_existingJsonName_isNotOverridden() { + StructureShape s = StructureShape.builder().id("com.example#Req") + .addMember(MemberShape.builder().id("com.example#Req$body") + .target("smithy.api#String").addTrait(new JsonNameTrait("wireBody")).build()) + .build(); + StructureShape out = TransformSupport.renameMember(s, "body", "requestBody", Protocol.JSON) + .orElseThrow(); + MemberShape renamed = out.getMember("requestBody").orElseThrow(); + assertEquals("wireBody", renamed.expectTrait(JsonNameTrait.class).getValue(), + "existing wire name must be preserved verbatim, not reset to the old member name"); } } From e1a2763a5e083040c0217d5e456e75c83525baa6 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 27 Aug 2026 11:03:39 -0400 Subject: [PATCH 10/53] Smithy: add static DynamoDB AttributeValue resource bodies --- .../model/dynamodb/AttributeValue.cpp | 292 ++++++++++++++++++ .../model/dynamodb/AttributeValue.h | 166 ++++++++++ .../model/dynamodb/AttributeValueValue.cpp | 275 +++++++++++++++++ .../model/dynamodb/AttributeValueValue.h | 221 +++++++++++++ 4 files changed, 954 insertions(+) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.cpp create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.h create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.cpp create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.h diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.cpp b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.cpp new file mode 100644 index 00000000000..174eb686901 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.cpp @@ -0,0 +1,292 @@ +#include +#include + +#include + +using namespace Aws::DynamoDB::Model; +using namespace Aws::Utils; +using namespace Aws::Utils::Json; + +const Aws::String AttributeValue::GetS() const { + if (m_value) { + return m_value->GetS(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetS(const Aws::String& s) { + m_value = Aws::MakeShared("AttributeValue", s); + return *this; +} + +const Aws::String AttributeValue::GetN() const { + if (m_value) { + return m_value->GetN(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetN(const Aws::String& n) { + m_value = Aws::MakeShared("AttributeValue", n); + return *this; +} + +const ByteBuffer AttributeValue::GetB() const { + if (m_value) { + return m_value->GetB(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetB(const ByteBuffer& b) { + m_value = Aws::MakeShared("AttributeValue", b); + return *this; +} + +const ByteBuffer& AttributeValue::AccessB() const { + if (m_value) { + return m_value->AccessB(); + } else { + static const ByteBuffer empty; + return empty; + } +} + +const Aws::Vector AttributeValue::GetSS() const { + if (m_value) { + return m_value->GetSS(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetSS(const Aws::Vector& ss) { + m_value = Aws::MakeShared("AttributeValue", ss); + return *this; +} + +AttributeValue& AttributeValue::AddSItem(const Aws::String& sItem) { + if (!m_value) { + Aws::Vector ss; + ss.push_back(sItem); + m_value = Aws::MakeShared("AttributeValue", ss); + } else { + m_value->AddSItem(sItem); + } + return *this; +} + +const Aws::Vector AttributeValue::GetNS() const { + if (m_value) { + return m_value->GetNS(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetNS(const Aws::Vector& ns) { + m_value = Aws::MakeShared("AttributeValue", ns); + return *this; +} + +AttributeValue& AttributeValue::AddNItem(const Aws::String& nItem) { + if (!m_value) { + Aws::Vector ns; + ns.push_back(nItem); + m_value = Aws::MakeShared("AttributeValue", ns); + } else { + m_value->AddNItem(nItem); + } + return *this; +} + +const Aws::Vector AttributeValue::GetBS() const { + if (m_value) { + return m_value->GetBS(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetBS(const Aws::Vector& bs) { + m_value = Aws::MakeShared("AttributeValue", bs); + return *this; +} + +AttributeValue& AttributeValue::AddBItem(const ByteBuffer& bItem) { + if (!m_value) { + Aws::Vector bs; + bs.push_back(bItem); + m_value = Aws::MakeShared("AttributeValue", bs); + } else { + m_value->AddBItem(bItem); + } + return *this; +} + +AttributeValue& AttributeValue::AddBItem(const unsigned char* bItem, size_t size) { return AddBItem(ByteBuffer(bItem, size)); } + +const Aws::Map> AttributeValue::GetM() const { + if (m_value) { + return m_value->GetM(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetM(const Aws::Map>& map) { + m_value = Aws::MakeShared("AttributeValue", map); + return *this; +} + +AttributeValue& AttributeValue::AddMEntry(const Aws::String& key, const std::shared_ptr& value) { + if (!m_value) { + Aws::Map> map; + auto kvp = std::pair>(key, value); + map.insert(map.begin(), kvp); + m_value = Aws::MakeShared("AttributeValue", map); + } else { + m_value->AddMEntry(key, value); + } + + return *this; +} + +const Aws::Vector> AttributeValue::GetL() const { + if (m_value) { + return m_value->GetL(); + } else { + return {}; + } +} + +AttributeValue& AttributeValue::SetL(const Aws::Vector>& list) { + m_value = Aws::MakeShared("AttributeValue", list); + return *this; +} + +AttributeValue& AttributeValue::AddLItem(const std::shared_ptr& listItem) { + if (!m_value) { + Aws::Vector> list; + list.push_back(listItem); + m_value = Aws::MakeShared("AttributeValue", list); + } else { + m_value->AddLItem(listItem); + } + + return *this; +} + +bool AttributeValue::GetBool() const { + if (m_value) { + return m_value->GetBool(); + } else { + return false; + } +} + +AttributeValue& AttributeValue::SetBool(bool value) { + m_value = Aws::MakeShared("AttributeValue", value); + return *this; +} + +bool AttributeValue::GetNull() const { + if (m_value) { + return m_value->GetNull(); + } else { + return false; + } +} + +AttributeValue& AttributeValue::SetNull(bool value) { + m_value = Aws::MakeShared("AttributeValue", value); + return *this; +} + +AttributeValue& AttributeValue::operator=(JsonView jsonValue) { + if (jsonValue.ValueExists("S")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("N")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("B")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("SS")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("NS")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("BS")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("M")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("L")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("BOOL")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + if (jsonValue.ValueExists("NULL")) { + m_value = Aws::MakeShared("AttributeValue", jsonValue); + return *this; + } + + return *this; +} + +bool AttributeValue::operator==(const AttributeValue& other) const { + if (this == &other) return true; + + if (m_value) { + if (other.m_value) { + return *m_value == *other.m_value; + } else { + return m_value->IsDefault(); + } + } else if (other.m_value) { + return other.m_value->IsDefault(); + } + + return true; +} + +JsonValue AttributeValue::Jsonize() const { + if (m_value) { + return m_value->Jsonize(); + } else { + return JsonValue(); + } +} + +Aws::String AttributeValue::SerializeAttribute() const { + JsonValue value = Jsonize(); + return value.View().WriteReadable(); +} + +Aws::DynamoDB::Model::ValueType AttributeValue::GetType() const { return m_value->GetType(); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.h b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.h new file mode 100644 index 00000000000..299b8e21f87 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValue.h @@ -0,0 +1,166 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace Aws { +namespace DynamoDB { +namespace Model { +class AttributeValueValue; + +enum class ValueType { STRING, NUMBER, BYTEBUFFER, STRING_SET, NUMBER_SET, BYTEBUFFER_SET, ATTRIBUTE_MAP, ATTRIBUTE_LIST, BOOL, NULLVALUE }; + +/// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html +class AWS_DYNAMODB_API AttributeValue { + public: + AttributeValue() {}; + explicit AttributeValue(const Aws::String& s) { SetS(s); } + explicit AttributeValue(const Aws::Vector& ss) { SetSS(ss); } + AttributeValue(Aws::Utils::Json::JsonView jsonValue) { *this = jsonValue; } + + /// returns the String value if the value is specialized to this type, otherwise an empty String + const Aws::String GetS() const; + /// if already specialized to a String, sets the value to this String + /// if uninitialized, specializes the type to a String with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetS(const Aws::String& s); + /// if uninitialized, specializes the type to a String with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetS(const char* n) { return SetS(Aws::String(n)); } + + /// returns the Number value if the value is specialized to this type, otherwise an empty String + const Aws::String GetN() const; + /// if already specialized to a Number, sets the value to this Number + /// if uninitialized, specializes the type to a Number with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetN(const Aws::String& n); + /// if already specialized to a Number, sets the value to this Number + /// if uninitialized, specializes the type to a Number with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetN(const char* n) { return SetN(Aws::String(n)); } + /// if already specialized to a Number, sets the value to this Number + /// if uninitialized, specializes the type to a Number with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetN(const int nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); } + /// if already specialized to a Number, sets the value to this Number + /// if uninitialized, specializes the type to a Number with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetN(const float nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); } + /// if already specialized to a Number, sets the value to this Number + /// if uninitialized, specializes the type to a Number with specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetN(const double nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); } + + /// returns the ByteBuffer if the value is specialized to this type, otherwise an empty Buffer + const Aws::Utils::ByteBuffer GetB() const; + /// returns a reference to the ByteBuffer if the value is specialized to this type, otherwise a reference to an empty Buffer + const Aws::Utils::ByteBuffer& AccessB() const; + /// if already specialized to a ByteBuffer, sets the value to this value + /// if uninitialized, specializes the type to a ByteBuffer with the specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetB(const Aws::Utils::ByteBuffer& b); + + /// returns the String Vector if the value is specialized to this type, otherwise an empty Vector + const Aws::Vector GetSS() const; + /// if already specialized to a String Set, sets to these values + /// if uninitialized, specializes the type to a String Set with specified values + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetSS(const Aws::Vector& ss); + /// if the value is already specialized to a String Set then this value is appended + /// if uninitialized, specializes the type to a String Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddSItem(const Aws::String& sItem); + /// if the value is already specialized to a String Set then this value is appended + /// if uninitialized, specializes the type to a String Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddSItem(const char* sItem) { return AddSItem(Aws::String(sItem)); } + + /// returns the Number Vector if the value is specialized to this type, otherwise an empty Vector + const Aws::Vector GetNS() const; + /// if already specialized to a Number Set, sets to these values + /// if uninitialized, specializes the type to a Number Set with specified values + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetNS(const Aws::Vector& ns); + /// if the value is already specialized to a Number Set then this value is appended + /// if uninitialized, specializes the type to a Number Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddNItem(const Aws::String& nItem); + /// if the value is already specialized to a Number Set then this value is appended + /// if uninitialized, specializes the type to a Number Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddNItem(const char* nItem) { return AddNItem(Aws::String(nItem)); } + + /// returns the ByteBuffer Vector if the value is specialized to this type, otherwise an empty Vector + const Aws::Vector GetBS() const; + /// if already specialized to a ByteBuffer Set, sets to these values + /// if uninitialized, specializes the type to a ByteBuffer Set with specified values + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetBS(const Aws::Vector& bs); + /// if the value is already specialized to a ByteBuffer Set then this value is appended + /// if uninitialized, specializes the type to a ByteBuffer Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddBItem(const Aws::Utils::ByteBuffer& bItem); + /// if the value is already specialized to a ByteBuffer Set then this value is appended + /// if uninitialized, specializes the type to a ByteBuffer Set with this initial value + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddBItem(const unsigned char* bItem, size_t size); + + /// returns the Attribute Map if the value is specialized to this type, otherwise an empty Map + const Aws::Map> GetM() const; + /// if already specialized to an Attribute Map, sets to these values + /// if uninitialized, specializes the type to an Attribute Map with specified values + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetM(const Aws::Map>& map); + /// if the value is already specialized to a Map then this value is inserted + /// if uninitialized, specializes the type to a Map with these initial values + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddMEntry(const Aws::String& key, const std::shared_ptr& value); + /// if the value is already specialized to a Map then this value is inserted + /// if uninitialized, specializes the type to a Map with these initial values + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddMEntry(const char* key, const std::shared_ptr& value) { return AddMEntry(Aws::String(key), value); } + + /// returns the Attribute List if the value is specialized to this type, otherwise an empty Vector + const Aws::Vector> GetL() const; + /// if already specialized to an Attribute List, sets to these values + /// if uninitialized, specializes the type to an Attribute List with specified values + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetL(const Aws::Vector>& list); + /// if the value is already specialized to a List then this value is appended + /// if uninitialized, specializes the type to a List with these initial values + /// if already specialized to another type then the behavior is undefined + AttributeValue& AddLItem(const std::shared_ptr& listItem); + + /// returns the boolean if the value is specialized to this type, otherwise false + bool GetBool() const; + /// if already specialized to a boolean, sets to this value + /// if uninitialized, specializes the type to a boolean with the specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetBool(bool value); + + /// returns Null-Set-Value if the value is specialized to this type, otherwise false + bool GetNull() const; + /// if already specialized to a Null, sets to this value + /// if uninitialized, specializes the type to Null with the specified value + /// if already specialized to another type then the behavior is undefined + AttributeValue& SetNull(bool value); + + AttributeValue& operator=(Aws::Utils::Json::JsonView); + + bool operator==(const AttributeValue& other) const; + inline bool operator!=(const AttributeValue& other) const { return !(*this == other); } + + Aws::String SerializeAttribute() const; + Aws::Utils::Json::JsonValue Jsonize() const; + ValueType GetType() const; + + private: + std::shared_ptr m_value; +}; + +} // namespace Model +} // namespace DynamoDB +} // namespace Aws diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.cpp b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.cpp new file mode 100644 index 00000000000..1ed20e24d26 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.cpp @@ -0,0 +1,275 @@ +#include +#include + +using namespace Aws::DynamoDB::Model; +using namespace Aws::Utils; +using namespace Aws::Utils::Json; +using Aws::Utils::Array; + +// +// Strings +// + +JsonValue AttributeValueString::Jsonize() const { + JsonValue value; + + value.WithString("S", m_s); + + return value; +} + +// +// Numerics +// + +JsonValue AttributeValueNumeric::Jsonize() const { + JsonValue value; + + if (!m_n.empty()) { + value.WithString("N", m_n); + } + + return value; +} + +// +// ByteBuffers +// + +AttributeValueByteBuffer::AttributeValueByteBuffer(JsonView jsonValue) { m_b = HashingUtils::Base64Decode(jsonValue.GetString("B")); } + +JsonValue AttributeValueByteBuffer::Jsonize() const { + JsonValue value; + + value.WithString("B", HashingUtils::Base64Encode(m_b)); + + return value; +} + +// +// String Sets +// + +AttributeValueStringSet::AttributeValueStringSet(JsonView jsonValue) { + Aws::Utils::Array ss = jsonValue.GetArray("SS"); + + for (unsigned i = 0; i < ss.GetLength(); ++i) { + m_sS.push_back(ss[i].AsString()); + } +} + +bool AttributeValueStringSet::operator==(const AttributeValueValue& other) const { + const Aws::Vector& other_sS(other.GetSS()); + + if (GetType() != other.GetType() || m_sS.size() != other_sS.size()) return false; + + for (unsigned i = 0; i < m_sS.size(); ++i) + if (m_sS[i] != other_sS[i]) return false; + + return true; +} + +JsonValue AttributeValueStringSet::Jsonize() const { + JsonValue value; + + if (m_sS.size() > 0) { + Aws::Utils::Array array(m_sS.size()); + for (unsigned i = 0; i < m_sS.size(); ++i) { + array[i].AsString(m_sS[i]); + } + value.WithArray("SS", std::move(array)); + } + + return value; +} + +// +// Number Sets +// + +AttributeValueNumberSet::AttributeValueNumberSet(JsonView jsonValue) { + const Aws::Utils::Array ns = jsonValue.GetArray("NS"); + + for (unsigned i = 0; i < ns.GetLength(); ++i) { + m_nS.push_back(ns[i].AsString()); + } +} + +bool AttributeValueNumberSet::operator==(const AttributeValueValue& other) const { + const Aws::Vector& other_nS(other.GetNS()); + + if (GetType() != other.GetType() || m_nS.size() != other_nS.size()) return false; + + for (unsigned i = 0; i < m_nS.size(); ++i) + if (m_nS[i] != other_nS[i]) return false; + + return true; +} + +JsonValue AttributeValueNumberSet::Jsonize() const { + JsonValue value; + + if (m_nS.size() > 0) { + Aws::Utils::Array array(m_nS.size()); + for (unsigned i = 0; i < m_nS.size(); ++i) { + array[i].AsString(m_nS[i]); + } + value.WithArray("NS", std::move(array)); + } + + return value; +} + +// +// ByteBuffer Sets +// + +AttributeValueByteBufferSet::AttributeValueByteBufferSet(JsonView jsonValue) { + const Aws::Utils::Array bs = jsonValue.GetArray("BS"); + + for (unsigned i = 0; i < bs.GetLength(); ++i) { + m_bS.push_back(HashingUtils::Base64Decode(bs[i].AsString())); + } +} + +bool AttributeValueByteBufferSet::operator==(const AttributeValueValue& other) const { + const Aws::Vector& other_bS(other.GetBS()); + + if (GetType() != other.GetType() || m_bS.size() != other_bS.size()) return false; + + for (unsigned i = 0; i < m_bS.size(); ++i) + if (m_bS[i] != other_bS[i]) return false; + + return true; +} + +JsonValue AttributeValueByteBufferSet::Jsonize() const { + JsonValue value; + + if (m_bS.size() > 0) { + Aws::Utils::Array array(m_bS.size()); + for (unsigned i = 0; i < m_bS.size(); ++i) { + array[i].AsString(HashingUtils::Base64Encode(m_bS[i])); + } + value.WithArray("BS", std::move(array)); + } + + return value; +} + +// +// AttributeValue Map +// + +AttributeValueMap::AttributeValueMap(JsonView jsonValue) { + const Aws::Map map = jsonValue.GetObject("M").GetAllObjects(); + + for (auto& item : map) { + std::shared_ptr attributeValue = Aws::MakeShared("AttributeValue"); + JsonView itemValue = item.second; + *attributeValue = itemValue; + + m_m.emplace(item.first, std::move(attributeValue)); + } +} + +void AttributeValueMap::AddMEntry(const Aws::String& key, const std::shared_ptr& value) { + m_m.insert(m_m.begin(), std::pair>(key, value)); +} + +bool AttributeValueMap::operator==(const AttributeValueValue& other) const { + const Aws::Map>& other_m(other.GetM()); + + if (GetType() != other.GetType() || m_m.size() != other_m.size()) return false; + + if (m_m.size() > 0) { + for (auto& mapItem : m_m) { + auto foundItem = other_m.find(mapItem.first); + if (foundItem == other_m.end()) return false; + + if (*foundItem->second != *mapItem.second) return false; + } + } + + return true; +} + +JsonValue AttributeValueMap::Jsonize() const { + JsonValue value; + + JsonValue mapValue; + for (auto& mapItem : m_m) { + JsonValue mapEntry = mapItem.second->Jsonize(); + mapValue.WithObject(mapItem.first, std::move(mapEntry)); + } + value.WithObject("M", std::move(mapValue)); + + return value; +} + +// +// AttributeValue List +// + +AttributeValueList::AttributeValueList(JsonView jsonValue) { + const Aws::Utils::Array array = jsonValue.GetArray("L"); + + for (unsigned i = 0; i < array.GetLength(); ++i) { + std::shared_ptr attributeValue = Aws::MakeShared("AttributeValue"); + JsonView itemValue = array[i]; + *attributeValue = itemValue; + m_l.push_back(attributeValue); + } +} + +bool AttributeValueList::operator==(const AttributeValueValue& other) const { + const Aws::Vector>& other_l(other.GetL()); + + if (GetType() != other.GetType() || m_l.size() != other_l.size()) return false; + + if (m_l.size() > 0) { + for (unsigned i = 0; i < m_l.size(); ++i) { + if (*m_l[i] != *other_l[i]) return false; + } + } + + return true; +} + +JsonValue AttributeValueList::Jsonize() const { + JsonValue value; + + Aws::Utils::Array list(m_l.size()); + + for (unsigned i = 0; i < m_l.size(); ++i) { + list[i] = m_l[i]->Jsonize(); + } + + value.WithArray("L", std::move(list)); + + return value; +} + +// +// Bool type +// + +JsonValue AttributeValueBool::Jsonize() const { + JsonValue value; + + value.WithBool("BOOL", m_bool); + + return value; +} + +// +// Null type +// + +JsonValue AttributeValueNull::Jsonize() const { + JsonValue value; + + value.WithBool("NULL", m_null); + + return value; +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.h b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.h new file mode 100644 index 00000000000..f0a92e47095 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/resources/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/AttributeValueValue.h @@ -0,0 +1,221 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace Aws { +namespace DynamoDB { +namespace Model { + +class AttributeValue; + +class AttributeValueValue { + public: + virtual const Aws::String GetS() const { return {}; } + + virtual const Aws::String GetN() const { return {}; } + + virtual const Aws::Utils::ByteBuffer GetB() const { return {}; } + + virtual const Aws::Utils::ByteBuffer& AccessB() const { + static const Aws::Utils::ByteBuffer empty; + return empty; + } + + virtual const Aws::Vector GetSS() const { return {}; } + + virtual void AddSItem(const Aws::String&) { assert(false); } + + virtual const Aws::Vector GetNS() const { return {}; } + + virtual void AddNItem(const Aws::String&) { assert(false); } + + virtual const Aws::Vector GetBS() const { return {}; } + + virtual void AddBItem(const Aws::Utils::ByteBuffer&) { assert(false); } + + virtual const Aws::Map> GetM() const { return {}; } + + virtual void AddMEntry(const Aws::String&, const std::shared_ptr&) { assert(false); } + + virtual const Aws::Vector> GetL() const { return {}; } + + virtual void AddLItem(const std::shared_ptr&) { assert(false); } + + virtual bool GetBool() const { return false; } + + virtual bool GetNull() const { return false; } + + virtual bool IsDefault() const = 0; + + virtual bool operator==(const AttributeValueValue& other) const = 0; + + virtual Aws::Utils::Json::JsonValue Jsonize() const = 0; + + virtual ValueType GetType() const = 0; +}; + +/// String data type +class AttributeValueString final : public AttributeValueValue { + public: + explicit AttributeValueString(const Aws::String& value) : m_s(value) {} + explicit AttributeValueString(Aws::Utils::Json::JsonView jsonValue) : m_s(jsonValue.GetString("S")) {} + const Aws::String GetS() const override { return m_s; } + bool IsDefault() const override { return m_s.empty(); } + bool operator==(const AttributeValueValue& other) const override { return GetType() == other.GetType() && m_s == other.GetS(); } + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::STRING; } + + private: + Aws::String m_s; +}; + +/// Numeric data type +class AttributeValueNumeric final : public AttributeValueValue { + public: + explicit AttributeValueNumeric(const Aws::String& value) : m_n(value) {} + explicit AttributeValueNumeric(Aws::Utils::Json::JsonView jsonValue) : m_n(jsonValue.GetString("N")) {} + const Aws::String GetN() const override { return m_n; } + bool IsDefault() const override { return m_n.empty(); } + bool operator==(const AttributeValueValue& other) const override { return GetType() == other.GetType() && m_n == other.GetN(); }; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::NUMBER; } + + private: + Aws::String m_n; +}; + +/// Binary data type +class AttributeValueByteBuffer final : public AttributeValueValue { + public: + explicit AttributeValueByteBuffer(const Aws::Utils::ByteBuffer& value) : m_b(value) {} + explicit AttributeValueByteBuffer(Aws::Utils::Json::JsonView jsonValue); + const Aws::Utils::ByteBuffer GetB() const override { return m_b; } + const Aws::Utils::ByteBuffer& AccessB() const override { return m_b; } + bool IsDefault() const override { return m_b.GetLength() == 0; } + bool operator==(const AttributeValueValue& other) const override { return GetType() == other.GetType() && m_b == other.GetB(); } + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::BYTEBUFFER; } + + private: + Aws::Utils::ByteBuffer m_b; +}; + +/// String set data type +class AttributeValueStringSet final : public AttributeValueValue { + public: + explicit AttributeValueStringSet(const Aws::Vector& value) : m_sS(value) {} + explicit AttributeValueStringSet(Aws::Utils::Json::JsonView jsonValue); + const Aws::Vector GetSS() const override { return m_sS; } + void AddSItem(const Aws::String& sItem) override { m_sS.push_back(sItem); } + bool IsDefault() const override { return m_sS.empty(); } + bool operator==(const AttributeValueValue& other) const override; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::STRING_SET; } + + private: + Aws::Vector m_sS; +}; + +/// Number set data type +class AttributeValueNumberSet final : public AttributeValueValue { + public: + explicit AttributeValueNumberSet(const Aws::Vector& value) : m_nS(value) {} + explicit AttributeValueNumberSet(Aws::Utils::Json::JsonView jsonValue); + const Aws::Vector GetNS() const override { return m_nS; } + void AddNItem(const Aws::String& nItem) override { m_nS.push_back(nItem); } + bool IsDefault() const override { return m_nS.empty(); } + bool operator==(const AttributeValueValue& other) const override; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::NUMBER_SET; } + + private: + Aws::Vector m_nS; +}; + +/// ByteByffer set data type +class AttributeValueByteBufferSet final : public AttributeValueValue { + public: + explicit AttributeValueByteBufferSet(const Aws::Vector& value) : m_bS(value) {} + explicit AttributeValueByteBufferSet(Aws::Utils::Json::JsonView jsonValue); + const Aws::Vector GetBS() const override { return m_bS; } + void AddBItem(const Aws::Utils::ByteBuffer& bItem) override { m_bS.push_back(bItem); } + bool IsDefault() const override { return m_bS.empty(); } + bool operator==(const AttributeValueValue& other) const override; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::BYTEBUFFER_SET; } + + private: + Aws::Vector m_bS; +}; + +/// Map Attribute Type +class AttributeValueMap final : public AttributeValueValue { + public: + explicit AttributeValueMap(const Aws::Map>& value) : m_m(value) {} + explicit AttributeValueMap(Aws::Utils::Json::JsonView jsonValue); + const Aws::Map> GetM() const override { return m_m; } + void AddMEntry(const Aws::String& key, const std::shared_ptr& value) override; + bool IsDefault() const override { return m_m.empty(); } + bool operator==(const AttributeValueValue& other) const override; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::ATTRIBUTE_MAP; } + + private: + Aws::Map> m_m; +}; + +/// List Attribute Type +class AttributeValueList final : public AttributeValueValue { + public: + explicit AttributeValueList(const Aws::Vector>& value) : m_l(value) {} + explicit AttributeValueList(Aws::Utils::Json::JsonView jsonValue); + const Aws::Vector> GetL() const override { return m_l; } + void AddLItem(const std::shared_ptr& listItem) override { m_l.push_back(listItem); } + bool IsDefault() const override { return m_l.empty(); } + bool operator==(const AttributeValueValue& other) const override; + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::ATTRIBUTE_LIST; } + + private: + Aws::Vector> m_l; +}; + +/// Bool type +class AttributeValueBool final : public AttributeValueValue { + public: + explicit AttributeValueBool(bool value) : m_bool(value) {} + explicit AttributeValueBool(Aws::Utils::Json::JsonView jsonValue) : m_bool(jsonValue.GetBool("BOOL")) {} + bool GetBool() const override { return m_bool; } + bool IsDefault() const override { return m_bool == false; } + bool operator==(const AttributeValueValue& other) const override { return GetType() == other.GetType() && m_bool == other.GetBool(); } + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::BOOL; } + + private: + bool m_bool; +}; + +/// NULL type +class AttributeValueNull final : public AttributeValueValue { + public: + explicit AttributeValueNull(bool value) : m_null(value) {} + explicit AttributeValueNull(Aws::Utils::Json::JsonView jsonValue) : m_null(jsonValue.GetBool("NULL")) {} + bool GetNull() const override { return m_null; } + bool IsDefault() const override { return m_null == false; } + bool operator==(const AttributeValueValue& other) const override { return GetType() == other.GetType() && m_null == other.GetNull(); } + Aws::Utils::Json::JsonValue Jsonize() const override; + ValueType GetType() const override { return ValueType::NULLVALUE; } + + private: + bool m_null; +}; + +} // namespace Model +} // namespace DynamoDB +} // namespace Aws From 6222513ce2ab4076ffd93ba1441280d4e28258ac Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 27 Aug 2026 11:09:16 -0400 Subject: [PATCH 11/53] Smithy: DynamoDbRenderer emits bespoke AttributeValue; suppress default union render --- .../generators/model/ModelGenerator.java | 17 ++++- .../model/renderers/DynamoDbRenderer.java | 59 ++++++++++++++++++ .../model/renderers/DynamoDbRendererTest.java | 62 +++++++++++++++++++ 3 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRendererTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java index 1b07839704d..d9c23480747 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java @@ -7,6 +7,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.ClassifiedShapes; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.DynamoDbRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EnumShapeRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EventPayloadRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.EventStreamRenderer; @@ -17,9 +18,11 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.ProtocolTraits; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * Orchestrates C++ model code generation by dispatching classified shapes @@ -65,12 +68,24 @@ public void generateAll() { private List buildRenderers(ClassifiedShapes classified, RenderContext ctx) { List renderers = new ArrayList<>(); renderers.add(new EnumShapeRenderer(classified.enums(), ctx)); - renderers.add(new SubObjectRenderer(classified.subObjects(), classified.resultOutputIds(), ctx)); + + // DynamoDB's AttributeValue is a bespoke document type emitted by DynamoDbRenderer, not the + // generic union-struct SubObjectRenderer would produce. Drop it from the default sub-object + // set so it is not double-emitted. The shape stays in the model so member references resolve. + List subObjects = classified.subObjects(); + if ("dynamodb".equals(ctx.smithyServiceName())) { + subObjects = subObjects.stream() + .filter(s -> !"AttributeValue".equals(s.getId().getName())) + .collect(Collectors.toList()); + } + renderers.add(new SubObjectRenderer(subObjects, classified.resultOutputIds(), ctx)); + renderers.add(new RequestRenderer(classified.requests(), ctx)); renderers.add(new ResultRenderer(classified.results(), ctx)); renderers.add(new EventStreamRenderer(classified.eventStreamHandlers(), ctx)); renderers.add(new OutgoingEventStreamRenderer(classified.outgoingEventStreams(), ctx)); renderers.add(new EventPayloadRenderer(classified.blobPayloadEvents(), ctx)); + renderers.add(new DynamoDbRenderer(ctx)); return renderers; } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java new file mode 100644 index 00000000000..dd89c780818 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java @@ -0,0 +1,59 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; + +/** + * Emits DynamoDB's bespoke document-type {@code AttributeValue} / {@code AttributeValueValue} + * classes, matching the legacy C2J {@code DynamoDBJsonCppClientGenerator}. The four files are + * static hand-written C++ (no model-driven content); their bodies live as classpath resources and + * are written verbatim. No-op for every non-DynamoDB service. The default union rendering of the + * {@code AttributeValue} shape is suppressed in {@code ModelGenerator}. + */ +public final class DynamoDbRenderer implements ShapeRenderer { + + private static final String RESOURCE_DIR = + "/com/amazonaws/util/awsclientsmithygenerator/generators/model/dynamodb/"; + + private final RenderContext ctx; + + public DynamoDbRenderer(RenderContext ctx) { + this.ctx = ctx; + } + + @Override + public void render(CppWriterDelegator writerDelegator) { + if (!"dynamodb".equals(ctx.smithyServiceName())) { + return; + } + emit(writerDelegator, "AttributeValue.h", "include/aws/dynamodb/model/AttributeValue.h"); + emit(writerDelegator, "AttributeValue.cpp", "source/model/AttributeValue.cpp"); + emit(writerDelegator, "AttributeValueValue.h", "include/aws/dynamodb/model/AttributeValueValue.h"); + emit(writerDelegator, "AttributeValueValue.cpp", "source/model/AttributeValueValue.cpp"); + } + + private void emit(CppWriterDelegator writerDelegator, String resourceName, String outputPath) { + String body = readResource(RESOURCE_DIR + resourceName); + writerDelegator.useFileWriter(outputPath, writer -> writer.writeWithNoFormatting(body)); + } + + private static String readResource(String path) { + try (InputStream in = DynamoDbRenderer.class.getResourceAsStream(path)) { + if (in == null) { + throw new IllegalStateException("Missing DynamoDB resource on classpath: " + path); + } + return new String(in.readAllBytes(), StandardCharsets.UTF_8); + } catch (IOException e) { + throw new RuntimeException("Failed to read DynamoDB resource: " + path, e); + } + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRendererTest.java new file mode 100644 index 00000000000..f60dbf50a20 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRendererTest.java @@ -0,0 +1,62 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.ProtocolTraits; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.build.MockManifest; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies that {@link DynamoDbRenderer} emits DynamoDB's bespoke {@code AttributeValue} / + * {@code AttributeValueValue} classes verbatim from classpath resources for the {@code dynamodb} + * service only, and is a no-op for every other service. + */ +class DynamoDbRendererTest { + + /** Builds a minimal {@link RenderContext} whose {@code smithyServiceName} is the given name. */ + private static RenderContext ctx(String smithyServiceName) { + ServiceShape service = ServiceShape.builder() + .id("com.example#Example") + .version("2024-01-01") + .build(); + Model model = Model.builder().addShape(service).build(); + ProtocolTraits traits = ProtocolResolver.traitsFor(Protocol.JSON); + return new RenderContext(model, service, traits, + "DynamoDB", "AWS_DYNAMODB_API", smithyServiceName); + } + + @Test + void emitsFourAttributeValueFilesForDynamoDb() { + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + new DynamoDbRenderer(ctx("dynamodb")).render(delegator); + delegator.flushWriters(); + assertTrue(manifest.hasFile("include/aws/dynamodb/model/AttributeValue.h")); + assertTrue(manifest.hasFile("source/model/AttributeValue.cpp")); + assertTrue(manifest.hasFile("include/aws/dynamodb/model/AttributeValueValue.h")); + assertTrue(manifest.hasFile("source/model/AttributeValueValue.cpp")); + // Body was emitted verbatim: the class + a distinctive static-content marker are present. + String header = manifest.getFileString("include/aws/dynamodb/model/AttributeValue.h").orElseThrow(); + assertTrue(header.contains("class AWS_DYNAMODB_API AttributeValue")); + assertTrue(header.contains("std::shared_ptr m_value;")); + } + + @Test + void noOpForOtherService() { + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + new DynamoDbRenderer(ctx("kinesis")).render(delegator); + delegator.flushWriters(); + assertTrue(manifest.getFiles().isEmpty(), "non-dynamodb service must emit nothing"); + } +} From 52d3bff70f14683cf9d8ea4ac4a07e310b7579bc Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 27 Aug 2026 11:24:19 -0400 Subject: [PATCH 12/53] Smithy: test ModelGenerator suppresses default AttributeValue render for DynamoDB --- .../generators/model/ModelGeneratorTest.java | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java new file mode 100644 index 00000000000..e3ed2ec2fb9 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java @@ -0,0 +1,147 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.build.MockManifest; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.UnionShape; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * End-to-end guard for {@link ModelGenerator#buildRenderers} dropping DynamoDB's {@code + * AttributeValue} union from the default sub-object set. + * + *

The suppression is load-bearing, not cosmetic: {@code CppWriterDelegator.useFileWriter} + * keys writers by filename via {@code computeIfAbsent}, so if {@code AttributeValue} were left in + * {@code subObjects}, {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.SubObjectRenderer} + * and {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.DynamoDbRenderer} + * would both resolve the same {@code include/aws/dynamodb/model/AttributeValue.h} key, share one + * writer, and APPEND — silently concatenating the generic tagged-union struct onto the bespoke + * document type with no error. This test runs {@code ModelGenerator} end-to-end and asserts the + * emitted header is the bespoke class only, never the generic union. The per-renderer tests + * ({@code DynamoDbRendererTest}, {@code SubObjectRendererTest}) do not exercise the wiring in + * {@code buildRenderers} where the double-emit would occur. + */ +class ModelGeneratorTest { + + private static final String ATTRIBUTE_VALUE_HEADER = "include/aws/dynamodb/model/AttributeValue.h"; + // A synthetic union member whose generic per-member accessor (produced by SubObjectRenderer) + // does not exist anywhere in the bespoke AttributeValue resource, so its presence/absence + // cleanly distinguishes generic-union output from the hand-written document type. + private static final String GENERIC_UNION_MARKER = "WithSyntheticProbe"; + // A member unique to the bespoke hand-written AttributeValue (holds the AttributeValueValue). + private static final String BESPOKE_MARKER = "std::shared_ptr m_value;"; + + /** + * A minimal model with a service, one operation, and an {@code AttributeValue} union + * referenced by the operation input. The union carries a synthetic member so that, were it + * rendered generically, {@link #GENERIC_UNION_MARKER} would appear in the output. + */ + private static Model model() { + StringShape str = StringShape.builder().id("com.amazonaws.dynamodb#Str").build(); + UnionShape attributeValue = UnionShape.builder() + .id("com.amazonaws.dynamodb#AttributeValue") + .addMember("syntheticProbe", str.getId()) + .addMember("otherProbe", str.getId()) + .build(); + // Input carries an AttributeValue member, so the union is reachable and classified as a + // sub-object (which buildRenderers must then drop for dynamodb). + StructureShape input = StructureShape.builder() + .id("com.amazonaws.dynamodb#DoThingInput") + .addMember("item", attributeValue.getId()) + .build(); + StructureShape output = StructureShape.builder() + .id("com.amazonaws.dynamodb#DoThingOutput") + .addMember("result", str.getId()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.amazonaws.dynamodb#DoThing") + .input(input.getId()) + .output(output.getId()) + .build(); + software.amazon.smithy.model.shapes.ServiceShape service = + software.amazon.smithy.model.shapes.ServiceShape.builder() + .id("com.amazonaws.dynamodb#DynamoDB_20120810") + .version("2012-08-10") + .addOperation(op.getId()) + .build(); + return Model.builder().addShapes(str, attributeValue, input, output, op, service).build(); + } + + private static MockManifest generate(String smithyServiceName, String namespace, String exportMacro) { + Model model = model(); + software.amazon.smithy.model.shapes.ServiceShape service = model.expectShape( + ShapeId.from("com.amazonaws.dynamodb#DynamoDB_20120810"), + software.amazon.smithy.model.shapes.ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + new ModelGenerator(model, service, delegator, smithyServiceName, exportMacro, namespace) + .generateAll(); + delegator.flushWriters(); + return manifest; + } + + private static long countFilesNamed(MockManifest manifest, String fileName) { + return manifest.getFiles().stream() + .filter(p -> fileName.equals(p.getFileName().toString())) + .count(); + } + + @Test + void dynamoDb_emitsBespokeAttributeValueOnly_notGenericUnion() { + MockManifest manifest = generate("dynamodb", "DynamoDB", "AWS_DYNAMODB_API"); + + // Exactly one AttributeValue.h is emitted (no second writer, no append/corruption). + assertEquals(1, countFilesNamed(manifest, "AttributeValue.h"), + "exactly one AttributeValue.h must be emitted: " + manifest.getFiles()); + assertTrue(manifest.hasFile(ATTRIBUTE_VALUE_HEADER), + "bespoke header must be at the dynamodb model path: " + manifest.getFiles()); + + String header = manifest.getFileString(ATTRIBUTE_VALUE_HEADER).orElseThrow(); + // It is the bespoke document type ... + assertTrue(header.contains(BESPOKE_MARKER), + "AttributeValue.h must be the bespoke document type: " + header); + // ... and NOT the generic tagged-union SubObjectRenderer would produce for the union + // members. Its presence would mean the generic body was (also) written to this file. + assertFalse(header.contains(GENERIC_UNION_MARKER), + "AttributeValue.h must not contain generic-union accessors (double-emit/corruption): " + + header); + + // The bespoke companion type is emitted too. + assertTrue(manifest.hasFile("include/aws/dynamodb/model/AttributeValueValue.h"), + "AttributeValueValue.h must be emitted: " + manifest.getFiles()); + + // The member carrier's request header still references AttributeValue (the shape stays in + // the model so member references resolve). + String request = manifest.getFileString("include/aws/dynamodb/model/DoThingRequest.h") + .orElseThrow(); + assertTrue(request.contains("AttributeValue"), + "request header must still reference AttributeValue: " + request); + } + + @Test + void otherService_rendersAttributeValueUnionGenerically() { + // Control: the suppression is dynamodb-specific. For any other service, DynamoDbRenderer is + // a no-op and the AttributeValue union flows through SubObjectRenderer as a generic union, + // proving the buildRenderers filter is what removes it for dynamodb. + MockManifest manifest = generate("kinesis", "Kinesis", "AWS_KINESIS_API"); + + String header = manifest.getFileString("include/aws/kinesis/model/AttributeValue.h") + .orElseThrow(); + assertTrue(header.contains(GENERIC_UNION_MARKER), + "non-dynamodb service must render AttributeValue as a generic union: " + header); + assertFalse(header.contains(BESPOKE_MARKER), + "non-dynamodb service must not emit the bespoke document type: " + header); + } +} From 2c2660d28e3e53a2f1cf37fa5bd1894c7f03bcd7 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 27 Aug 2026 11:47:10 -0400 Subject: [PATCH 13/53] Smithy: move DynamoDB AttributeValue suppression into a service-level transform --- .../generators/model/ModelCodegenPlugin.java | 4 +- .../generators/model/ModelGenerator.java | 15 +--- .../generators/model/ShapeClassifier.java | 8 +- .../model/transforms/CustomRenderedTrait.java | 34 +++++++ .../model/transforms/DynamoDbTransforms.java | 54 +++++++++++ .../generators/model/ModelGeneratorTest.java | 49 ++++++---- .../generators/model/ShapeClassifierTest.java | 47 ++++++++++ .../transforms/DynamoDbTransformsTest.java | 89 +++++++++++++++++++ 8 files changed, 267 insertions(+), 33 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 99024a729a3..f5e2180392f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -9,6 +9,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.AccessAnalyzerTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.DynamoDbTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; @@ -56,7 +57,8 @@ public void execute(PluginContext context) { ApiGatewayTransforms.asTransform(), ApiGatewayV2Transforms.asTransform(), Ec2Transforms.asTransform(), - AccessAnalyzerTransforms.asTransform() + AccessAnalyzerTransforms.asTransform(), + DynamoDbTransforms.asTransform() // Future: S3Transforms.asTransform(), etc. )); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java index d9c23480747..52eba91a696 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGenerator.java @@ -18,11 +18,9 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.ProtocolTraits; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; -import software.amazon.smithy.model.shapes.Shape; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; /** * Orchestrates C++ model code generation by dispatching classified shapes @@ -68,18 +66,7 @@ public void generateAll() { private List buildRenderers(ClassifiedShapes classified, RenderContext ctx) { List renderers = new ArrayList<>(); renderers.add(new EnumShapeRenderer(classified.enums(), ctx)); - - // DynamoDB's AttributeValue is a bespoke document type emitted by DynamoDbRenderer, not the - // generic union-struct SubObjectRenderer would produce. Drop it from the default sub-object - // set so it is not double-emitted. The shape stays in the model so member references resolve. - List subObjects = classified.subObjects(); - if ("dynamodb".equals(ctx.smithyServiceName())) { - subObjects = subObjects.stream() - .filter(s -> !"AttributeValue".equals(s.getId().getName())) - .collect(Collectors.toList()); - } - renderers.add(new SubObjectRenderer(subObjects, classified.resultOutputIds(), ctx)); - + renderers.add(new SubObjectRenderer(classified.subObjects(), classified.resultOutputIds(), ctx)); renderers.add(new RequestRenderer(classified.requests(), ctx)); renderers.add(new ResultRenderer(classified.results(), ctx)); renderers.add(new EventStreamRenderer(classified.eventStreamHandlers(), ctx)); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index 0dc0eaf46ad..3f7c035a93b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -5,6 +5,7 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.CustomRenderedTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; @@ -199,7 +200,12 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto subObjects.add(shape); } } else if (shape.isStructureShape() || shape.isUnionShape()) { - subObjects.add(shape); + // A shape marked @customRendered is emitted by a dedicated renderer (e.g. + // DynamoDbRenderer for AttributeValue); skip the default sub-object emission so the + // two do not both write — and append into — the same model file. + if (!shape.hasTrait(CustomRenderedTrait.class)) { + subObjects.add(shape); + } } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java new file mode 100644 index 00000000000..34e6187d997 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java @@ -0,0 +1,34 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.ObjectNode; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal, synthetic marker trait stamped onto a shape by a service-level transform to signal that + * the shape is emitted by a dedicated {@code ShapeRenderer} (e.g. {@code DynamoDbRenderer}) rather + * than by the generic {@code SubObjectRenderer}. {@code ShapeClassifier} skips any structure/union + * bearing this trait, so the default sub-object body is never emitted for it — preventing the + * double-emit that {@code CppWriterDelegator}'s append-on-existing-writer behaviour would otherwise + * silently produce. + * + *

This trait is never declared in a Smithy model file; it exists only as an in-memory trait + * instance added inside a {@code ModelTransformer}. Smithy does not require a model-level trait + * definition for an in-memory instance because trait-definition validation runs only through the + * {@code ModelAssembler}, not through {@code Model.toBuilder().build()} / {@code ModelTransformer}. + * The synthetic {@code aws.cpp.internal} namespace keeps its id from ever colliding with a real + * modeled trait. + */ +public final class CustomRenderedTrait extends AnnotationTrait { + + /** The synthetic, internal-only id for this marker trait. */ + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#customRendered"); + + public CustomRenderedTrait() { + super(ID, ObjectNode.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java new file mode 100644 index 00000000000..e4be2f81216 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java @@ -0,0 +1,54 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; + +import java.util.Optional; + +/** + * DynamoDB model transform: marks the {@code AttributeValue} shape with {@link CustomRenderedTrait} + * so {@code ShapeClassifier} drops it from the default sub-object set. DynamoDB's {@code + * AttributeValue} is a bespoke document type emitted verbatim by {@code DynamoDbRenderer} (matching + * the legacy C2J {@code DynamoDBJsonCppClientGenerator}); if the generic {@code SubObjectRenderer} + * also emitted it, both writers would resolve the same {@code AttributeValue.h} path and append, + * silently concatenating the generic tagged-union struct onto the hand-written document type. + * + *

Keeping the suppression here — rather than as a service-name {@code if} in the generic + * {@code ModelGenerator} — keeps the orchestrator service-agnostic: the marker drives a generic + * classifier rule that applies to any shape a dedicated renderer owns. The shape itself stays in + * the model so member references (e.g. {@code PutItemInput.Item}) still resolve. + * + *

Self-guards on the raw smithy service name {@code dynamodb} (no-op for every other service). + * No-op when the {@code AttributeValue} shape is absent (upstream model changed). + */ +public final class DynamoDbTransforms { + + private DynamoDbTransforms() {} + + public static ModelTransform asTransform() { + return DynamoDbTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"dynamodb".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + ShapeId attributeValueId = ShapeId.fromParts(service.getId().getNamespace(), "AttributeValue"); + Optional attributeValue = model.getShape(attributeValueId); + if (attributeValue.isEmpty()) { + return model; // upstream model no longer defines AttributeValue: nothing to mark (no-op). + } + Shape marked = Shape.shapeToBuilder(attributeValue.get()) + .addTrait(new CustomRenderedTrait()) + .build(); + return model.toBuilder().addShape(marked).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java index e3ed2ec2fb9..0ff4553eb25 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java @@ -5,10 +5,13 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.DynamoDbTransforms; import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StringShape; import software.amazon.smithy.model.shapes.StructureShape; @@ -19,8 +22,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * End-to-end guard for {@link ModelGenerator#buildRenderers} dropping DynamoDB's {@code - * AttributeValue} union from the default sub-object set. + * End-to-end guard for suppressing DynamoDB's {@code AttributeValue} union from the default + * sub-object set. Suppression is now driven by {@link DynamoDbTransforms} marking the shape + * {@code @customRendered} and {@link ShapeClassifier} skipping marked shapes — the generic + * {@code ModelGenerator} no longer knows about dynamodb. This test therefore applies the DynamoDB + * transform to its model before running {@code ModelGenerator}, exercising the whole chain: + * transform-marks -> classifier-skips -> single bespoke file. * *

The suppression is load-bearing, not cosmetic: {@code CppWriterDelegator.useFileWriter} * keys writers by filename via {@code computeIfAbsent}, so if {@code AttributeValue} were left in @@ -30,8 +37,8 @@ * writer, and APPEND — silently concatenating the generic tagged-union struct onto the bespoke * document type with no error. This test runs {@code ModelGenerator} end-to-end and asserts the * emitted header is the bespoke class only, never the generic union. The per-renderer tests - * ({@code DynamoDbRendererTest}, {@code SubObjectRendererTest}) do not exercise the wiring in - * {@code buildRenderers} where the double-emit would occur. + * ({@code DynamoDbRendererTest}, {@code SubObjectRendererTest}) do not exercise this wiring where + * the double-emit would occur. */ class ModelGeneratorTest { @@ -47,8 +54,12 @@ class ModelGeneratorTest { * A minimal model with a service, one operation, and an {@code AttributeValue} union * referenced by the operation input. The union carries a synthetic member so that, were it * rendered generically, {@link #GENERIC_UNION_MARKER} would appear in the output. + * + *

The service carries a {@code ServiceTrait} whose {@code sdkId} is {@code smithyServiceName} + * so {@link DynamoDbTransforms}' own self-guard (which reads the service's sdk id) fires + * consistently with the {@code smithyServiceName} passed to {@code ModelGenerator}. */ - private static Model model() { + private static Model model(String smithyServiceName) { StringShape str = StringShape.builder().id("com.amazonaws.dynamodb#Str").build(); UnionShape attributeValue = UnionShape.builder() .id("com.amazonaws.dynamodb#AttributeValue") @@ -56,7 +67,7 @@ private static Model model() { .addMember("otherProbe", str.getId()) .build(); // Input carries an AttributeValue member, so the union is reachable and classified as a - // sub-object (which buildRenderers must then drop for dynamodb). + // sub-object (which the transform+classifier must then drop for dynamodb). StructureShape input = StructureShape.builder() .id("com.amazonaws.dynamodb#DoThingInput") .addMember("item", attributeValue.getId()) @@ -70,23 +81,27 @@ private static Model model() { .input(input.getId()) .output(output.getId()) .build(); - software.amazon.smithy.model.shapes.ServiceShape service = - software.amazon.smithy.model.shapes.ServiceShape.builder() - .id("com.amazonaws.dynamodb#DynamoDB_20120810") - .version("2012-08-10") - .addOperation(op.getId()) - .build(); + ServiceShape service = ServiceShape.builder() + .id("com.amazonaws.dynamodb#DynamoDB_20120810") + .version("2012-08-10") + .addTrait(ServiceTrait.builder().sdkId(smithyServiceName).arnNamespace("dynamodb") + .cloudFormationName("DynamoDB").cloudTrailEventSource("dynamodb").build()) + .addOperation(op.getId()) + .build(); return Model.builder().addShapes(str, attributeValue, input, output, op, service).build(); } private static MockManifest generate(String smithyServiceName, String namespace, String exportMacro) { - Model model = model(); - software.amazon.smithy.model.shapes.ServiceShape service = model.expectShape( - ShapeId.from("com.amazonaws.dynamodb#DynamoDB_20120810"), - software.amazon.smithy.model.shapes.ServiceShape.class); + Model model = model(smithyServiceName); + ServiceShape service = model.expectShape( + ShapeId.from("com.amazonaws.dynamodb#DynamoDB_20120810"), ServiceShape.class); + // Apply the DynamoDB service-level transform first, mirroring the real ModelCodegenPlugin + // pipeline: for dynamodb it marks AttributeValue @customRendered; for any other service it + // is a no-op. Suppression then flows through ShapeClassifier, not ModelGenerator. + Model transformed = DynamoDbTransforms.asTransform().apply(model, service); MockManifest manifest = new MockManifest(); CppWriterDelegator delegator = new CppWriterDelegator(manifest); - new ModelGenerator(model, service, delegator, smithyServiceName, exportMacro, namespace) + new ModelGenerator(transformed, service, delegator, smithyServiceName, exportMacro, namespace) .generateAll(); delegator.flushWriters(); return manifest; diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java index d00b8c63544..946557260de 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java @@ -4,6 +4,7 @@ */ package com.amazonaws.util.awsclientsmithygenerator.generators.model; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.CustomRenderedTrait; import org.junit.jupiter.api.Test; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; @@ -570,6 +571,52 @@ void nonBlobEvent_staysSubObject() { "Non-blob event struct must NOT be a blob-payload event: " + classified.blobPayloadEvents()); } + /** + * A service whose operation input references two structs: one marked {@link CustomRenderedTrait} + * (owned by a dedicated renderer) and one plain. The classifier's generic marker rule must drop + * the marked one from subObjects while keeping the plain one — for any service, not just + * dynamodb. + */ + private Model modelWithCustomRenderedShape() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape marked = StructureShape.builder() + .id("com.example#MarkedThing") + .addMember("name", str.getId()) + .addTrait(new CustomRenderedTrait()) + .build(); + StructureShape plain = StructureShape.builder() + .id("com.example#PlainThing") + .addMember("name", str.getId()) + .build(); + StructureShape request = StructureShape.builder() + .id("com.example#DoRequest") + .addMember("marked", marked.getId()) + .addMember("plain", plain.getId()) + .build(); + StructureShape response = StructureShape.builder().id("com.example#DoResponse").build(); + OperationShape op = OperationShape.builder() + .id("com.example#Do").input(request.getId()).output(response.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2023-01-01").addOperation(op.getId()) + .addTrait(ServiceTrait.builder().sdkId("test").arnNamespace("test") + .cloudFormationName("Test").cloudTrailEventSource("test").build()) + .build(); + return Model.builder().addShapes(str, marked, plain, request, response, op, service).build(); + } + + @Test + void customRenderedShape_isExcludedFromSubObjects() { + Model model = modelWithCustomRenderedShape(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertTrue(classified.subObjects().stream() + .noneMatch(s -> s.getId().getName().equals("MarkedThing")), + "@customRendered shape must be dropped from subObjects: " + classified.subObjects()); + assertTrue(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("PlainThing")), + "unmarked shape must remain a sub-object: " + classified.subObjects()); + } + @Test void classifiesEnumShape() { // StringShape with @enum trait -> classified as enum diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java new file mode 100644 index 00000000000..899681f7f22 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java @@ -0,0 +1,89 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.UnionShape; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies {@link DynamoDbTransforms} stamps {@link CustomRenderedTrait} onto DynamoDB's + * {@code AttributeValue} shape and is a no-op for other services / absent shapes. + * + *

Also serves as the empirical proof that Smithy accepts an in-memory trait instance + * with a synthetic, undefined id ({@code aws.cpp.internal#customRendered}) added inside a transform + * via {@code shapeToBuilder().addTrait(...)} + {@code model.toBuilder().build()} — no model-level + * trait definition required, because that build path does not run trait-definition validation. + */ +class DynamoDbTransformsTest { + + private static final String NS = "com.amazonaws.dynamodb"; + + private static Model model(String sdkId, boolean withAttributeValue) { + StringShape str = StringShape.builder().id(NS + "#Str").build(); + StructureShape.Builder inputB = StructureShape.builder().id(NS + "#PutItemInput"); + Model.Builder builder = Model.builder().addShape(str); + if (withAttributeValue) { + UnionShape attributeValue = UnionShape.builder() + .id(NS + "#AttributeValue") + .addMember("s", str.getId()) + .build(); + inputB.addMember("item", attributeValue.getId()); + builder.addShape(attributeValue); + } + StructureShape input = inputB.build(); + StructureShape output = StructureShape.builder().id(NS + "#PutItemOutput").build(); + OperationShape op = OperationShape.builder() + .id(NS + "#PutItem").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id(NS + "#DynamoDB_20120810").version("2012-08-10") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("dynamodb") + .cloudFormationName("DynamoDB").cloudTrailEventSource("dynamodb").build()) + .addOperation(op.getId()).build(); + return builder.addShapes(input, output, op, service).build(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from(NS + "#DynamoDB_20120810"), ServiceShape.class); + } + + @Test + void marksAttributeValueForDynamoDb() { + Model m = model("DynamoDB", true); + Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); + + assertTrue(out.expectShape(ShapeId.from(NS + "#AttributeValue")) + .hasTrait(CustomRenderedTrait.class), + "AttributeValue must be marked @customRendered for dynamodb"); + } + + @Test + void noOpForOtherService() { + // A non-dynamodb service (sdkId resolves via getSmithyServiceName) is untouched. + Model m = model("Kinesis", true); + Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); + assertSame(m, out, "transform must be a no-op for non-dynamodb services"); + assertFalse(out.expectShape(ShapeId.from(NS + "#AttributeValue")) + .hasTrait(CustomRenderedTrait.class), + "non-dynamodb AttributeValue must not be marked"); + } + + @Test + void noOpWhenAttributeValueAbsent() { + Model m = model("DynamoDB", false); + Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); + assertSame(m, out, "transform must be a no-op when AttributeValue is absent"); + } +} From 911da25ea7588ec1819b7b2ce23016096bbc5c4e Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 27 Aug 2026 14:30:48 -0400 Subject: [PATCH 14/53] OperationContextParamsTrait handling and JmesPath parsing Smithy: failing test for OperationContextParams header declarations Smithy: port OperationContextCppCodeGenerator string-building helper Smithy: port CppEndpointsJmesPathVisitor onto Smithy shape types Smithy: unit tests for OperationContextParams JMESPath visitor Smithy: emit GetOperationContextParams header decl for OperationContextParamsTrait Smithy: emit GetEndpointContextParams body and GetOperationContextParams accessor Smithy: emit Accessor comment before GetOperationContextParams for C2J parity Smithy: end-to-end tests for OperationContextParams JMESPath patterns Smithy: reduce OperationContextParams visitor boilerplate via UnsupportedExpressionVisitor base Smithy: whitespace-tolerant assertions for OperationContextParams visitor tests Smithy: immutable Emit-based OperationContextParams visitor; drop mutable code generator Smithy: correct stale accessor-emission comment after immutable redesign --- .../model/renderers/RequestRenderer.java | 57 ++++- .../model/renderers/endpointcontext/Emit.java | 20 ++ .../SmithyEndpointsJmesPathVisitor.java | 145 +++++++++++++ .../generators/model/RequestRendererTest.java | 199 ++++++++++++++++++ .../SmithyEndpointsJmesPathVisitorTest.java | 158 ++++++++++++++ 5 files changed, 578 insertions(+), 1 deletion(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/Emit.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 3751644a118..8622fafc506 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -14,6 +14,9 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.RequestInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.SmithyEndpointsJmesPathVisitor; +import software.amazon.smithy.jmespath.JmespathExpression; import software.amazon.smithy.model.node.BooleanNode; import software.amazon.smithy.model.node.Node; import software.amazon.smithy.model.node.NodeVisitor; @@ -26,6 +29,8 @@ import software.amazon.smithy.model.traits.HttpChecksumRequiredTrait; import software.amazon.smithy.model.traits.RequestCompressionTrait; import software.amazon.smithy.rulesengine.traits.ContextParamTrait; +import software.amazon.smithy.rulesengine.traits.OperationContextParamDefinition; +import software.amazon.smithy.rulesengine.traits.OperationContextParamsTrait; import software.amazon.smithy.rulesengine.traits.StaticContextParamsTrait; import java.util.ArrayList; @@ -187,6 +192,9 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.write(" * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation."); writer.write(" */"); writer.write("$L EndpointParameters GetEndpointContextParams() const override;", ctx.exportMacro()); + if (operation.hasTrait(OperationContextParamsTrait.class)) { + writer.write("$L Aws::Vector GetOperationContextParams() const;", ctx.exportMacro()); + } } writer.write(""); @@ -272,6 +280,9 @@ private void renderSource(CppWriterDelegator writerDelegator, if (hasEndpointContextParams(operation, shape)) { writer.write(""); renderEndpointContextParams(writer, className, operation, shape); + if (operation.hasTrait(OperationContextParamsTrait.class)) { + renderOperationContextParamsAccessor(writer, className, operation, shape); + } } writer.write(""); return; @@ -293,6 +304,9 @@ private void renderSource(CppWriterDelegator writerDelegator, if (hasEndpointContextParams(operation, shape)) { writer.write(""); renderEndpointContextParams(writer, className, operation, shape); + if (operation.hasTrait(OperationContextParamsTrait.class)) { + renderOperationContextParamsAccessor(writer, className, operation, shape); + } } writer.write(""); }); @@ -546,7 +560,8 @@ private static void validateGzipEncoding(OperationShape operation) { } private boolean hasEndpointContextParams(OperationShape operation, StructureShape shape) { - if (operation.hasTrait(StaticContextParamsTrait.class)) { + if (operation.hasTrait(StaticContextParamsTrait.class) + || operation.hasTrait(OperationContextParamsTrait.class)) { return true; } for (MemberShape member : shape.getAllMembers().values()) { @@ -589,10 +604,50 @@ private void renderEndpointContextParams(CppWriter writer, String className, } } + if (operation.hasTrait(OperationContextParamsTrait.class)) { + OperationContextParamsTrait opCtx = operation.expectTrait(OperationContextParamsTrait.class); + Map.Entry firstEntry = + opCtx.getParameters().entrySet().iterator().next(); + writer.write("// operation context params go here"); + writer.write( + "parameters.emplace_back(Aws::String{\"$L\"}, this->GetOperationContextParams(), " + + "Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT);", + firstEntry.getKey()); + } + writer.write("return parameters;"); }); } + private void renderOperationContextParamsAccessor(CppWriter writer, String className, + OperationShape operation, StructureShape shape) { + OperationContextParamsTrait opCtx = operation.expectTrait(OperationContextParamsTrait.class); + Map.Entry firstEntry = + opCtx.getParameters().entrySet().iterator().next(); + String path = firstEntry.getValue().getPath(); + + Emit emit = JmespathExpression.parse(path).accept( + new SmithyEndpointsJmesPathVisitor(this.ctx.model(), shape, "(*this)")); + + writer.write("// Accessor for dynamic context endpoint params"); + writer.openBlock("Aws::Vector $L::GetOperationContextParams() const {", "}", + className, () -> { + writer.write("Aws::Vector result;"); + // Visitor output is a single newline-separated string of flat (un-indented) statements; + // CppWriter applies the block indentation and clang-format normalizes the rest. Each line + // is passed as a $L argument so any $L or {n} tokens in the output are not reinterpreted. + String raw = emit.statements(); + if (!raw.isEmpty()) { + // Trim the single trailing newline the visitor always emits so we don't double-blank. + String trimmed = raw.endsWith("\n") ? raw.substring(0, raw.length() - 1) : raw; + for (String line : trimmed.split("\n", -1)) { + writer.write("$L", line); + } + } + writer.write("return result;"); + }); + } + private void appendStaticContextParam(CppWriter writer, String name, Node value) { value.accept(new NodeVisitor.Default() { @Override diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/Emit.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/Emit.java new file mode 100644 index 00000000000..5a7689c5e99 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/Emit.java @@ -0,0 +1,20 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext; + +import software.amazon.smithy.model.shapes.Shape; + +/** + * Immutable result of visiting one JMESPath node while building the body of + * {@code GetOperationContextParams()}. + * + * @param statements fully-formed C++ statement lines emitted at/under this node (may be empty) + * @param valueExpr C++ expression for the value located by the path so far (parents extend it) + * @param shape the Smithy shape resolved at this node (may be null at a terminal) + * @param rootName leading identifier of the current accessor chain (first field's name); + * the alias is {@code rootName + "Elems"} and a projection loop var is + * {@code rootName + "Elem"} + */ +public record Emit(String statements, String valueExpr, Shape shape, String rootName) {} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java new file mode 100644 index 00000000000..bc141d2142b --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java @@ -0,0 +1,145 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext; + +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; +import com.amazonaws.util.awsclientsmithygenerator.generators.waiters.jmespath.UnsupportedExpressionVisitor; +import software.amazon.smithy.build.SmithyBuildException; +import software.amazon.smithy.jmespath.ast.ExpressionTypeExpression; +import software.amazon.smithy.jmespath.ast.FieldExpression; +import software.amazon.smithy.jmespath.ast.FlattenExpression; +import software.amazon.smithy.jmespath.ast.FunctionExpression; +import software.amazon.smithy.jmespath.ast.MultiSelectListExpression; +import software.amazon.smithy.jmespath.ast.ProjectionExpression; +import software.amazon.smithy.jmespath.ast.Subexpression; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ListShape; +import software.amazon.smithy.model.shapes.MapShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.StructureShape; + +/** + * Translates the JMESPath expression carried by {@code smithy.rules#operationContextParams} + * into C++ that walks the request struct and pushes leaf values into a {@code result} + * {@code Aws::Vector}. Immutable and value-returning: each visit returns an + * {@link Emit}; parents compose children's results. Produces the same C++ structure as the + * legacy C2J generator (identifiers and statements), modulo whitespace (normalized downstream + * by clang-format). + */ +public final class SmithyEndpointsJmesPathVisitor extends UnsupportedExpressionVisitor { + + private final Model model; + private final Shape input; + private final String baseExpr; + private final String chainRoot; // null => the next field starts a new chain and names the alias + + /** Entry point: {@code baseExpr} is typically {@code "(*this)"}; the chain is not yet started. */ + public SmithyEndpointsJmesPathVisitor(Model model, Shape input, String baseExpr) { + this(model, input, baseExpr, null); + } + + private SmithyEndpointsJmesPathVisitor(Model model, Shape input, String baseExpr, String chainRoot) { + this.model = model; + this.input = input; + this.baseExpr = baseExpr; + this.chainRoot = chainRoot; + } + + @Override + public Emit visitField(FieldExpression expression) { + if (!(input instanceof StructureShape)) { + throw new SmithyBuildException("Failed to get field from expression"); + } + MemberShape member = ((StructureShape) input).getMember(expression.getName()).orElse(null); + if (member == null) { + throw new SmithyBuildException("Failed to get field from expression"); + } + String root = (chainRoot != null) ? chainRoot : expression.getName(); + String expr = baseExpr + ".Get" + CppNames.capitalize(expression.getName()) + "()"; + Shape target = model.expectShape(member.getTarget()); + if (target instanceof StructureShape) { + // Non-leaf: continue the accessor chain, emit nothing yet. + return new Emit("", expr, target, root); + } + String alias = root + "Elems"; + if (target.isStringShape()) { + String stmt = "auto& " + alias + " = " + expr + ";\n" + + "result.emplace_back(" + alias + ");\n"; + return new Emit(stmt, expr, target, root); + } + // List/map terminal of a chain consumed by an enclosing projection/keys: bind the alias only. + return new Emit("auto& " + alias + " = " + expr + ";\n", expr, target, root); + } + + @Override + public Emit visitSubexpression(Subexpression expression) { + Emit left = expression.getLeft().accept(this); + Emit right = expression.getRight().accept( + new SmithyEndpointsJmesPathVisitor(model, left.shape(), left.valueExpr(), left.rootName())); + return new Emit(left.statements() + right.statements(), + right.valueExpr(), right.shape(), right.rootName()); + } + + @Override + public Emit visitProjection(ProjectionExpression expression) { + Emit left = expression.getLeft().accept(this); + if (!(left.shape() instanceof ListShape)) { + // No list to iterate at this node (e.g. the trailing flatten-projection of a + // multi-select pattern, whose left subtree already emitted every statement). + // Propagate the left subtree's statements rather than discarding them. + return left; + } + String alias = left.rootName() + "Elems"; + String loopVar = left.rootName() + "Elem"; + Shape listMember = model.expectShape(((ListShape) left.shape()).getMember().getTarget()); + Emit body = expression.getRight().accept( + new SmithyEndpointsJmesPathVisitor(model, listMember, loopVar, null)); + String loop = "for (auto& " + loopVar + " : " + alias + ")\n{\n" + body.statements() + "}\n"; + return new Emit(left.statements() + loop, loopVar, listMember, null); + } + + @Override + public Emit visitFlatten(FlattenExpression expression) { + if (expression.getExpression() instanceof ProjectionExpression) { + return visitProjection((ProjectionExpression) expression.getExpression()); + } + return expression.getExpression().accept(this); + } + + @Override + public Emit visitFunction(FunctionExpression expression) { + if (!expression.getName().equals("keys")) { + throw new SmithyBuildException("Unsupported JMESPath expression"); + } + Emit arg = expression.getArguments().get(0).accept(this); + if (!(arg.shape() instanceof MapShape)) { + throw new SmithyBuildException("keys function not associated with Map type"); + } + MemberShape keyMember = ((MapShape) arg.shape()).getKey(); + if (!model.expectShape(keyMember.getTarget()).isStringShape()) { + throw new SmithyBuildException("map key of type other than string is not supported"); + } + String alias = arg.rootName() + "Elems"; + String loopVar = expression.getName() + "Elem"; // "keysElem" + String loop = "for (auto& " + loopVar + " : " + alias + ")\n{\n" + + "result.emplace_back(" + loopVar + ".first);\n}\n"; + return new Emit(arg.statements() + loop, loopVar, null, null); + } + + @Override + public Emit visitMultiSelectList(MultiSelectListExpression expression) { + StringBuilder sb = new StringBuilder(); + for (var e : expression.getExpressions()) { + sb.append(e.accept(this).statements()); + } + return new Emit(sb.toString(), baseExpr, input, null); + } + + @Override + public Emit visitExpressionType(ExpressionTypeExpression expression) { + return expression.getExpression().accept(this); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index fa361415318..aa52eca9798 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -11,6 +11,8 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ListShape; +import software.amazon.smithy.model.shapes.MapShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -19,6 +21,8 @@ import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.UnionShape; import software.amazon.smithy.model.traits.StreamingTrait; +import software.amazon.smithy.rulesengine.traits.OperationContextParamDefinition; +import software.amazon.smithy.rulesengine.traits.OperationContextParamsTrait; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -661,4 +665,199 @@ void rawStreamingPayloadRequestRestJson_headerAndSourceAgreeOnRequestSpecificHea assertFalse(c.contains("GetRequestSpecificHeaders"), "Source must not define GetRequestSpecificHeaders (contentType is stripped): " + c); } + + // --- smithy.rules#operationContextParams --- + + /** Operation carrying ONLY smithy.rules#operationContextParams (no static, no member-level). */ + private static Model operationContextParamsOnlyModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + // Map for keys(RequestItems) — the JMESPath the trait resolves. + MapShape requestItemsMap = MapShape.builder() + .id("com.example#RequestItemsMap") + .key(MemberShape.builder().id("com.example#RequestItemsMap$key").target(str.getId()).build()) + .value(MemberShape.builder().id("com.example#RequestItemsMap$value").target(str.getId()).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoBatchInput") + .addMember("RequestItems", requestItemsMap.getId()) + .build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoBatchOutput").addMember("r", str.getId()).build(); + OperationContextParamsTrait ctxTrait = OperationContextParamsTrait.builder() + .putParameter("ResourceArnList", + OperationContextParamDefinition.builder().path("keys(RequestItems)").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoBatch").input(input.getId()).output(output.getId()) + .addTrait(ctxTrait).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, requestItemsMap, input, output, op, service).build(); + } + + private static String renderOperationContextRequest(Model model, String fileSuffix) { + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + Protocol protocol = ProtocolResolver.resolve(service, model); + new RequestRenderer( + ShapeClassifier.classify(model, service, protocol).requests(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", "example")).render(delegator); + delegator.flushWriters(); + return manifest.getFileString(manifest.getFiles().stream() + .filter(p -> p.toString().endsWith(fileSuffix)).findFirst().orElseThrow()).orElseThrow(); + } + + @Test + void operationContextParams_headerDeclaresGetters() { + // An operation carrying only smithy.rules#operationContextParams must produce both the + // GetEndpointContextParams() virtual override and the GetOperationContextParams() accessor + // in its request header. Fails on main because RequestRenderer ignores the trait. + String h = renderOperationContextRequest(operationContextParamsOnlyModel(), "DoBatchRequest.h"); + assertTrue(h.contains("EndpointParameters GetEndpointContextParams() const override;"), + "Missing GetEndpointContextParams decl: " + h); + assertTrue(h.contains("Aws::Vector GetOperationContextParams() const;"), + "Missing GetOperationContextParams decl: " + h); + } + + /** Struct-dot-string: TableCreationParameters.TableName. */ + private static Model operationContextParams_dotAccessModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape tcp = StructureShape.builder() + .id("com.example#TableCreationParameters").addMember("TableName", str.getId()).build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoBatchInput") + .addMember("TableCreationParameters", tcp.getId()).build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoBatchOutput").addMember("r", str.getId()).build(); + OperationContextParamsTrait trait = OperationContextParamsTrait.builder() + .putParameter("ResourceArn", + OperationContextParamDefinition.builder().path("TableCreationParameters.TableName").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoBatch").input(input.getId()).output(output.getId()).addTrait(trait).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, tcp, input, output, op, service).build(); + } + + /** List-projection-dot-string: TransactItems[*].Get.TableName. */ + private static Model operationContextParams_projectionModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape get = StructureShape.builder() + .id("com.example#Get").addMember("TableName", str.getId()).build(); + StructureShape item = StructureShape.builder() + .id("com.example#Item").addMember("Get", get.getId()).build(); + ListShape list = ListShape.builder() + .id("com.example#Items") + .member(MemberShape.builder().id("com.example#Items$member").target(item.getId()).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoBatchInput").addMember("TransactItems", list.getId()).build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoBatchOutput").addMember("r", str.getId()).build(); + OperationContextParamsTrait trait = OperationContextParamsTrait.builder() + .putParameter("ResourceArnList", + OperationContextParamDefinition.builder().path("TransactItems[*].Get.TableName").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoBatch").input(input.getId()).output(output.getId()).addTrait(trait).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, get, item, list, input, output, op, service).build(); + } + + /** Multi-select-list flatten: TransactItems[*].[ConditionCheck.TableName, Put.TableName, Delete.TableName, Update.TableName][]. */ + private static Model operationContextParams_multiSelectFlattenModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape cc = StructureShape.builder() + .id("com.example#CC").addMember("TableName", str.getId()).build(); + StructureShape put = StructureShape.builder() + .id("com.example#Put").addMember("TableName", str.getId()).build(); + StructureShape del = StructureShape.builder() + .id("com.example#Delete").addMember("TableName", str.getId()).build(); + StructureShape upd = StructureShape.builder() + .id("com.example#Update").addMember("TableName", str.getId()).build(); + StructureShape item = StructureShape.builder() + .id("com.example#Item") + .addMember("ConditionCheck", cc.getId()) + .addMember("Put", put.getId()) + .addMember("Delete", del.getId()) + .addMember("Update", upd.getId()).build(); + ListShape list = ListShape.builder() + .id("com.example#Items") + .member(MemberShape.builder().id("com.example#Items$member").target(item.getId()).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoBatchInput").addMember("TransactItems", list.getId()).build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoBatchOutput").addMember("r", str.getId()).build(); + OperationContextParamsTrait trait = OperationContextParamsTrait.builder() + .putParameter("ResourceArnList", + OperationContextParamDefinition.builder() + .path("TransactItems[*].[ConditionCheck.TableName, Put.TableName, Delete.TableName, Update.TableName][]").build()) + .build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoBatch").input(input.getId()).output(output.getId()).addTrait(trait).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, cc, put, del, upd, item, list, input, output, op, service).build(); + } + + @Test + void operationContextParams_keysPattern_endToEnd() { + // Uses Task 1's operationContextParamsOnlyModel() (keys(RequestItems)). + String h = renderOperationContextRequest(operationContextParamsOnlyModel(), "DoBatchRequest.h"); + String c = renderOperationContextRequest(operationContextParamsOnlyModel(), "DoBatchRequest.cpp"); + assertTrue(h.contains("EndpointParameters GetEndpointContextParams() const override;"), h); + assertTrue(h.contains("Aws::Vector GetOperationContextParams() const;"), h); + assertTrue(c.contains( + "parameters.emplace_back(Aws::String{\"ResourceArnList\"}, this->GetOperationContextParams()"), c); + assertTrue(c.contains("Aws::Vector DoBatchRequest::GetOperationContextParams() const"), c); + assertTrue(c.contains("auto& RequestItemsElems = (*this).GetRequestItems();"), c); + assertTrue(c.contains("for (auto& keysElem : RequestItemsElems)"), c); + assertTrue(c.contains("result.emplace_back(keysElem.first);"), c); + } + + @Test + void operationContextParams_dotAccessPattern_endToEnd() { + Model model = operationContextParams_dotAccessModel(); + String h = renderOperationContextRequest(model, "DoBatchRequest.h"); + String c = renderOperationContextRequest(model, "DoBatchRequest.cpp"); + assertTrue(h.contains("Aws::Vector GetOperationContextParams() const;"), h); + assertTrue(c.contains( + "parameters.emplace_back(Aws::String{\"ResourceArn\"}, this->GetOperationContextParams()"), c); + assertTrue(c.contains( + "auto& TableCreationParametersElems = (*this).GetTableCreationParameters().GetTableName();"), c); + assertTrue(c.contains("result.emplace_back(TableCreationParametersElems);"), c); + assertFalse(c.contains("for (auto&"), + "Dot-access pattern must not emit a for-loop: " + c); + } + + @Test + void operationContextParams_projectionPattern_endToEnd() { + Model model = operationContextParams_projectionModel(); + String c = renderOperationContextRequest(model, "DoBatchRequest.cpp"); + assertTrue(c.contains("auto& TransactItemsElems = (*this).GetTransactItems();"), c); + assertTrue(c.contains("for (auto& TransactItemsElem : TransactItemsElems)"), c); + assertTrue(c.contains( + "auto& GetElems = TransactItemsElem.GetGet().GetTableName();"), c); + assertTrue(c.contains("result.emplace_back(GetElems);"), c); + } + + @Test + void operationContextParams_multiSelectFlattenPattern_endToEnd() { + Model model = operationContextParams_multiSelectFlattenModel(); + String c = renderOperationContextRequest(model, "DoBatchRequest.cpp"); + assertTrue(c.contains("for (auto& TransactItemsElem : TransactItemsElems)"), c); + // Each of the four field-access branches must appear inside the loop body. + for (String branch : java.util.List.of("ConditionCheck", "Put", "Delete", "Update")) { + assertTrue(c.contains( + "auto& " + branch + "Elems = TransactItemsElem.Get" + branch + "().GetTableName();"), + "Missing branch " + branch + ": " + c); + assertTrue(c.contains("result.emplace_back(" + branch + "Elems);"), + "Missing result push for " + branch + ": " + c); + } + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java new file mode 100644 index 00000000000..9de7100e3f7 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java @@ -0,0 +1,158 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.jmespath.JmespathExpression; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ListShape; +import software.amazon.smithy.model.shapes.MapShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class SmithyEndpointsJmesPathVisitorTest { + + private static final String STR = "com.example#String"; + + private static StringShape str() { + return StringShape.builder().id(STR).build(); + } + + private static String render(Model model, StructureShape input, String jmesPath) { + return JmespathExpression.parse(jmesPath) + .accept(new SmithyEndpointsJmesPathVisitor(model, input, "(*this)")) + .statements(); + } + + /** Collapse all runs of whitespace to a single space and trim, so comparisons ignore + * indentation/newlines (clang-format normalizes generated whitespace downstream). */ + private static String normalizeWs(String s) { + return s.replaceAll("\\s+", " ").trim(); + } + + @Test + void keysPattern() { + // Map under a request struct member "RequestItems". + MapShape reqMap = MapShape.builder() + .id("com.example#RequestItemsMap") + .key(MemberShape.builder().id("com.example#RequestItemsMap$key").target(STR).build()) + .value(MemberShape.builder().id("com.example#RequestItemsMap$value").target(STR).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#Req") + .addMember("RequestItems", reqMap.getId()).build(); + Model model = Model.builder().addShapes(str(), reqMap, input).build(); + + String expected = + "auto& RequestItemsElems = (*this).GetRequestItems();\n" + + "for (auto& keysElem : RequestItemsElems)\n" + + "{\n" + + "\tresult.emplace_back(keysElem.first);\n" + + "}\n"; + assertEquals(normalizeWs(expected), normalizeWs(render(model, input, "keys(RequestItems)"))); + } + + @Test + void dotAccessPattern() { + // Struct with member TableCreationParameters (Struct with member TableName: String). + StructureShape tcp = StructureShape.builder() + .id("com.example#TableCreationParameters") + .addMember("TableName", ShapeId.from(STR)).build(); + StructureShape input = StructureShape.builder() + .id("com.example#Req") + .addMember("TableCreationParameters", tcp.getId()).build(); + Model model = Model.builder().addShapes(str(), tcp, input).build(); + + String expected = + "auto& TableCreationParametersElems = (*this).GetTableCreationParameters().GetTableName();\n" + + "result.emplace_back(TableCreationParametersElems);\n"; + assertEquals(normalizeWs(expected), normalizeWs(render(model, input, "TableCreationParameters.TableName"))); + } + + @Test + void projectionPattern() { + // List>> under member TransactItems. + StructureShape getStruct = StructureShape.builder() + .id("com.example#Get").addMember("TableName", ShapeId.from(STR)).build(); + StructureShape item = StructureShape.builder() + .id("com.example#Item").addMember("Get", getStruct.getId()).build(); + ListShape list = ListShape.builder() + .id("com.example#Items") + .member(MemberShape.builder().id("com.example#Items$member").target(item.getId()).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#Req").addMember("TransactItems", list.getId()).build(); + Model model = Model.builder().addShapes(str(), getStruct, item, list, input).build(); + + String expected = + "auto& TransactItemsElems = (*this).GetTransactItems();\n" + + "for (auto& TransactItemsElem : TransactItemsElems)\n" + + "{\n" + + "\tauto& GetElems = TransactItemsElem.GetGet().GetTableName();\n" + + "\tresult.emplace_back(GetElems);\n" + + "}\n"; + assertEquals(normalizeWs(expected), normalizeWs(render(model, input, "TransactItems[*].Get.TableName"))); + } + + @Test + void multiSelectListFlattenPattern() { + // Same list-of-Item as projectionPattern but Item has four sibling struct members. + StructureShape cc = StructureShape.builder().id("com.example#CC").addMember("TableName", ShapeId.from(STR)).build(); + StructureShape put = StructureShape.builder().id("com.example#Put").addMember("TableName", ShapeId.from(STR)).build(); + StructureShape del = StructureShape.builder().id("com.example#Delete").addMember("TableName", ShapeId.from(STR)).build(); + StructureShape upd = StructureShape.builder().id("com.example#Update").addMember("TableName", ShapeId.from(STR)).build(); + StructureShape item = StructureShape.builder() + .id("com.example#Item") + .addMember("ConditionCheck", cc.getId()) + .addMember("Put", put.getId()) + .addMember("Delete", del.getId()) + .addMember("Update", upd.getId()).build(); + ListShape list = ListShape.builder() + .id("com.example#Items") + .member(MemberShape.builder().id("com.example#Items$member").target(item.getId()).build()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#Req").addMember("TransactItems", list.getId()).build(); + Model model = Model.builder().addShapes(str(), cc, put, del, upd, item, list, input).build(); + + String expected = + "auto& TransactItemsElems = (*this).GetTransactItems();\n" + + "for (auto& TransactItemsElem : TransactItemsElems)\n" + + "{\n" + + "\tauto& ConditionCheckElems = TransactItemsElem.GetConditionCheck().GetTableName();\n" + + "\tresult.emplace_back(ConditionCheckElems);\n" + + "\tauto& PutElems = TransactItemsElem.GetPut().GetTableName();\n" + + "\tresult.emplace_back(PutElems);\n" + + "\tauto& DeleteElems = TransactItemsElem.GetDelete().GetTableName();\n" + + "\tresult.emplace_back(DeleteElems);\n" + + "\tauto& UpdateElems = TransactItemsElem.GetUpdate().GetTableName();\n" + + "\tresult.emplace_back(UpdateElems);\n" + + "}\n"; + String actual = render(model, input, + "TransactItems[*].[ConditionCheck.TableName, Put.TableName, Delete.TableName, Update.TableName][]"); + assertEquals(normalizeWs(expected), normalizeWs(actual)); + } + + @Test + void unsupportedNode_throws() { + // A JMESPath expression exercising an unsupported node (filter projection) must throw + // UnsupportedOperationException, inherited from UnsupportedExpressionVisitor: fail fast + // on unrecognized constructs. + StructureShape input = StructureShape.builder() + .id("com.example#Req").addMember("x", ShapeId.from(STR)).build(); + Model model = Model.builder().addShapes(str(), input).build(); + + UnsupportedOperationException ex = assertThrows(UnsupportedOperationException.class, + () -> render(model, input, "x[?y == 'z']")); + // Only assert the prefix — the node-type suffix is intentionally not pinned. + assertTrue(ex.getMessage().startsWith("Unsupported expression:")); + } +} From 665c5b676b67466f5af850e31dc73716cfd28d5a Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 10:52:27 -0400 Subject: [PATCH 15/53] Smithy: scaffold S3Transforms and register in ModelCodegenPlugin --- .../generators/model/ModelCodegenPlugin.java | 6 ++- .../model/transforms/S3Transforms.java | 37 +++++++++++++ .../model/transforms/S3TransformsTest.java | 52 +++++++++++++++++++ 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index f5e2180392f..b38e4425aa6 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -13,6 +13,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SqsTransforms; import software.amazon.smithy.build.PluginContext; @@ -58,8 +59,9 @@ public void execute(PluginContext context) { ApiGatewayV2Transforms.asTransform(), Ec2Transforms.asTransform(), AccessAnalyzerTransforms.asTransform(), - DynamoDbTransforms.asTransform() - // Future: S3Transforms.asTransform(), etc. + DynamoDbTransforms.asTransform(), + S3Transforms.asTransform() + // Future: S3ControlTransforms.asTransform(), etc. )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java new file mode 100644 index 00000000000..2ef81b2ca3c --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -0,0 +1,37 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; + +/** + * S3 (and S3-CRT, which shares the S3 model) parity with the legacy C2J + * {@code S3RestXmlCppClientGenerator} for the {@code Model::} namespace. Composes the S3 model + * mutations that C2J applies in {@code generateSourceFiles}. Self-guards on the raw smithy service + * name; every sub-transform no-ops when its target shapes are absent and fast-fails on genuine + * collisions. Client/endpoint/ARN/S3Express/CRT customizations are out of scope (separate + * generators), as is serde-body emission (still stubbed plugin-wide). + */ +public final class S3Transforms { + + private S3Transforms() {} + + public static ModelTransform asTransform() { + return S3Transforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + String name = ServiceNameUtil.getSmithyServiceName(service, null); + if (!"s3".equals(name) && !"s3-crt".equals(name)) { + return model; + } + // Sub-transforms are chained here by later tasks, e.g.: + // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); + return model; + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java new file mode 100644 index 00000000000..c09404da4ef --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -0,0 +1,52 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import static org.junit.jupiter.api.Assertions.*; + +class S3TransformsTest { + + static final String NS = "com.amazonaws.s3"; + + static ServiceShape s3Service(String sdkId) { + return ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .build(); + } + + static Model modelWith(ServiceShape svc, software.amazon.smithy.model.shapes.Shape... shapes) { + Model.Builder b = Model.builder().addShape(svc); + for (software.amazon.smithy.model.shapes.Shape s : shapes) b.addShape(s); + return b.build(); + } + + @Test + void noOpForOtherService() { + ServiceShape svc = ServiceShape.builder().id("com.amazonaws.other#Other").version("1") + .addTrait(ServiceTrait.builder().sdkId("Other").arnNamespace("other") + .cloudFormationName("Other").cloudTrailEventSource("other").build()).build(); + Model m = Model.builder().addShape(svc).build(); + Model out = S3Transforms.asTransform().apply(m, svc); + assertSame(m, out, "non-s3 service must be untouched"); + } + + @Test + void noOpForS3WhenNothingToDo() { + ServiceShape svc = s3Service("S3"); + Model m = modelWith(svc); + // Scaffold has no sub-transforms yet: s3 model returns unchanged (structurally equal). + Model out = S3Transforms.asTransform().apply(m, svc); + assertNotNull(out); + assertTrue(out.getShape(ShapeId.from(NS + "#AmazonS3")).isPresent()); + } +} From 54352dc9afca62ec795ee35ea898602a85ef6d5c Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 10:58:27 -0400 Subject: [PATCH 16/53] Smithy: S3Transforms renames CopyObjectResult to CopyObjectResultDetails --- .../generators/ShapeUtil.java | 15 ------------ .../model/transforms/S3Transforms.java | 19 ++++++++++++++- .../model/transforms/S3TransformsTest.java | 24 +++++++++++++++++++ 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java index c36f1c5d9d8..ccfc16f6b05 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java @@ -78,21 +78,6 @@ public class ShapeUtil { "s3", Map.of("CopyObjectResult", "CopyObjectResultDetails") ); - /** - * S3 shapes that exist in C2J but not in Smithy. - * These must be synthetically injected into the model before generation. - */ - public static final Map> C2J_ONLY_SHAPES = Map.of( - "s3", Set.of( - "CopyObjectResultDetails", "SelectObjectContentEventStreamUnmarshallerError", - "CloudFunctionConfiguration", "QueueConfigurationDeprecated", - "TopicConfigurationDeprecated", "NotificationConfigurationDeprecated", - "RequestPaymentConfiguration", "PutObjectLockConfigurationRequestAlias", - "GetObjectLockConfigurationResultAlias", "ObjectLockConfigurationAlias", - "ObjectLockRuleAlias", "DefaultRetentionAlias", "ObjectLockRetentionAlias" - ) - ); - /** * Returns the hardcoded collision resolution for a shape, if one exists. */ diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 2ef81b2ca3c..a3d1452b7fc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -8,6 +8,9 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.transform.ModelTransformer; +import java.util.Map; /** * S3 (and S3-CRT, which shares the S3 model) parity with the legacy C2J @@ -32,6 +35,20 @@ private static Model apply(Model model, ServiceShape service) { } // Sub-transforms are chained here by later tasks, e.g.: // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return model; + return renameCopyObjectResult(model); + } + + private static Model renameCopyObjectResult(Model model) { + String ns = "com.amazonaws.s3"; + ShapeId oldId = ShapeId.fromParts(ns, "CopyObjectResult"); + ShapeId newId = ShapeId.fromParts(ns, "CopyObjectResultDetails"); + if (model.getShape(oldId).isEmpty()) { + return model; // source absent: nothing to rename. + } + if (model.getShape(newId).isPresent()) { + throw new IllegalStateException("S3 collision: '" + newId + "' already exists; cannot " + + "rename '" + oldId + "' onto it."); + } + return ModelTransformer.create().renameShapes(model, Map.of(oldId, newId)); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index c09404da4ef..6fe6898c3a4 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -49,4 +49,28 @@ void noOpForS3WhenNothingToDo() { assertNotNull(out); assertTrue(out.getShape(ShapeId.from(NS + "#AmazonS3")).isPresent()); } + + @Test + void renamesCopyObjectResultToDetails() { + ServiceShape svc = s3Service("S3"); + StructureShape copyResult = StructureShape.builder().id(NS + "#CopyObjectResult") + .addMember("ETag", ShapeId.from("smithy.api#String")).build(); + Model m = modelWith(svc, copyResult); + Model out = S3Transforms.asTransform().apply(m, svc); + assertTrue(out.getShape(ShapeId.from(NS + "#CopyObjectResultDetails")).isPresent(), + "renamed to CopyObjectResultDetails"); + assertFalse(out.getShape(ShapeId.from(NS + "#CopyObjectResult")).isPresent(), + "old name gone"); + } + + @Test + void copyObjectResultRename_throwsOnCollision() { + ServiceShape svc = s3Service("S3"); + StructureShape copyResult = StructureShape.builder().id(NS + "#CopyObjectResult") + .addMember("ETag", ShapeId.from("smithy.api#String")).build(); + StructureShape details = StructureShape.builder().id(NS + "#CopyObjectResultDetails") + .addMember("Other", ShapeId.from("smithy.api#String")).build(); + Model m = modelWith(svc, copyResult, details); + assertThrows(IllegalStateException.class, () -> S3Transforms.asTransform().apply(m, svc)); + } } From 46e87f05dbaf675e7817743a67148f8f269a1497 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:01:30 -0400 Subject: [PATCH 17/53] Smithy: remove dead ShapeUtil collision-resolution helpers (folded into S3Transforms) --- .../generators/ShapeUtil.java | 35 ------------ .../model/ShapeUtilExtensionsTest.java | 54 ------------------- 2 files changed, 89 deletions(-) delete mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java index ccfc16f6b05..5b5c391d8e6 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java @@ -64,41 +64,6 @@ public class ShapeUtil { "cloudfront", "2020_05_31" ); - /** - * Hardcoded shape rename collision resolutions from C2J. - * These shapes had name collisions with operation result wrappers in C2J - * and were given specific alternative names. - * Map: service-name -> Map of original-shape-name -> resolved-name - */ - private static final Map> HARDCODED_COLLISION_RESOLUTIONS = Map.of( - // accessanalyzer GeneratedPolicyResult->GeneratedPolicyResults is handled by - // AccessAnalyzerTransforms (a model transform), not this render-time map. - // cloudsearchdomain SearchResult->SearchResultDetails is dead: the current model has no - // colliding SearchResult shape. The s3 entry stays for the deferred S3 transform work. - "s3", Map.of("CopyObjectResult", "CopyObjectResultDetails") - ); - - /** - * Returns the hardcoded collision resolution for a shape, if one exists. - */ - public static Optional getHardcodedResolution(String smithyServiceName, String shapeName) { - Map serviceResolutions = HARDCODED_COLLISION_RESOLUTIONS.get(smithyServiceName); - if (serviceResolutions == null) return Optional.empty(); - return Optional.ofNullable(serviceResolutions.get(shapeName)); - } - - /** - * Returns the C++ class name for a shape, applying collision renames and numeric prefix rules. - */ - public static String getShapeCppName(String shapeName, String smithyServiceName) { - Optional resolved = getHardcodedResolution(smithyServiceName, shapeName); - if (resolved.isPresent()) return resolved.get(); - if (!shapeName.isEmpty() && Character.isDigit(shapeName.charAt(0))) { - return "The" + shapeName; - } - return shapeName; - } - /** * C2J/Smithy model mismatches: tokens that are integers in C2J but strings in Smithy. * diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java deleted file mode 100644 index 5daec8ce043..00000000000 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ -package com.amazonaws.util.awsclientsmithygenerator.generators.model; - -import com.amazonaws.util.awsclientsmithygenerator.generators.ShapeUtil; -import org.junit.jupiter.api.Test; - -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; - -class ShapeUtilExtensionsTest { - - @Test - void hardcodedCollisionResolution_s3CopyObjectResult() { - assertEquals(Optional.of("CopyObjectResultDetails"), - ShapeUtil.getHardcodedResolution("s3", "CopyObjectResult")); - } - - - @Test - void hardcodedCollisionResolution_noMatch_returnsEmpty() { - assertTrue(ShapeUtil.getHardcodedResolution("kinesis", "SomeShape").isEmpty()); - } - - @Test - void hardcodedCollisionResolution_medialive_noEntry() { - assertTrue(ShapeUtil.getHardcodedResolution("medialive", "BatchUpdateScheduleResult").isEmpty()); - } - - @Test - void shapeCppName_numericPrefix() { - assertEquals("The1stShape", ShapeUtil.getShapeCppName("1stShape", "someservice")); - } - - @Test - void shapeCppName_normalName_unchanged() { - assertEquals("MyShape", ShapeUtil.getShapeCppName("MyShape", "someservice")); - } - - @Test - void shapeCppName_medialive_noOverride_returnsUnchanged() { - assertEquals("BatchUpdateScheduleResult", - ShapeUtil.getShapeCppName("BatchUpdateScheduleResult", "medialive")); - } - - @Test - void shapeCppName_withHardcodedResolution_s3CopyObjectResult() { - assertEquals("CopyObjectResultDetails", - ShapeUtil.getShapeCppName("CopyObjectResult", "s3")); - } -} From fe84821587f9d2a744ea54df88f4cf5ded3ad5f6 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:08:04 -0400 Subject: [PATCH 18/53] Smithy: S3Transforms adds Expires/ExpiresString backward-compat member --- .../model/transforms/S3Transforms.java | 59 ++++++++++++++++++- .../model/transforms/S3TransformsTest.java | 29 +++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index a3d1452b7fc..c0bb3e3797f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -7,9 +7,16 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.transform.ModelTransformer; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -35,7 +42,7 @@ private static Model apply(Model model, ServiceShape service) { } // Sub-transforms are chained here by later tasks, e.g.: // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return renameCopyObjectResult(model); + return addExpiresCustomization(renameCopyObjectResult(model)); } private static Model renameCopyObjectResult(Model model) { @@ -51,4 +58,54 @@ private static Model renameCopyObjectResult(Model model) { } return ModelTransformer.create().renameShapes(model, Map.of(oldId, newId)); } + + private static final String EXPIRES_DEPRECATION = + "Deprecated: Please use ExpiresString instead. " + System.lineSeparator() + " * "; + + private static Model addExpiresCustomization(Model model) { + String ns = "com.amazonaws.s3"; + ShapeId expiresStringId = ShapeId.fromParts(ns, "ExpiresString"); + List withExpires = model.shapes(StructureShape.class) + .filter(s -> s.getMember("Expires").isPresent()) + .toList(); + if (withExpires.isEmpty()) { + return model; // no Expires anywhere: nothing to do. + } + List replacements = new ArrayList<>(); + // Inject the ExpiresString string shape once (idempotent: skip if present). + if (model.getShape(expiresStringId).isEmpty()) { + replacements.add(StringShape.builder().id(expiresStringId).build()); + } + for (StructureShape struct : withExpires) { + if (struct.getMember("ExpiresString").isPresent()) { + continue; // already customized (idempotent). + } + MemberShape expires = struct.getAllMembers().get("Expires"); + StructureShape.Builder b = StructureShape.builder().id(struct.getId()); + struct.getAllTraits().values().forEach(b::addTrait); + for (MemberShape m : struct.getAllMembers().values()) { + if (m.getMemberName().equals("Expires")) { + // Rewrite Expires' documentation to prepend the deprecation note. + String existingDoc = m.getTrait(DocumentationTrait.class) + .map(DocumentationTrait::getValue).orElse(""); + b.addMember("Expires", m.getTarget(), mb -> { + m.getAllTraits().values().forEach(mb::addTrait); + if (!existingDoc.toLowerCase().contains("deprecated")) { + mb.addTrait(new DocumentationTrait(EXPIRES_DEPRECATION + existingDoc)); + } + }); + } else { + b.addMember(m.getMemberName(), m.getTarget(), + mb -> m.getAllTraits().values().forEach(mb::addTrait)); + } + } + // Add ExpiresString cloning Expires' traits (so it reads the same header), retargeted. + b.addMember("ExpiresString", expiresStringId, + mb -> expires.getAllTraits().values().stream() + .filter(t -> !(t instanceof DocumentationTrait)) + .forEach(mb::addTrait)); + replacements.add(b.build()); + } + return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 6fe6898c3a4..6ff99f1ffb5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; @@ -73,4 +74,32 @@ void copyObjectResultRename_throwsOnCollision() { Model m = modelWith(svc, copyResult, details); assertThrows(IllegalStateException.class, () -> S3Transforms.asTransform().apply(m, svc)); } + + @Test + void addsExpiresStringMemberAndDeprecatesExpires() { + ServiceShape svc = s3Service("S3"); + software.amazon.smithy.model.shapes.TimestampShape expires = + software.amazon.smithy.model.shapes.TimestampShape.builder() + .id(NS + "#Expires").build(); + StructureShape getObjectOutput = StructureShape.builder().id(NS + "#GetObjectOutput") + .addMember("Expires", expires.getId(), b -> b + .addTrait(new software.amazon.smithy.model.traits.HttpHeaderTrait("Expires")) + .addTrait(new software.amazon.smithy.model.traits.DocumentationTrait("The date and time at which the object is no longer cacheable."))) + .build(); + Model m = modelWith(svc, expires, getObjectOutput); + Model out = S3Transforms.asTransform().apply(m, svc); + + assertTrue(out.getShape(ShapeId.from(NS + "#ExpiresString")).isPresent(), + "ExpiresString string shape injected"); + StructureShape outShape = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); + MemberShape expiresString = outShape.getMember("ExpiresString").orElseThrow(); + assertEquals(NS + "#ExpiresString", expiresString.getTarget().toString()); + assertEquals("Expires", + expiresString.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue(), + "ExpiresString reads the same Expires header"); + MemberShape expiresMember = outShape.getMember("Expires").orElseThrow(); + assertTrue(expiresMember.expectTrait(software.amazon.smithy.model.traits.DocumentationTrait.class) + .getValue().startsWith("Deprecated: Please use ExpiresString instead."), + "Expires member carries the deprecation note"); + } } From 56a733b4e86e93536dfe18c6d77b4015afb960b3 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:12:59 -0400 Subject: [PATCH 19/53] Smithy: scope S3 ExpiresString to outputs and retype Expires to timestamp --- .../model/transforms/S3Transforms.java | 30 ++++++- .../model/transforms/S3TransformsTest.java | 83 +++++++++++++++---- 2 files changed, 96 insertions(+), 17 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index c0bb3e3797f..778e89da2f9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -7,17 +7,22 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StringShape; import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.TimestampShape; import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * S3 (and S3-CRT, which shares the S3 model) parity with the legacy C2J @@ -42,7 +47,7 @@ private static Model apply(Model model, ServiceShape service) { } // Sub-transforms are chained here by later tasks, e.g.: // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return addExpiresCustomization(renameCopyObjectResult(model)); + return addExpiresCustomization(renameCopyObjectResult(model), service); } private static Model renameCopyObjectResult(Model model) { @@ -62,14 +67,22 @@ private static Model renameCopyObjectResult(Model model) { private static final String EXPIRES_DEPRECATION = "Deprecated: Please use ExpiresString instead. " + System.lineSeparator() + " * "; - private static Model addExpiresCustomization(Model model) { + private static Model addExpiresCustomization(Model model, ServiceShape service) { String ns = "com.amazonaws.s3"; + // C2J renders Expires as a timestamp on every shape that carries it, though the current + // Smithy model types it as a string. Retype the shape itself before scoping ExpiresString. + model = retypeExpiresToTimestamp(model, ns); ShapeId expiresStringId = ShapeId.fromParts(ns, "ExpiresString"); + // ExpiresString (and the deprecation note) live only on operation-output structures. + Set outputShapes = TopDownIndex.of(model).getContainedOperations(service).stream() + .map(OperationShape::getOutputShape) + .collect(Collectors.toSet()); List withExpires = model.shapes(StructureShape.class) + .filter(s -> outputShapes.contains(s.getId())) .filter(s -> s.getMember("Expires").isPresent()) .toList(); if (withExpires.isEmpty()) { - return model; // no Expires anywhere: nothing to do. + return model; // no output shape carries Expires: nothing more to do. } List replacements = new ArrayList<>(); // Inject the ExpiresString string shape once (idempotent: skip if present). @@ -108,4 +121,15 @@ private static Model addExpiresCustomization(Model model) { } return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } + + private static Model retypeExpiresToTimestamp(Model model, String ns) { + ShapeId expiresId = ShapeId.fromParts(ns, "Expires"); + Shape existing = model.getShape(expiresId).orElse(null); + if (existing == null || existing instanceof TimestampShape) { + return model; // absent or already a timestamp: nothing to retype. + } + TimestampShape.Builder b = TimestampShape.builder().id(expiresId); + existing.getAllTraits().values().forEach(b::addTrait); + return model.toBuilder().addShape(b.build()).build(); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 6ff99f1ffb5..c0875701755 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -8,9 +8,15 @@ import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.TimestampShape; +import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.HttpHeaderTrait; import static org.junit.jupiter.api.Assertions.*; @@ -75,31 +81,80 @@ void copyObjectResultRename_throwsOnCollision() { assertThrows(IllegalStateException.class, () -> S3Transforms.asTransform().apply(m, svc)); } - @Test - void addsExpiresStringMemberAndDeprecatesExpires() { - ServiceShape svc = s3Service("S3"); - software.amazon.smithy.model.shapes.TimestampShape expires = - software.amazon.smithy.model.shapes.TimestampShape.builder() - .id(NS + "#Expires").build(); - StructureShape getObjectOutput = StructureShape.builder().id(NS + "#GetObjectOutput") + /** + * Builds an S3 model with a single PutObject-style operation whose input and output both + * carry an {@code Expires} member (initially a {@code string}, matching the current model), + * mirroring the operation-wiring pattern in {@code AccessAnalyzerTransformsTest}. + */ + private static Model expiresModel() { + Shape expires = StringShape.builder().id(NS + "#Expires").build(); + StructureShape input = StructureShape.builder().id(NS + "#PutObjectRequest") .addMember("Expires", expires.getId(), b -> b - .addTrait(new software.amazon.smithy.model.traits.HttpHeaderTrait("Expires")) - .addTrait(new software.amazon.smithy.model.traits.DocumentationTrait("The date and time at which the object is no longer cacheable."))) + .addTrait(new HttpHeaderTrait("Expires")) + .addTrait(new DocumentationTrait("The date and time at which the object is no longer cacheable."))) .build(); - Model m = modelWith(svc, expires, getObjectOutput); - Model out = S3Transforms.asTransform().apply(m, svc); + StructureShape output = StructureShape.builder().id(NS + "#GetObjectOutput") + .addMember("Expires", expires.getId(), b -> b + .addTrait(new HttpHeaderTrait("Expires")) + .addTrait(new DocumentationTrait("The date and time at which the object is no longer cacheable."))) + .build(); + OperationShape op = OperationShape.builder().id(NS + "#GetObject") + .input(input.getId()).output(output.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId("S3").arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(expires, input, output, op, svc).assemble().unwrap(); + } + + private static ServiceShape expiresService(Model m) { + return m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); + } + + @Test + void retypesExpiresShapeToTimestamp() { + Model m = expiresModel(); + assertTrue(m.expectShape(ShapeId.from(NS + "#Expires")).isStringShape(), + "precondition: Expires starts as a string"); + Model out = S3Transforms.asTransform().apply(m, expiresService(m)); + assertTrue(out.expectShape(ShapeId.from(NS + "#Expires")) instanceof TimestampShape, + "Expires retyped to a timestamp shape"); + // Both input and output Expires members now target the timestamp. + StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + StructureShape output = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); + assertTrue(out.expectShape(input.getMember("Expires").orElseThrow().getTarget()) instanceof TimestampShape); + assertTrue(out.expectShape(output.getMember("Expires").orElseThrow().getTarget()) instanceof TimestampShape); + } + + @Test + void addsExpiresStringToOutputAndDeprecatesExpires() { + Model m = expiresModel(); + Model out = S3Transforms.asTransform().apply(m, expiresService(m)); assertTrue(out.getShape(ShapeId.from(NS + "#ExpiresString")).isPresent(), "ExpiresString string shape injected"); StructureShape outShape = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); MemberShape expiresString = outShape.getMember("ExpiresString").orElseThrow(); assertEquals(NS + "#ExpiresString", expiresString.getTarget().toString()); - assertEquals("Expires", - expiresString.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue(), + assertEquals("Expires", expiresString.expectTrait(HttpHeaderTrait.class).getValue(), "ExpiresString reads the same Expires header"); MemberShape expiresMember = outShape.getMember("Expires").orElseThrow(); - assertTrue(expiresMember.expectTrait(software.amazon.smithy.model.traits.DocumentationTrait.class) + assertTrue(expiresMember.expectTrait(DocumentationTrait.class) .getValue().startsWith("Deprecated: Please use ExpiresString instead."), "Expires member carries the deprecation note"); } + + @Test + void doesNotAddExpiresStringToInput() { + Model m = expiresModel(); + Model out = S3Transforms.asTransform().apply(m, expiresService(m)); + + StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + assertFalse(input.getMember("ExpiresString").isPresent(), + "input shape must not gain ExpiresString"); + MemberShape inputExpires = input.getMember("Expires").orElseThrow(); + assertFalse(inputExpires.getTrait(DocumentationTrait.class) + .map(DocumentationTrait::getValue).orElse("").startsWith("Deprecated:"), + "input Expires must not carry the deprecation note"); + } } From 00b805e806bac487c14197ab42f8da0426bfef18 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:17:37 -0400 Subject: [PATCH 20/53] Smithy: S3Transforms injects GetObject Id2/RequestId header members --- .../model/transforms/S3Transforms.java | 31 ++++++++++++++++++- .../model/transforms/S3TransformsTest.java | 20 ++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 778e89da2f9..c1236983a56 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -17,10 +17,12 @@ import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.TimestampShape; import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.HttpHeaderTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -47,7 +49,34 @@ private static Model apply(Model model, ServiceShape service) { } // Sub-transforms are chained here by later tasks, e.g.: // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return addExpiresCustomization(renameCopyObjectResult(model), service); + return hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)); + } + + private static Model hackGetObjectResult(Model model) { + String ns = "com.amazonaws.s3"; + ShapeId outputId = ShapeId.fromParts(ns, "GetObjectOutput"); + Optional outputOpt = model.getShape(outputId).flatMap(Shape::asStructureShape); + if (outputOpt.isEmpty()) { + return model; // no GetObjectOutput: nothing to do. + } + StructureShape output = outputOpt.get(); + if (output.getMember("Id2").isPresent() && output.getMember("RequestId").isPresent()) { + return model; // already injected (idempotent) — or upstream added them. + } + ShapeId id2ShapeId = ShapeId.fromParts(ns, "ObjectId2"); + ShapeId reqIdShapeId = ShapeId.fromParts(ns, "ObjectRequestId"); + StringShape id2Shape = StringShape.builder().id(id2ShapeId).build(); + StringShape reqIdShape = StringShape.builder().id(reqIdShapeId).build(); + + StructureShape.Builder b = StructureShape.builder().id(output.getId()); + output.getAllTraits().values().forEach(b::addTrait); + output.getAllMembers().values().forEach(m -> + b.addMember(m.getMemberName(), m.getTarget(), + mb -> m.getAllTraits().values().forEach(mb::addTrait))); + b.addMember("Id2", id2ShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-id-2"))); + b.addMember("RequestId", reqIdShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-request-id"))); + + return model.toBuilder().addShapes(id2Shape, reqIdShape, b.build()).build(); } private static Model renameCopyObjectResult(Model model) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index c0875701755..71959c15ae6 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -157,4 +157,24 @@ void doesNotAddExpiresStringToInput() { .map(DocumentationTrait::getValue).orElse("").startsWith("Deprecated:"), "input Expires must not carry the deprecation note"); } + + @Test + void injectsGetObjectId2AndRequestId() { + ServiceShape svc = s3Service("S3"); + StructureShape getObjectOutput = StructureShape.builder().id(NS + "#GetObjectOutput") + .addMember("ETag", ShapeId.from("smithy.api#String")).build(); + Model m = modelWith(svc, getObjectOutput); + Model out = S3Transforms.asTransform().apply(m, svc); + + assertTrue(out.getShape(ShapeId.from(NS + "#ObjectId2")).isPresent()); + assertTrue(out.getShape(ShapeId.from(NS + "#ObjectRequestId")).isPresent()); + StructureShape outShape = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); + MemberShape id2 = outShape.getMember("Id2").orElseThrow(); + assertEquals(NS + "#ObjectId2", id2.getTarget().toString()); + assertEquals("x-amz-id-2", + id2.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue()); + MemberShape reqId = outShape.getMember("RequestId").orElseThrow(); + assertEquals("x-amz-request-id", + reqId.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue()); + } } From a835e8e176e6b26a28b5d718cfade96dd5893d59 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:25:13 -0400 Subject: [PATCH 21/53] Smithy: S3Transforms appends missing BucketLocationConstraint regions --- .../model/transforms/S3Transforms.java | 30 +++++++- .../model/transforms/TransformSupport.java | 68 +++++++++++++++++++ .../model/transforms/S3TransformsTest.java | 43 ++++++++++++ .../transforms/TransformSupportTest.java | 55 +++++++++++++++ 4 files changed, 195 insertions(+), 1 deletion(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index c1236983a56..25e222bb731 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -17,9 +17,11 @@ import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.TimestampShape; import software.amazon.smithy.model.traits.DocumentationTrait; +import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.HttpHeaderTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -49,7 +51,33 @@ private static Model apply(Model model, ServiceShape service) { } // Sub-transforms are chained here by later tasks, e.g.: // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)); + return expandBucketLocationConstraint( + hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service))); + } + + // Confirmed delta at implementation time against the live s3.json BucketLocationConstraint enum; + // the other 18 C2J regions are already present upstream. + private static final List MISSING_REGIONS = List.of("us-east-1", "us-iso-west-1"); + + private static Model expandBucketLocationConstraint(Model model) { + Optional enumShape = model.shapes() + .filter(s -> "BucketLocationConstraint".equals(s.getId().getName())) + .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) + .findFirst(); + if (enumShape.isEmpty()) { + return model; + } + return TransformSupport.appendEnumValues(enumShape.get(), regionNameValueMap()) + .map(updated -> model.toBuilder().addShape(updated).build()) + .orElse(model); + } + + private static Map regionNameValueMap() { + LinkedHashMap map = new LinkedHashMap<>(); + for (String region : MISSING_REGIONS) { + map.put(region.replace('-', '_'), region); + } + return map; } private static Model hackGetObjectResult(Model model) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java index 67e31b6a511..54c585aa68c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -18,8 +18,11 @@ import software.amazon.smithy.model.traits.XmlNameTrait; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; /** * Shared helpers for per-service model transforms. @@ -84,6 +87,71 @@ static Optional appendValues(Shape enumShape, List values) { .build()); } + /** + * Appends {@code name -> value} enum entries, allowing wire values that are not + * identifier-safe (e.g. region strings containing {@code '-'} such as {@code us-east-1}). This is + * the name/value counterpart of {@link #appendValues(Shape, List)}, which requires the wire value + * to double as the member name. + * + *

Each map key is the Smithy member name and MUST be identifier-safe (matching + * {@code [A-Za-z_][A-Za-z0-9_]*}); each map value is the wire value and may be arbitrary. For a + * Smithy 2.0 {@code EnumShape} the name becomes the member name and the value the + * {@code @enumValue} via {@code builder.addMember(name, value)}; for a legacy {@code @enum} + * {@code StringShape} only the wire value is recorded (matching C2J, which keys the enum off the + * wire value and derives the constant name by sanitizing it). + * + *

Idempotent: entries whose wire value already exists are skipped; if every value is already + * present the shape is returned unchanged as {@link Optional#empty()}. + * + * @param enumShape the enum shape to append to + * @param nameToValue ordered member-name to wire-value entries to append + * @return the updated shape, or {@link Optional#empty()} if all values are already present + * @throws IllegalArgumentException if any member name is not identifier-safe + */ + static Optional appendEnumValues(Shape enumShape, Map nameToValue) { + for (String name : nameToValue.keySet()) { + if (name == null || !name.matches(IDENTIFIER_PATTERN)) { + throw new IllegalArgumentException( + "Enum member name \"" + name + "\" for shape " + enumShape.getId() + + " is not an identifier-safe enum member name (must match " + + IDENTIFIER_PATTERN + ")"); + } + } + List existing = existingWireValues(enumShape); + LinkedHashMap toAdd = new LinkedHashMap<>(); + nameToValue.forEach((name, value) -> { + if (!existing.contains(value)) { + toAdd.put(name, value); + } + }); + if (toAdd.isEmpty()) { + return Optional.empty(); + } + if (enumShape.isEnumShape()) { + EnumShape.Builder builder = enumShape.asEnumShape().get().toBuilder(); + toAdd.forEach(builder::addMember); + return Optional.of(builder.build()); + } + EnumTrait existingTrait = enumShape.expectTrait(EnumTrait.class); + EnumTrait.Builder traitBuilder = EnumTrait.builder(); + existingTrait.getValues().forEach(traitBuilder::addEnum); + toAdd.values().forEach(value -> + traitBuilder.addEnum(EnumDefinition.builder().value(value).build())); + return Optional.of(enumShape.asStringShape().get().toBuilder() + .addTrait(traitBuilder.build()) + .build()); + } + + /** The current wire values of an enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code @enum}). */ + private static List existingWireValues(Shape enumShape) { + if (enumShape.isEnumShape()) { + return new ArrayList<>(enumShape.asEnumShape().get().getEnumValues().values()); + } + return enumShape.expectTrait(EnumTrait.class).getValues().stream() + .map(EnumDefinition::getValue) + .collect(Collectors.toList()); + } + /** * Returns a copy of {@code struct} with member {@code oldName} renamed to {@code newName}, * preserving member declaration order and copying all traits onto the renamed member. Returns diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 71959c15ae6..a12bf8a7880 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -158,6 +158,49 @@ void doesNotAddExpiresStringToInput() { "input Expires must not carry the deprecation note"); } + @Test + void appendsMissingBucketLocationConstraintRegions() { + ServiceShape svc = s3Service("S3"); + // Model BucketLocationConstraint as an EnumShape with an existing region. + software.amazon.smithy.model.shapes.EnumShape enumShape = + software.amazon.smithy.model.shapes.EnumShape.builder() + .id(NS + "#BucketLocationConstraint") + .addMember("us_west_2", "us-west-2") + .build(); + Model m = modelWith(svc, enumShape); + Model out = S3Transforms.asTransform().apply(m, svc); + + software.amazon.smithy.model.shapes.EnumShape result = out.expectShape( + ShapeId.from(NS + "#BucketLocationConstraint"), + software.amazon.smithy.model.shapes.EnumShape.class); + // EnumRenderer.getEnumValues() sanitizes '-' to '_', so assert on the raw wire values here. + java.util.Collection wireValues = result.getEnumValues().values(); + assertTrue(wireValues.contains("us-east-1"), "us-east-1 appended"); + assertTrue(wireValues.contains("us-iso-west-1"), "us-iso-west-1 appended"); + assertTrue(wireValues.contains("us-west-2"), "existing value preserved"); + // Member names are identifier-safe, matching the existing model form (hyphens -> underscores). + assertTrue(result.getAllMembers().containsKey("us_east_1"), "identifier-safe member name"); + assertTrue(result.getAllMembers().containsKey("us_iso_west_1"), "identifier-safe member name"); + } + + @Test + void bucketLocationConstraintExpansionIsIdempotent() { + ServiceShape svc = s3Service("S3"); + software.amazon.smithy.model.shapes.EnumShape enumShape = + software.amazon.smithy.model.shapes.EnumShape.builder() + .id(NS + "#BucketLocationConstraint") + .addMember("us_west_2", "us-west-2") + .build(); + Model m = modelWith(svc, enumShape); + Model once = S3Transforms.asTransform().apply(m, svc); + Model twice = S3Transforms.asTransform().apply(once, svc); + software.amazon.smithy.model.shapes.EnumShape result = twice.expectShape( + ShapeId.from(NS + "#BucketLocationConstraint"), + software.amazon.smithy.model.shapes.EnumShape.class); + long usEast1 = result.getEnumValues().values().stream().filter("us-east-1"::equals).count(); + assertEquals(1, usEast1, "re-applying must not duplicate appended values"); + } + @Test void injectsGetObjectId2AndRequestId() { ServiceShape svc = s3Service("S3"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java index e5d23270cb4..f16b7f325c8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java @@ -7,14 +7,21 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import org.junit.jupiter.api.Test; import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; +import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.EnumDefinition; +import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.JsonNameTrait; import software.amazon.smithy.model.traits.XmlNameTrait; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.stream.Collectors; import static org.junit.jupiter.api.Assertions.*; @@ -123,6 +130,54 @@ void renameMember_cborProtocol_throws_noWireNameTrait() { () -> TransformSupport.renameMember(s, "body", "requestBody", Protocol.CBOR)); } + private static LinkedHashMap map(String name, String value) { + LinkedHashMap m = new LinkedHashMap<>(); + m.put(name, value); + return m; + } + + @Test + void appendEnumValues_enumShape_appendsHyphenatedWireValue() { + EnumShape shape = EnumShape.builder().id("com.example#Region") + .addMember("us_west_2", "us-west-2").build(); + Shape out = TransformSupport.appendEnumValues(shape, map("us_east_1", "us-east-1")) + .orElseThrow(); + EnumShape e = out.asEnumShape().orElseThrow(); + assertTrue(e.getEnumValues().values().contains("us-east-1"), "hyphenated value appended"); + assertTrue(e.getEnumValues().values().contains("us-west-2"), "existing value preserved"); + assertTrue(e.getAllMembers().containsKey("us_east_1"), "identifier-safe member name"); + } + + @Test + void appendEnumValues_idempotentSkipsExistingValue() { + EnumShape shape = EnumShape.builder().id("com.example#Region") + .addMember("us_east_1", "us-east-1").build(); + assertTrue(TransformSupport.appendEnumValues(shape, map("us_east_1", "us-east-1")).isEmpty(), + "already-present wire value must be skipped"); + } + + @Test + void appendEnumValues_legacyEnumTrait_appendsValue() { + StringShape shape = StringShape.builder().id("com.example#Region") + .addTrait(EnumTrait.builder() + .addEnum(EnumDefinition.builder().value("us-west-2").build()).build()) + .build(); + Shape out = TransformSupport.appendEnumValues(shape, map("us_east_1", "us-east-1")) + .orElseThrow(); + List values = out.expectTrait(EnumTrait.class).getValues().stream() + .map(EnumDefinition::getValue).collect(Collectors.toList()); + assertTrue(values.contains("us-west-2"), "existing value preserved"); + assertTrue(values.contains("us-east-1"), "hyphenated value appended"); + } + + @Test + void appendEnumValues_nonIdentifierMemberName_throws() { + EnumShape shape = EnumShape.builder().id("com.example#Region") + .addMember("us_west_2", "us-west-2").build(); + assertThrows(IllegalArgumentException.class, + () -> TransformSupport.appendEnumValues(shape, map("us-east-1", "us-east-1"))); + } + @Test void renameMember_existingJsonName_isNotOverridden() { StructureShape s = StructureShape.builder().id("com.example#Req") From d78656fb056c63d029ff7822992839d945c67e88 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:30:54 -0400 Subject: [PATCH 22/53] Smithy: S3Transforms normalizes ReplicationStatus COMPLETE to COMPLETED --- .../model/transforms/S3Transforms.java | 40 +++++++++++++++++-- .../model/transforms/S3TransformsTest.java | 21 ++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 25e222bb731..babe2985262 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -5,9 +5,11 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -49,10 +51,40 @@ private static Model apply(Model model, ServiceShape service) { if (!"s3".equals(name) && !"s3-crt".equals(name)) { return model; } - // Sub-transforms are chained here by later tasks, e.g.: - // return normalizeReplicationStatus(expandBucketLocationConstraint(... (model) ...)); - return expandBucketLocationConstraint( - hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service))); + return normalizeReplicationStatus(expandBucketLocationConstraint( + hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)))); + } + + // C2J collapses the model's split COMPLETE/COMPLETED ReplicationStatus values into a single + // COMPLETED constant. Drop the extra COMPLETED and rewrite COMPLETE to COMPLETED, preserving + // the remaining member order. Both remove and rewrite means we rebuild the enum explicitly. + private static Model normalizeReplicationStatus(Model model) { + Optional shapeOpt = model.shapes() + .filter(s -> s.getId().getMember().isEmpty()) + .filter(s -> "ReplicationStatus".equals(s.getId().getName())) + .findFirst(); + if (shapeOpt.isEmpty()) { + return model; // shape absent: nothing to normalize. + } + Shape found = shapeOpt.get(); + if (!found.isEnumShape()) { + throw new IllegalStateException("S3: expected 'ReplicationStatus' to be an EnumShape but " + + "found " + found.getType() + "; legacy @enum handling is unimplemented."); + } + EnumShape shape = found.asEnumShape().get(); + List values = EnumRenderer.getEnumValues(shape); + if (!values.contains("COMPLETE")) { + return model; // upstream already normalized. + } + EnumShape.Builder b = EnumShape.builder().id(shape.getId()); + shape.getAllTraits().values().forEach(b::addTrait); + for (String v : values) { + if (!"COMPLETED".equals(v)) { + String value = "COMPLETE".equals(v) ? "COMPLETED" : v; + b.addMember(value, value); + } + } + return model.toBuilder().addShape(b.build()).build(); } // Confirmed delta at implementation time against the live s3.json BucketLocationConstraint enum; diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index a12bf8a7880..677d6181b13 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -201,6 +201,27 @@ void bucketLocationConstraintExpansionIsIdempotent() { assertEquals(1, usEast1, "re-applying must not duplicate appended values"); } + @Test + void normalizesReplicationStatusCompleteToCompleted() { + ServiceShape svc = s3Service("S3"); + software.amazon.smithy.model.shapes.EnumShape enumShape = + software.amazon.smithy.model.shapes.EnumShape.builder() + .id(NS + "#ReplicationStatus") + .addMember("COMPLETE", "COMPLETE") + .addMember("PENDING", "PENDING") + .addMember("FAILED", "FAILED") + .addMember("REPLICA", "REPLICA") + .addMember("COMPLETED", "COMPLETED") + .build(); + Model m = modelWith(svc, enumShape); + Model out = S3Transforms.asTransform().apply(m, svc); + + java.util.List values = com.amazonaws.util.awsclientsmithygenerator.generators.model + .EnumRenderer.getEnumValues(out.expectShape(ShapeId.from(NS + "#ReplicationStatus"))); + assertEquals(java.util.List.of("COMPLETED", "PENDING", "FAILED", "REPLICA"), values, + "COMPLETE rewritten to COMPLETED, duplicate removed, order preserved"); + } + @Test void injectsGetObjectId2AndRequestId() { ServiceShape svc = s3Service("S3"); From 6bb76ee21b73b8451d61a249657e449333b157c8 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 11:40:12 -0400 Subject: [PATCH 23/53] Smithy: record S3 serde-phased customizations as deferred parity deltas --- docs/superpowers/plans/parity-deltas.md | 88 +++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 docs/superpowers/plans/parity-deltas.md diff --git a/docs/superpowers/plans/parity-deltas.md b/docs/superpowers/plans/parity-deltas.md new file mode 100644 index 00000000000..a7ba6d78859 --- /dev/null +++ b/docs/superpowers/plans/parity-deltas.md @@ -0,0 +1,88 @@ +# Smithy Per-Service Model Parity — Documented Deltas + +Reviewed, accepted differences between Smithy-generated and C2J-generated `model::` +files. Anything not listed here must be resolved (empty diff) before a transform is "done". + +## Global-baseline deltas (not service-specific) +- **Stubbed payload serde (global):** Smithy emits empty serde bodies (e.g. `SerializePayload() const { return {}; }`, `OutputToStream(...) {}`) where C2J emits full serialization. Affects every shape; not service-specific. Pending serde implementation in the model plugin. +- **Doc-comment reflow (global):** Smithy wraps member documentation comments differently from C2J. Cosmetic; affects many members across services. + + +- **Pagination-traits files (global):** Smithy emits `PaginationTraits.h` under model/ that the C2J model tree doesn't; separate pagination plugin output, pre-existing. +- **ResponseMetadata standalone file (query/ec2, global):** C2J emits a standalone `ResponseMetadata.{h,cpp}`; the Smithy plugin injects ResponseMetadata via GlobalTransforms but doesn't emit it as a standalone sub-object file. Pre-existing; unaffected by the dual-role classifier fix. +- **Required-member HasBeenSet handling (FIXED):** The C++ SDK tracks member presence via `HasBeenSet`, not required-ness. In C2J, `CppClientGenerator#generateSourceFiles` unconditionally clears `required` on EVERY modeled member ("so we can do a value has been set check on all fields"), then `addRequestIdToResults` injects `ResponseMetadata` as required — so the injected `ResponseMetadata` is the ONLY member rendered with no `HasBeenSet()` getter + flag `= true` (in a `useRequiredField=true` context: sub-object/request; a pure result uses `useRequiredField=false` so even it inits `= false`). Every modeled member — plain `@required` (JSON) AND `@required @clientOptional` (the 17 query/xml services) — renders a getter + `= false`. The Smithy plugin does NOT mirror C2J's model mutation (that would discard `@required`, which serde/validation will want). Instead `MemberRenderer` keys the always-present treatment on **recognizing the injected `ResponseMetadata`** (member named `ResponseMetadata` whose target is the `ResponseMetadata` structure — exactly how C2J identifies it), gated on `emitHasBeenSet` (the `useRequiredField` proxy: `forStructure`=true, `forResult`=false), excepting event-stream / raw-streaming-payload members. `@required` is left intact on all members. `GlobalTransforms.injectResponseMetadata` fails fast (`IllegalStateException`) if a model already defines a `ResponseMetadata` shape or member, so the name-based recognition stays unambiguous (verified: 0 of 433 models define one). `GlobalTransforms.RESPONSE_METADATA` is the single shared name constant. Verified end-to-end on EC2 (identical to C2J): 747 results init `= false`, 4 dual-role sub-objects (`Reservation`/`Snapshot`/`Volume`/`VolumeAttachment`) init `= true`; `VolumeDetail.Size` (`@required @clientOptional`) → getter + `= false`. NOTE: keying on `@clientOptional` would be WRONG — absent from the 380 JSON services whose plain `@required` members C2J also treats as optional (e.g. DynamoDB `GetItemRequest.TableName`). +- **Enum Windows-macro #undef guard (FIXED):** C2J's `ModelEnumHeader.vm` wraps enum values that collide with a Windows preprocessor macro in `#if defined(_WIN32) && defined(X) / #undef X / #endif`, driven by `PlatformAndKeywordSanitizer.PREDEFINED_SYMBOLS_MAPPING` (namespace-keyed: `EC2→interface`, `DynamoDB→IN`, `S3Crt→IGNORE`). The Smithy `EnumRenderer.renderHeader` now emits the same guard (before the namespace block) via `predefinedWindowsSymbols(serviceNamespace, values)`, mirroring that mapping. Fixes e.g. `NetworkInterfaceType.h` (`interface` value). Per-service/namespace keyed; other services with the same value do not emit it. +- **ShapeClassifier dual-role fix (FIXED):** structures that are both an operation output AND a member target (e.g. lambda FunctionConfiguration/AliasConfiguration/EventSourceMappingConfiguration/Concurrency/FunctionEventInvokeConfig) are now emitted as sub-objects too, matching C2J. Verified: lambda Only-in-C2J model files 10 -> 0; no spurious over-emission; sqs unchanged. +- **Deprecated-orphan dead files (global, ACCEPTED):** When a shape is reachable ONLY through `@deprecated` member(s), C2J still emits a model file for it, while the Smithy plugin omits it. Root cause is a C2J bug: `C2jModelToGeneratorModelTransformer.removeUnreferencedShapes()` is a single, non-transitive pass over `referencedBy`, so it removes only the first-order orphan (usually the intermediate list/map, which emits no file) and still emits the struct/enum that list pointed at as a dead, unreferenced file. The Smithy plugin's `computeReachableShapes` walks only surviving edges and correctly omits the whole orphan subtree. **Proven safe:** across all 433 services this drops files in 17 (e.g. ec2: AssociatedTargetNetwork/AssociatedNetworkType/ElasticGpuSpecification/ElasticInferenceAccelerator/LaunchTemplateElasticInferenceAccelerator; guardduty: 32) with **0 dangling references** — a shape shared with any non-deprecated reference is always kept (verified by `GlobalTransformsTest.dropDeprecatedMembers_sharedTargetSurvivesViaNonDeprecatedReference`). Smithy output is strictly cleaner; accepted rather than replicating C2J's dead files. + +## rds +- SourceRegion member injected by SourceRegionTransform is present and structurally identical to C2J at the member/accessor level (verified Task 2). Remaining rds diffs are the two global deltas above. + +## docdb +_(none yet)_ + +## neptune +_(none yet)_ + +## lambda +_(none yet)_ + +## sqs +_(none yet)_ + +## apigateway +_(none yet)_ + +## apigatewayv2 +_(none yet)_ + +## ec2 +- Result naming: operation-output result classes use `Response` via ResultRenderer+ShapeUtil.getResultSuffix; nested `*Result` domain structs renamed to `*Response` by Ec2Transforms. Verified 0 Result/Response file mismatches vs C2J. +- SpotInstanceState `disabled` value present (parity). +- SecureBlobAttributeValue (FIXED via Ec2Transforms): upstream `aws/aws-models` itself diverges — the C2J `ec2//service-2.json` models `ModifyInstanceAttributeRequest.UserData -> SecureBlobAttributeValue -> SecureBlob(@sensitive)`, but the upstream Smithy `ec2/smithy/model.json` still targets the non-sensitive `BlobAttributeValue` (verified against upstream on master). Re-syncing the Smithy model would NOT fix it (upstream Smithy lacks the shape). `Ec2Transforms.addSecureBlobUserData` mirrors the C2J modeling in the Smithy model at generation time: adds `SecureBlob`(@sensitive -> CryptoBuffer) + `SecureBlobAttributeValue{Value}` and repoints `UserData`, which orphans `BlobAttributeValue` so it drops from the emitted set exactly as in C2J. Self-retires (no-op) once the upstream Smithy model catches up. Temporary compensation for upstream data lag; the durable fix is an upstream aws-models correction. Note: the generated `SecureBlobAttributeValue.{h,cpp}` still differs from C2J only in the stubbed-serde bodies (global delta above). +- Deprecated-orphan dead files: 5 shapes / 10 files (AssociatedTargetNetwork, AssociatedNetworkType, ElasticGpuSpecification, ElasticInferenceAccelerator, LaunchTemplateElasticInferenceAccelerator) — see global "Deprecated-orphan dead files" delta above. +- OUT OF SCOPE (remain C2J, documented): ~180 legacy error-code injection, CopySnapshot presign, custom endpoint-enum template. These are client/error/endpoint artifacts, not model-shape. +- Remaining diffs are the two global deltas (stubbed serde, doc reflow). + +## S3 serde-phased customizations (deferred until Smithy serde lands) +- `markChecksumMembers` (S3 `CHECKSUM_MEMBERS_ENUMS`): checksum members drive request serialization + only; no model-header delta today. Implement as an `S3Transforms` marker step when serde is + un-stubbed. Map (member → algorithm value): ChecksumCRC32→CRC32, ChecksumCRC32C→CRC32C, + ChecksumSHA1→SHA1, ChecksumSHA256→SHA256, ChecksumSHA512→SHA512, ChecksumXXHASH64→XXHASH64, + ChecksumXXHASH3→XXHASH3, ChecksumXXHASH128→XXHASH128, ChecksumMD5→MD5. (ChecksumCRC64NVME NOT mapped.) +- `injectAccessLogTagQuery` (S3 `customizedAccessLogTag` querystring map on every request): serde + (`AddQueryStringParameters`) only; no model-header delta today. Implement with serde. + +### Task 7 investigation note (evidence correction — decision: DEFER both) +The two "serde only" labels above are imprecise: **both customizations DO produce an observable +model-HEADER delta today** in C2J vs the current `--use-smithy-models` output. They are still +deferred because **neither is closeable by a standalone `S3Transforms` marker/injection transform +without renderer or serde work** (the Task 3–6 pattern does not apply cleanly). Evidence: + +- **Checksum (header delta, needs MemberRenderer support):** `markChecksumMembers` sets + `ShapeMember.checksumMember/checksumEnumMember`, which C2J's *header* template + `ModelClassMembersAndInlines.vm` (lines 56–59, 100–101) consumes to emit a setter side-effect — + e.g. `SetChecksumCRC32(...)` also calls `SetChecksumAlgorithm(ChecksumAlgorithm::CRC32);` (and a + `const char*` overload). Confirmed present in C2J `generated/.../PutObjectRequest.h` + (`SetChecksumCRC32/CRC32C/SHA1/SHA256/SHA512/MD5/XXHASH64/XXHASH3/XXHASH128`), and correctly ABSENT + on the unmapped `ChecksumCRC64NVME`. The Smithy `MemberRenderer` setter bodies emit only + `HasBeenSet = true; ...` and never `SetChecksumAlgorithm(...)`; `RequestRenderer.renderChecksumImpls` + only handles the separate `@httpChecksum` trait impls (`GetChecksumAlgorithmName`, `ChecksumAlgorithmIsSet`, + etc. — the `ModelClassChecksumMembers.vm` concern), not the value-member setter side-effect. So a + *marker* transform alone is inert: closing this delta requires `MemberRenderer` to grow bespoke + logic that reads the marker. Deferred to the render/serde phase. + +- **Access-log tag (header delta, but query-binding/serde-entangled):** `injectAccessLogTagQuery` + (S3RestXmlCppClientGenerator.java ~299–340) injects a real `customizedAccessLogTag` + `map` member (`location=querystring`, `customizedQuery=true`) into EVERY request + input. C2J's header template renders full accessors — confirmed in C2J + `generated/.../PutObjectRequest.h` and others (`GetCustomizedAccessLogTag`, + `SetCustomizedAccessLogTag`, `WithCustomizedAccessLogTag`, `AddCustomizedAccessLogTag`, + `m_customizedAccessLogTag`, `m_customizedAccessLogTagHasBeenSet`). The Smithy S3 model + (`smithy/api-descriptions/s3.json`) has ZERO occurrences and no Smithy transform injects it, so the + member is absent from the Smithy header. An injection transform *could* render the accessors, but a + bare injection is incorrect: the member is a querystring/`customizedQuery` member whose only purpose + is serialization via `AddQueryStringParametersToRequest.vm` (the `$shape.customizedQuery` loop). + For restXml, an unbound injected member would be misclassified as a payload member; a correct + injection must carry the query-param binding (`@httpQueryParams`), which is a serde concern that is + currently stubbed. Deferred: implement alongside the querystring serde. From a28c2f3b4cf54e7ed946d657f3c9efc41bc6f393 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 13:23:23 -0400 Subject: [PATCH 24/53] Smithy: S3Transforms injects customizedAccessLogTag request member --- docs/superpowers/plans/parity-deltas.md | 49 ++++++++------ .../model/transforms/S3Transforms.java | 39 ++++++++++- .../model/transforms/S3TransformsTest.java | 67 +++++++++++++++++++ 3 files changed, 134 insertions(+), 21 deletions(-) diff --git a/docs/superpowers/plans/parity-deltas.md b/docs/superpowers/plans/parity-deltas.md index a7ba6d78859..f6aa6813a8a 100644 --- a/docs/superpowers/plans/parity-deltas.md +++ b/docs/superpowers/plans/parity-deltas.md @@ -50,14 +50,23 @@ _(none yet)_ un-stubbed. Map (member → algorithm value): ChecksumCRC32→CRC32, ChecksumCRC32C→CRC32C, ChecksumSHA1→SHA1, ChecksumSHA256→SHA256, ChecksumSHA512→SHA512, ChecksumXXHASH64→XXHASH64, ChecksumXXHASH3→XXHASH3, ChecksumXXHASH128→XXHASH128, ChecksumMD5→MD5. (ChecksumCRC64NVME NOT mapped.) -- `injectAccessLogTagQuery` (S3 `customizedAccessLogTag` querystring map on every request): serde - (`AddQueryStringParameters`) only; no model-header delta today. Implement with serde. - -### Task 7 investigation note (evidence correction — decision: DEFER both) +- `injectAccessLogTagQuery` (S3 `customizedAccessLogTag` querystring map on every request): + **IMPLEMENTED** (Task 7) — `S3Transforms.injectAccessLogTagQuery` injects a `customizedAccessLogTag` + `map` member (targeting `com.amazonaws.s3#CustomizedAccessLogTag`, key+value + `smithy.api#String`) onto every operation request shape, appended last, idempotent. This closes the + `.h` member-accessor delta (`GetCustomizedAccessLogTag` / `SetCustomizedAccessLogTag` / + `WithCustomizedAccessLogTag` / `AddCustomizedAccessLogTag` / `m_customizedAccessLogTag`). The + querystring binding (`location=querystring`, `customizedQuery=true` → `AddQueryStringParameters` + serde) is still DEFERRED until Smithy serde lands; no `@httpQuery`/`@httpQueryParams` trait is + attached yet, to avoid perturbing stubbed request emission. + +### Task 7 investigation note (evidence correction — access-log IMPLEMENTED, checksum DEFERRED) The two "serde only" labels above are imprecise: **both customizations DO produce an observable -model-HEADER delta today** in C2J vs the current `--use-smithy-models` output. They are still -deferred because **neither is closeable by a standalone `S3Transforms` marker/injection transform -without renderer or serde work** (the Task 3–6 pattern does not apply cleanly). Evidence: +model-HEADER delta today** in C2J vs the current `--use-smithy-models` output. Per a later controller +decision, the **access-log tag member injection is now IMPLEMENTED** (the `.h` accessors are a pure +model-shape delta, closeable by a standalone `S3Transforms` injection; only its querystring serde +binding is deferred). **Checksum stays DEFERRED** — it is not closeable by a marker transform without +renderer work. Evidence: - **Checksum (header delta, needs MemberRenderer support):** `markChecksumMembers` sets `ShapeMember.checksumMember/checksumEnumMember`, which C2J's *header* template @@ -72,17 +81,19 @@ without renderer or serde work** (the Task 3–6 pattern does not apply cleanly) *marker* transform alone is inert: closing this delta requires `MemberRenderer` to grow bespoke logic that reads the marker. Deferred to the render/serde phase. -- **Access-log tag (header delta, but query-binding/serde-entangled):** `injectAccessLogTagQuery` - (S3RestXmlCppClientGenerator.java ~299–340) injects a real `customizedAccessLogTag` - `map` member (`location=querystring`, `customizedQuery=true`) into EVERY request - input. C2J's header template renders full accessors — confirmed in C2J - `generated/.../PutObjectRequest.h` and others (`GetCustomizedAccessLogTag`, +- **Access-log tag (header delta — IMPLEMENTED; query-binding serde deferred):** + `injectAccessLogTagQuery` (S3RestXmlCppClientGenerator.java ~299–340) injects a real + `customizedAccessLogTag` `map` member (`location=querystring`, + `customizedQuery=true`) into EVERY request input. C2J's header template renders full accessors — + confirmed in C2J `generated/.../PutObjectRequest.h` and others (`GetCustomizedAccessLogTag`, `SetCustomizedAccessLogTag`, `WithCustomizedAccessLogTag`, `AddCustomizedAccessLogTag`, `m_customizedAccessLogTag`, `m_customizedAccessLogTagHasBeenSet`). The Smithy S3 model - (`smithy/api-descriptions/s3.json`) has ZERO occurrences and no Smithy transform injects it, so the - member is absent from the Smithy header. An injection transform *could* render the accessors, but a - bare injection is incorrect: the member is a querystring/`customizedQuery` member whose only purpose - is serialization via `AddQueryStringParametersToRequest.vm` (the `$shape.customizedQuery` loop). - For restXml, an unbound injected member would be misclassified as a payload member; a correct - injection must carry the query-param binding (`@httpQueryParams`), which is a serde concern that is - currently stubbed. Deferred: implement alongside the querystring serde. + (`smithy/api-descriptions/s3.json`) has ZERO occurrences. `S3Transforms.injectAccessLogTagQuery` + now mirrors the C2J injection at the model-shape level: it appends the `customizedAccessLogTag` + `map` member to every request input (idempotent), closing the `.h` accessor delta. + The query-string binding is intentionally NOT modeled yet: no `@httpQuery`/`@httpQueryParams` trait + is attached, because that would engage the (stubbed) serde/render path and risk perturbing request + emission. For restXml an unbound member would be misclassified as a payload member during serde; + the correct query-param binding (`customizedQuery` loop in `AddQueryStringParametersToRequest.vm`) + lands with the querystring serde work. Byte-parity of the querystring serialization is a Task 9 + follow-up once Smithy serde is un-stubbed. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index babe2985262..e369742e0fc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -10,6 +10,7 @@ import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.EnumShape; +import software.amazon.smithy.model.shapes.MapShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -51,8 +52,42 @@ private static Model apply(Model model, ServiceShape service) { if (!"s3".equals(name) && !"s3-crt".equals(name)) { return model; } - return normalizeReplicationStatus(expandBucketLocationConstraint( - hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)))); + return injectAccessLogTagQuery(normalizeReplicationStatus(expandBucketLocationConstraint( + hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)))), service); + } + + // C2J's S3RestXmlCppClientGenerator appends a `customizedAccessLogTag` map member + // to every operation request shape. It renders as an ordinary map member in the .h; the query- + // string binding (location=querystring, customizedQuery=true) is a serde concern deferred until + // Smithy serde lands, so no @httpQuery/@httpQueryParams trait is attached here. + private static Model injectAccessLogTagQuery(Model model, ServiceShape service) { + ShapeId mapId = ShapeId.fromParts("com.amazonaws.s3", "CustomizedAccessLogTag"); + ShapeId stringId = ShapeId.from("smithy.api#String"); + + Set inputShapes = TopDownIndex.of(model).getContainedOperations(service).stream() + .map(OperationShape::getInputShape) + .collect(Collectors.toSet()); + List updated = model.shapes(StructureShape.class) + .filter(s -> inputShapes.contains(s.getId())) + .filter(s -> s.getMember("customizedAccessLogTag").isEmpty()) + .toList(); + if (updated.isEmpty()) { + return model; // no request shape needs the member (idempotent / no operations). + } + + List replacements = new ArrayList<>(); + if (model.getShape(mapId).isEmpty()) { + replacements.add(MapShape.builder().id(mapId).key(stringId).value(stringId).build()); + } + for (StructureShape req : updated) { + replacements.add(req.toBuilder() + .addMember(MemberShape.builder() + .id(req.getId().withMember("customizedAccessLogTag")) + .target(mapId) + .build()) + .build()); + } + return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } // C2J collapses the model's split COMPLETE/COMPLETED ReplicationStatus values into a single diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 677d6181b13..399e4c3560d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -241,4 +241,71 @@ void injectsGetObjectId2AndRequestId() { assertEquals("x-amz-request-id", reqId.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue()); } + + /** + * Builds an S3 model with a single operation whose input carries two ordinary members, so the + * appended-last ordering of the injected access-log tag member can be asserted. + */ + private static Model accessLogModel() { + StructureShape input = StructureShape.builder().id(NS + "#PutObjectRequest") + .addMember("Bucket", ShapeId.from("smithy.api#String")) + .addMember("Key", ShapeId.from("smithy.api#String")) + .build(); + StructureShape output = StructureShape.builder().id(NS + "#PutObjectOutput") + .addMember("ETag", ShapeId.from("smithy.api#String")) + .build(); + OperationShape op = OperationShape.builder().id(NS + "#PutObject") + .input(input.getId()).output(output.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId("S3").arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(input, output, op, svc).assemble().unwrap(); + } + + private static ServiceShape s3ServiceOf(Model m) { + return m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); + } + + @Test + void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { + Model m = accessLogModel(); + Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + + StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + MemberShape tag = input.getMember("customizedAccessLogTag").orElseThrow(); + + // Target must be a Map (both key and value render as Aws::String). + software.amazon.smithy.model.shapes.MapShape mapShape = out.expectShape( + tag.getTarget(), software.amazon.smithy.model.shapes.MapShape.class); + assertEquals("smithy.api#String", mapShape.getKey().getTarget().toString()); + assertEquals("smithy.api#String", mapShape.getValue().getTarget().toString()); + + // Appended after all existing members, preserving prior order. + java.util.List order = new java.util.ArrayList<>(input.getAllMembers().keySet()); + assertEquals(java.util.List.of("Bucket", "Key", "customizedAccessLogTag"), order, + "access-log tag member appended last"); + } + + @Test + void doesNotInjectCustomizedAccessLogTagIntoOutput() { + Model m = accessLogModel(); + Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + + StructureShape output = out.expectShape(ShapeId.from(NS + "#PutObjectOutput"), StructureShape.class); + assertFalse(output.getMember("customizedAccessLogTag").isPresent(), + "output shape must not gain the access-log tag member"); + } + + @Test + void accessLogTagInjectionIsIdempotent() { + Model m = accessLogModel(); + Model once = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + Model twice = S3Transforms.asTransform().apply(once, s3ServiceOf(once)); + + StructureShape input = twice.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + long count = input.getAllMembers().keySet().stream() + .filter("customizedAccessLogTag"::equals).count(); + assertEquals(1, count, "re-applying must not duplicate the injected member"); + } } From e198be955012836bfcb3caaec0de609859b84a81 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 13:35:13 -0400 Subject: [PATCH 25/53] Smithy: S3ControlTransforms adds top-level HostId to result classes --- .../generators/model/MemberRenderer.java | 26 ++++++++ .../generators/model/ModelCodegenPlugin.java | 5 +- .../model/renderers/ResultRenderer.java | 30 +++++++++ .../model/transforms/S3ControlTransforms.java | 55 +++++++++++++++++ .../model/transforms/TopLevelHostIdTrait.java | 25 ++++++++ .../generators/model/ResultRendererTest.java | 61 +++++++++++++++++++ .../transforms/S3ControlTransformsTest.java | 48 +++++++++++++++ 7 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java index 6894d604f18..fb130f6ae65 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java @@ -295,6 +295,32 @@ public static void renderRequestIdAccessors(CppWriter writer, String className, writer.write("///@}"); } + /** + * Renders the top-level {@code HostId} (x-amz-id-2) accessor group emitted by S3 Control result + * headers immediately after the {@code RequestId} group: {@code GetHostId} / templated + * {@code SetHostId} / templated {@code WithHostId}. Callers gate emission on + * {@code TopLevelHostIdTrait} and separately emit the {@code m_hostId} field and its + * {@code HasBeenSet} flag in the private section. Matches C2J's {@code addToAllResultsShape} + * HostId member, including the doc string. + */ + public static void renderHostIdAccessors(CppWriter writer, String className) { + writer.write(""); + writer.write("///@{"); + writeDocComment(writer, "x-amz-id-2 header value, also known as Host Id"); + writer.write("inline const Aws::String& GetHostId() const { return m_hostId; }"); + writer.write("template "); + writer.openBlock("void SetHostId(HostIdT&& value) {", "}", () -> { + writer.write("m_hostIdHasBeenSet = true;"); + writer.write("m_hostId = std::forward(value);"); + }); + writer.write("template "); + writer.openBlock("$L& WithHostId(HostIdT&& value) {", "}", className, () -> { + writer.write("SetHostId(std::forward(value));"); + writer.write("return *this;"); + }); + writer.write("///@}"); + } + /** * Writes a single private data member declaration. {@code @idempotencyToken} members are * brace-initialized with {@code Aws::Utils::UUID::PseudoRandomUUID()} so a caller who omits diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index b38e4425aa6..5fe596ffbec 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -13,6 +13,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3ControlTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SqsTransforms; @@ -60,8 +61,8 @@ public void execute(PluginContext context) { Ec2Transforms.asTransform(), AccessAnalyzerTransforms.asTransform(), DynamoDbTransforms.asTransform(), - S3Transforms.asTransform() - // Future: S3ControlTransforms.asTransform(), etc. + S3Transforms.asTransform(), + S3ControlTransforms.asTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java index 438c2244e3e..af8b44a3006 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java @@ -13,6 +13,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.ResultInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.TopLevelHostIdTrait; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.StructureShape; @@ -114,6 +115,13 @@ private void renderHeader(CppWriterDelegator writerDelegator, MemberRenderer.renderRequestIdAccessors(writer, className); } + // The top-level HostId (x-amz-id-2) group is per-service (S3 Control only), driven + // by the internal marker rather than a protocol flag, and always follows RequestId. + boolean topLevelHostId = shape.hasTrait(TopLevelHostIdTrait.class); + if (topLevelHostId) { + MemberRenderer.renderHostIdAccessors(writer, className); + } + writer.write("inline Aws::Http::HttpResponseCode GetHttpResponseCode() const { return m_HttpResponseCode; }"); writer.write(""); @@ -127,11 +135,19 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.write(""); writer.write("Aws::String m_requestId;"); } + if (topLevelHostId) { + // C2J declares m_hostId in its own group right after m_requestId. + writer.write(""); + writer.write("Aws::String m_hostId;"); + } writer.write("Aws::Http::HttpResponseCode m_HttpResponseCode;"); members.renderHasBeenSetFlags(writer); if (topLevelRequestId) { writer.write("bool m_requestIdHasBeenSet = false;"); } + if (topLevelHostId) { + writer.write("bool m_hostIdHasBeenSet = false;"); + } }); writer.write(""); }); @@ -232,6 +248,13 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, MemberRenderer.renderRequestIdAccessors(writer, className); + // S3 Control has no streaming results today; the marker is only stamped on its + // outputs, so this block is a defensive no-op for every current streaming result. + boolean topLevelHostId = shape.hasTrait(TopLevelHostIdTrait.class); + if (topLevelHostId) { + MemberRenderer.renderHostIdAccessors(writer, className); + } + writer.write("inline Aws::Http::HttpResponseCode GetHttpResponseCode() const { return m_HttpResponseCode; }"); writer.write(""); @@ -242,10 +265,17 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, members.renderDataMembers(writer); writer.write(""); writer.write("Aws::String m_requestId;"); + if (topLevelHostId) { + writer.write(""); + writer.write("Aws::String m_hostId;"); + } writer.write("Aws::Http::HttpResponseCode m_HttpResponseCode;"); writer.write("bool $LHasBeenSet = false;", streamField); members.renderHasBeenSetFlags(writer); writer.write("bool m_requestIdHasBeenSet = false;"); + if (topLevelHostId) { + writer.write("bool m_hostIdHasBeenSet = false;"); + } }); writer.write(""); }); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java new file mode 100644 index 00000000000..38c61eba96f --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java @@ -0,0 +1,55 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; + +import java.util.ArrayList; +import java.util.List; + +/** + * S3 Control model parity with the legacy C2J {@code S3ControlRestXmlCppClientGenerator}, whose + * {@code addRequestIdToResults} adds BOTH a top-level {@code RequestId} and a top-level + * {@code HostId} (x-amz-id-2) to every result. RequestId is already emitted generically + * ({@code ProtocolTraits.resultHasTopLevelRequestId()}); this transform closes the HostId gap by + * marking each operation-output structure with {@link TopLevelHostIdTrait}, which + * {@code ResultRenderer} turns into the top-level HostId accessor group. Self-guards on the raw + * smithy service name {@code s3-control} ({@code ServiceNameUtil.getSmithyServiceName} lowercases + * the {@code S3 Control} sdkId and replaces the space with a hyphen; the {@code s3-control -> + * s3control} c2jMap remap is applied later by the plugin, not here). + */ +public final class S3ControlTransforms { + + private S3ControlTransforms() {} + + public static ModelTransform asTransform() { + return S3ControlTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"s3-control".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + TopDownIndex index = TopDownIndex.of(model); + List marked = new ArrayList<>(); + for (OperationShape op : index.getContainedOperations(service)) { + model.getShape(op.getOutputShape()).flatMap(Shape::asStructureShape).ifPresent(out -> { + if (!out.hasTrait(TopLevelHostIdTrait.class)) { + marked.add(out.toBuilder().addTrait(new TopLevelHostIdTrait()).build()); + } + }); + } + if (marked.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java new file mode 100644 index 00000000000..70f0eab371c --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java @@ -0,0 +1,25 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link S3ControlTransforms} on each + * S3 Control operation-output structure. {@code ResultRenderer} emits the top-level {@code HostId} + * (x-amz-id-2) accessor group for marker-bearing result shapes — mirroring how the sibling + * top-level {@code RequestId} is emitted — so S3 Control results match C2J + * ({@code addToAllResultsShape("hostId", ...)}). Kept as a marker + generic renderer rule (not a + * service-name {@code if}) so the renderer stays service-agnostic. + */ +public final class TopLevelHostIdTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#topLevelHostId"); + + public TopLevelHostIdTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java index cbbe716190b..7f01064501c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java @@ -304,4 +304,65 @@ void statusCodeMember_setFromResponseCode() { String cpp = renderResultSource(statusCodeResultModel(), "StatResult.cpp"); assertTrue(cpp.contains("m_status = static_cast(result.GetResponseCode());"), cpp); } + + /** + * A one-member rest-xml output operation whose output structure optionally carries the internal + * {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.TopLevelHostIdTrait} + * marker (as {@code S3ControlTransforms} stamps it). + */ + private static Model hostIdResultModel(boolean marked) { + StringShape str = StringShape.builder().id("com.example#Str").build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoThingInput").addMember("name", str.getId()).build(); + StructureShape.Builder outputBuilder = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("field", str.getId()); + if (marked) { + outputBuilder.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators + .model.transforms.TopLevelHostIdTrait()); + } + StructureShape output = outputBuilder.build(); + OperationShape op = OperationShape.builder() + .id("com.example#DoThing").input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(software.amazon.smithy.aws.traits.protocols.RestXmlTrait.builder().build()) + .addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void hostIdTrait_rendersHostIdGroupAfterRequestId() { + String h = renderResultSource(hostIdResultModel(true), "DoThingResult.h"); + assertTrue(h.contains("inline const Aws::String& GetHostId() const { return m_hostId; }"), h); + assertTrue(h.contains("x-amz-id-2 header value, also known as Host Id"), h); + assertTrue(h.contains("Aws::String m_hostId;"), h); + assertTrue(h.contains("bool m_hostIdHasBeenSet = false;"), h); + + // The HostId accessor group renders immediately after the RequestId group. + int reqAccessor = h.indexOf("GetRequestId"); + int hostAccessor = h.indexOf("GetHostId"); + assertTrue(reqAccessor >= 0 && hostAccessor > reqAccessor, + "HostId accessor group must follow the RequestId group: " + h); + + // m_hostId is declared immediately after m_requestId in the private section. + int reqMember = h.indexOf("Aws::String m_requestId;"); + int hostMember = h.indexOf("Aws::String m_hostId;"); + assertTrue(reqMember >= 0 && hostMember > reqMember, + "m_hostId must be declared after m_requestId: " + h); + + int reqFlag = h.indexOf("bool m_requestIdHasBeenSet = false;"); + int hostFlag = h.indexOf("bool m_hostIdHasBeenSet = false;"); + assertTrue(reqFlag >= 0 && hostFlag > reqFlag, + "m_hostIdHasBeenSet must be declared after m_requestIdHasBeenSet: " + h); + } + + @Test + void noHostIdTrait_omitsHostIdGroup() { + String h = renderResultSource(hostIdResultModel(false), "DoThingResult.h"); + // A rest-xml result still gets the sibling top-level RequestId group ... + assertTrue(h.contains("GetRequestId"), h); + // ... but no HostId group without the marker trait. + assertFalse(h.contains("GetHostId"), h); + assertFalse(h.contains("m_hostId"), h); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java new file mode 100644 index 00000000000..b8b2e9f35d1 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java @@ -0,0 +1,48 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.*; + +import static org.junit.jupiter.api.Assertions.*; + +class S3ControlTransformsTest { + static final String NS = "com.amazonaws.s3control"; + + static Model model(String sdkId) { + StructureShape result = StructureShape.builder().id(NS + "#CreateAccessPointResult") + .addMember("AccessPointArn", ShapeId.from("smithy.api#String")).build(); + StructureShape req = StructureShape.builder().id(NS + "#CreateAccessPointRequest").build(); + OperationShape op = OperationShape.builder().id(NS + "#CreateAccessPoint") + .input(req.getId()).output(result.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(NS + "#AWSS3Control").version("2018-08-20") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("s3") + .cloudFormationName("S3Control").cloudTrailEventSource("s3control.amazonaws.com").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(req, result, op, svc).assemble().unwrap(); + } + + static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from(NS + "#AWSS3Control"), ServiceShape.class); + } + + @Test + void marksResultShapesWithHostIdTrait() { + Model m = model("S3 Control"); + Model out = S3ControlTransforms.asTransform().apply(m, service(m)); + assertTrue(out.expectShape(ShapeId.from(NS + "#CreateAccessPointResult")) + .hasTrait(TopLevelHostIdTrait.class), "result shape marked"); + } + + @Test + void noOpForOtherService() { + Model m = model("SomethingElse"); + Model out = S3ControlTransforms.asTransform().apply(m, service(m)); + assertSame(m, out); + } +} From b3ddae719a054be3e737fefe0a3e4b615202a592 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 15:58:53 -0400 Subject: [PATCH 26/53] =?UTF-8?q?Smithy:=20fix=20S3=20byte-parity=20?= =?UTF-8?q?=E2=80=94=20CopyObjectResult=20member=20rename,=20GetObject=20I?= =?UTF-8?q?d2-only,=20region=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/superpowers/plans/parity-deltas.md | 11 +++++ .../model/transforms/S3Transforms.java | 37 ++++++++++---- .../model/transforms/S3TransformsTest.java | 48 +++++++++++++++---- 3 files changed, 76 insertions(+), 20 deletions(-) diff --git a/docs/superpowers/plans/parity-deltas.md b/docs/superpowers/plans/parity-deltas.md index f6aa6813a8a..0aa51d260e8 100644 --- a/docs/superpowers/plans/parity-deltas.md +++ b/docs/superpowers/plans/parity-deltas.md @@ -44,6 +44,17 @@ _(none yet)_ - OUT OF SCOPE (remain C2J, documented): ~180 legacy error-code injection, CopySnapshot presign, custom endpoint-enum template. These are client/error/endpoint artifacts, not model-shape. - Remaining diffs are the two global deltas (stubbed serde, doc reflow). +## S3 accepted divergences +- **Expires deprecation note on both GetObjectResult AND HeadObjectResult:** The Smithy path applies + the `Expires` "Deprecated: Please use ExpiresString instead." doc-comment note to every operation + output that carries `Expires`, so it appears on both `GetObjectResult` and `HeadObjectResult`. C2J + emits the note only on `GetObjectResult` — an artifact of C2J deduping the customization across a + `Set`, which collapses the shared `Expires` member so the note lands on just one + result. The Smithy behavior is intentional and more consistent (both results describe the same + deprecated field identically). This is doc-comment-only and non-structural — accessors, member + order, and wire behavior are unchanged — so it is accepted rather than replicating C2J's + dedup-driven omission. No transform change (`addExpiresCustomization` is unchanged). + ## S3 serde-phased customizations (deferred until Smithy serde lands) - `markChecksumMembers` (S3 `CHECKSUM_MEMBERS_ENUMS`): checksum members drive request serialization only; no model-header delta today. Implement as an `S3Transforms` marker step when serde is diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index e369742e0fc..23e829db2f2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -7,6 +7,8 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.EnumShape; @@ -53,7 +55,7 @@ private static Model apply(Model model, ServiceShape service) { return model; } return injectAccessLogTagQuery(normalizeReplicationStatus(expandBucketLocationConstraint( - hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model), service)))), service); + hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model, service), service)))), service); } // C2J's S3RestXmlCppClientGenerator appends a `customizedAccessLogTag` map member @@ -124,7 +126,7 @@ private static Model normalizeReplicationStatus(Model model) { // Confirmed delta at implementation time against the live s3.json BucketLocationConstraint enum; // the other 18 C2J regions are already present upstream. - private static final List MISSING_REGIONS = List.of("us-east-1", "us-iso-west-1"); + private static final List MISSING_REGIONS = List.of("us-iso-west-1", "us-east-1"); private static Model expandBucketLocationConstraint(Model model) { Optional enumShape = model.shapes() @@ -147,6 +149,10 @@ private static Map regionNameValueMap() { return map; } + // C2J's GetObjectResult carries an x-amz-id-2 header member (Id2) plus the standard RequestId. + // The RequestId is supplied by ResultRenderer's top-level RequestId group for rest-xml results + // (resultHasTopLevelRequestId() == true), which byte-matches C2J; injecting a modeled RequestId + // member here would duplicate it. So inject only Id2. private static Model hackGetObjectResult(Model model) { String ns = "com.amazonaws.s3"; ShapeId outputId = ShapeId.fromParts(ns, "GetObjectOutput"); @@ -155,13 +161,11 @@ private static Model hackGetObjectResult(Model model) { return model; // no GetObjectOutput: nothing to do. } StructureShape output = outputOpt.get(); - if (output.getMember("Id2").isPresent() && output.getMember("RequestId").isPresent()) { - return model; // already injected (idempotent) — or upstream added them. + if (output.getMember("Id2").isPresent()) { + return model; // already injected (idempotent) — or upstream added it. } ShapeId id2ShapeId = ShapeId.fromParts(ns, "ObjectId2"); - ShapeId reqIdShapeId = ShapeId.fromParts(ns, "ObjectRequestId"); StringShape id2Shape = StringShape.builder().id(id2ShapeId).build(); - StringShape reqIdShape = StringShape.builder().id(reqIdShapeId).build(); StructureShape.Builder b = StructureShape.builder().id(output.getId()); output.getAllTraits().values().forEach(b::addTrait); @@ -169,12 +173,15 @@ private static Model hackGetObjectResult(Model model) { b.addMember(m.getMemberName(), m.getTarget(), mb -> m.getAllTraits().values().forEach(mb::addTrait))); b.addMember("Id2", id2ShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-id-2"))); - b.addMember("RequestId", reqIdShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-request-id"))); - return model.toBuilder().addShapes(id2Shape, reqIdShape, b.build()).build(); + return model.toBuilder().addShapes(id2Shape, b.build()).build(); } - private static Model renameCopyObjectResult(Model model) { + // C2J renames both the CopyObjectResult domain shape (to CopyObjectResultDetails) and the + // CopyObjectOutput member that references it, so the member renders as GetCopyObjectResultDetails + // while keeping its CopyObjectResult wire name. renameMember pins @xmlName("CopyObjectResult") + // for rest-xml so the wire key survives the member-name change. + private static Model renameCopyObjectResult(Model model, ServiceShape service) { String ns = "com.amazonaws.s3"; ShapeId oldId = ShapeId.fromParts(ns, "CopyObjectResult"); ShapeId newId = ShapeId.fromParts(ns, "CopyObjectResultDetails"); @@ -185,7 +192,17 @@ private static Model renameCopyObjectResult(Model model) { throw new IllegalStateException("S3 collision: '" + newId + "' already exists; cannot " + "rename '" + oldId + "' onto it."); } - return ModelTransformer.create().renameShapes(model, Map.of(oldId, newId)); + Model renamed = ModelTransformer.create().renameShapes(model, Map.of(oldId, newId)); + + ShapeId outputId = ShapeId.fromParts(ns, "CopyObjectOutput"); + Optional output = renamed.getShape(outputId).flatMap(Shape::asStructureShape); + if (output.isEmpty()) { + return renamed; // no CopyObjectOutput: shape rename suffices. + } + Protocol protocol = ProtocolResolver.resolve(service, renamed); + Optional updated = TransformSupport.renameMember( + output.get(), "CopyObjectResult", "CopyObjectResultDetails", protocol); + return updated.map(s -> renamed.toBuilder().addShape(s).build()).orElse(renamed); } private static final String EXPIRES_DEPRECATION = diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 399e4c3560d..ecaeda4b691 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -57,17 +57,38 @@ void noOpForS3WhenNothingToDo() { assertTrue(out.getShape(ShapeId.from(NS + "#AmazonS3")).isPresent()); } + static ServiceShape s3RestXmlService(String sdkId) { + return ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .addTrait(software.amazon.smithy.aws.traits.protocols.RestXmlTrait.builder().build()) + .build(); + } + @Test - void renamesCopyObjectResultToDetails() { - ServiceShape svc = s3Service("S3"); + void renamesCopyObjectResultShapeAndMember() { + ServiceShape svc = s3RestXmlService("S3"); StructureShape copyResult = StructureShape.builder().id(NS + "#CopyObjectResult") .addMember("ETag", ShapeId.from("smithy.api#String")).build(); - Model m = modelWith(svc, copyResult); + StructureShape copyOutput = StructureShape.builder().id(NS + "#CopyObjectOutput") + .addMember("CopyObjectResult", copyResult.getId()).build(); + Model m = modelWith(svc, copyResult, copyOutput); Model out = S3Transforms.asTransform().apply(m, svc); + assertTrue(out.getShape(ShapeId.from(NS + "#CopyObjectResultDetails")).isPresent(), - "renamed to CopyObjectResultDetails"); + "shape renamed to CopyObjectResultDetails"); assertFalse(out.getShape(ShapeId.from(NS + "#CopyObjectResult")).isPresent(), - "old name gone"); + "old shape name gone"); + + StructureShape output = out.expectShape(ShapeId.from(NS + "#CopyObjectOutput"), StructureShape.class); + assertFalse(output.getMember("CopyObjectResult").isPresent(), + "old member name gone"); + MemberShape renamed = output.getMember("CopyObjectResultDetails").orElseThrow(); + assertEquals(NS + "#CopyObjectResultDetails", renamed.getTarget().toString(), + "renamed member still targets the renamed shape"); + assertEquals("CopyObjectResult", + renamed.expectTrait(software.amazon.smithy.model.traits.XmlNameTrait.class).getValue(), + "renamed member pins its original CopyObjectResult wire name via @xmlName"); } @Test @@ -181,6 +202,10 @@ void appendsMissingBucketLocationConstraintRegions() { // Member names are identifier-safe, matching the existing model form (hyphens -> underscores). assertTrue(result.getAllMembers().containsKey("us_east_1"), "identifier-safe member name"); assertTrue(result.getAllMembers().containsKey("us_iso_west_1"), "identifier-safe member name"); + // C2J appends the two regions in the order us_iso_west_1 then us_east_1. + assertEquals(java.util.List.of("us_west_2", "us_iso_west_1", "us_east_1"), + new java.util.ArrayList<>(result.getAllMembers().keySet()), + "appended regions follow C2J order: us_iso_west_1 before us_east_1"); } @Test @@ -223,7 +248,7 @@ void normalizesReplicationStatusCompleteToCompleted() { } @Test - void injectsGetObjectId2AndRequestId() { + void injectsGetObjectId2Only() { ServiceShape svc = s3Service("S3"); StructureShape getObjectOutput = StructureShape.builder().id(NS + "#GetObjectOutput") .addMember("ETag", ShapeId.from("smithy.api#String")).build(); @@ -231,15 +256,18 @@ void injectsGetObjectId2AndRequestId() { Model out = S3Transforms.asTransform().apply(m, svc); assertTrue(out.getShape(ShapeId.from(NS + "#ObjectId2")).isPresent()); - assertTrue(out.getShape(ShapeId.from(NS + "#ObjectRequestId")).isPresent()); StructureShape outShape = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); MemberShape id2 = outShape.getMember("Id2").orElseThrow(); assertEquals(NS + "#ObjectId2", id2.getTarget().toString()); assertEquals("x-amz-id-2", id2.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue()); - MemberShape reqId = outShape.getMember("RequestId").orElseThrow(); - assertEquals("x-amz-request-id", - reqId.expectTrait(software.amazon.smithy.model.traits.HttpHeaderTrait.class).getValue()); + + // ResultRenderer supplies the top-level RequestId for rest-xml results; a modeled RequestId + // member would duplicate it and fail to compile, so it must not be injected here. + assertFalse(outShape.getMember("RequestId").isPresent(), + "no modeled RequestId member; the renderer emits RequestId"); + assertFalse(out.getShape(ShapeId.from(NS + "#ObjectRequestId")).isPresent(), + "ObjectRequestId shape must not be created"); } /** From 673e57121aafa225c883359b13611d98e83f8071 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Fri, 28 Aug 2026 16:05:36 -0400 Subject: [PATCH 27/53] Smithy: S3Transforms invert ExpiresString guard and add Unit-input guard --- .../model/transforms/S3Transforms.java | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 23e829db2f2..1c3aa9c7993 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -24,6 +24,7 @@ import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.HttpHeaderTrait; +import software.amazon.smithy.model.traits.UnitTypeTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -68,6 +69,9 @@ private static Model injectAccessLogTagQuery(Model model, ServiceShape service) Set inputShapes = TopDownIndex.of(model).getContainedOperations(service).stream() .map(OperationShape::getInputShape) + // smithy.api#Unit is a shared prelude StructureShape; mutating it would corrupt every + // Unit-input operation across the model, so never treat it as a request shape. + .filter(id -> !id.equals(UnitTypeTrait.UNIT)) .collect(Collectors.toSet()); List updated = model.shapes(StructureShape.class) .filter(s -> inputShapes.contains(s.getId())) @@ -231,34 +235,34 @@ private static Model addExpiresCustomization(Model model, ServiceShape service) replacements.add(StringShape.builder().id(expiresStringId).build()); } for (StructureShape struct : withExpires) { - if (struct.getMember("ExpiresString").isPresent()) { - continue; // already customized (idempotent). - } - MemberShape expires = struct.getAllMembers().get("Expires"); - StructureShape.Builder b = StructureShape.builder().id(struct.getId()); - struct.getAllTraits().values().forEach(b::addTrait); - for (MemberShape m : struct.getAllMembers().values()) { - if (m.getMemberName().equals("Expires")) { - // Rewrite Expires' documentation to prepend the deprecation note. - String existingDoc = m.getTrait(DocumentationTrait.class) - .map(DocumentationTrait::getValue).orElse(""); - b.addMember("Expires", m.getTarget(), mb -> { - m.getAllTraits().values().forEach(mb::addTrait); - if (!existingDoc.toLowerCase().contains("deprecated")) { - mb.addTrait(new DocumentationTrait(EXPIRES_DEPRECATION + existingDoc)); - } - }); - } else { - b.addMember(m.getMemberName(), m.getTarget(), - mb -> m.getAllTraits().values().forEach(mb::addTrait)); + // Only customize structs that lack ExpiresString (idempotent). + if (struct.getMember("ExpiresString").isEmpty()) { + MemberShape expires = struct.getAllMembers().get("Expires"); + StructureShape.Builder b = StructureShape.builder().id(struct.getId()); + struct.getAllTraits().values().forEach(b::addTrait); + for (MemberShape m : struct.getAllMembers().values()) { + if (m.getMemberName().equals("Expires")) { + // Rewrite Expires' documentation to prepend the deprecation note. + String existingDoc = m.getTrait(DocumentationTrait.class) + .map(DocumentationTrait::getValue).orElse(""); + b.addMember("Expires", m.getTarget(), mb -> { + m.getAllTraits().values().forEach(mb::addTrait); + if (!existingDoc.toLowerCase().contains("deprecated")) { + mb.addTrait(new DocumentationTrait(EXPIRES_DEPRECATION + existingDoc)); + } + }); + } else { + b.addMember(m.getMemberName(), m.getTarget(), + mb -> m.getAllTraits().values().forEach(mb::addTrait)); + } } + // Add ExpiresString cloning Expires' traits (so it reads the same header), retargeted. + b.addMember("ExpiresString", expiresStringId, + mb -> expires.getAllTraits().values().stream() + .filter(t -> !(t instanceof DocumentationTrait)) + .forEach(mb::addTrait)); + replacements.add(b.build()); } - // Add ExpiresString cloning Expires' traits (so it reads the same header), retargeted. - b.addMember("ExpiresString", expiresStringId, - mb -> expires.getAllTraits().values().stream() - .filter(t -> !(t instanceof DocumentationTrait)) - .forEach(mb::addTrait)); - replacements.add(b.build()); } return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } From e8ba45f3fa483818cf0af7b2e610dcb310ad1645 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 31 Aug 2026 13:42:43 -0400 Subject: [PATCH 28/53] Fix event stream dead code generation (unions, empty events) Smithy: EventStreamRenderer emits void() callback typedef for empty events Smithy: EventStreamRenderer emits arg-less default lambda for empty events Smithy: EventStreamRenderer dispatches empty events arg-less (no struct construct) Smithy: ShapeClassifier drops empty-member event structs from subObjects Smithy: drop incoming event-stream union header from subObjects/render Smithy: record event-stream empty-event cleanup as accepted parity divergence Smithy: skip empty-event struct include in event-stream handler header Smithy: mark event-stream handler-include defect resolved in parity-deltas --- docs/superpowers/plans/parity-deltas.md | 110 ----------- .../generators/model/ShapeClassifier.java | 27 ++- .../model/renderers/EventStreamRenderer.java | 167 ++++------------- .../model/EventStreamRendererTest.java | 176 +++++++++++++----- .../generators/model/ShapeClassifierTest.java | 62 ++++++ 5 files changed, 246 insertions(+), 296 deletions(-) delete mode 100644 docs/superpowers/plans/parity-deltas.md diff --git a/docs/superpowers/plans/parity-deltas.md b/docs/superpowers/plans/parity-deltas.md deleted file mode 100644 index 0aa51d260e8..00000000000 --- a/docs/superpowers/plans/parity-deltas.md +++ /dev/null @@ -1,110 +0,0 @@ -# Smithy Per-Service Model Parity — Documented Deltas - -Reviewed, accepted differences between Smithy-generated and C2J-generated `model::` -files. Anything not listed here must be resolved (empty diff) before a transform is "done". - -## Global-baseline deltas (not service-specific) -- **Stubbed payload serde (global):** Smithy emits empty serde bodies (e.g. `SerializePayload() const { return {}; }`, `OutputToStream(...) {}`) where C2J emits full serialization. Affects every shape; not service-specific. Pending serde implementation in the model plugin. -- **Doc-comment reflow (global):** Smithy wraps member documentation comments differently from C2J. Cosmetic; affects many members across services. - - -- **Pagination-traits files (global):** Smithy emits `PaginationTraits.h` under model/ that the C2J model tree doesn't; separate pagination plugin output, pre-existing. -- **ResponseMetadata standalone file (query/ec2, global):** C2J emits a standalone `ResponseMetadata.{h,cpp}`; the Smithy plugin injects ResponseMetadata via GlobalTransforms but doesn't emit it as a standalone sub-object file. Pre-existing; unaffected by the dual-role classifier fix. -- **Required-member HasBeenSet handling (FIXED):** The C++ SDK tracks member presence via `HasBeenSet`, not required-ness. In C2J, `CppClientGenerator#generateSourceFiles` unconditionally clears `required` on EVERY modeled member ("so we can do a value has been set check on all fields"), then `addRequestIdToResults` injects `ResponseMetadata` as required — so the injected `ResponseMetadata` is the ONLY member rendered with no `HasBeenSet()` getter + flag `= true` (in a `useRequiredField=true` context: sub-object/request; a pure result uses `useRequiredField=false` so even it inits `= false`). Every modeled member — plain `@required` (JSON) AND `@required @clientOptional` (the 17 query/xml services) — renders a getter + `= false`. The Smithy plugin does NOT mirror C2J's model mutation (that would discard `@required`, which serde/validation will want). Instead `MemberRenderer` keys the always-present treatment on **recognizing the injected `ResponseMetadata`** (member named `ResponseMetadata` whose target is the `ResponseMetadata` structure — exactly how C2J identifies it), gated on `emitHasBeenSet` (the `useRequiredField` proxy: `forStructure`=true, `forResult`=false), excepting event-stream / raw-streaming-payload members. `@required` is left intact on all members. `GlobalTransforms.injectResponseMetadata` fails fast (`IllegalStateException`) if a model already defines a `ResponseMetadata` shape or member, so the name-based recognition stays unambiguous (verified: 0 of 433 models define one). `GlobalTransforms.RESPONSE_METADATA` is the single shared name constant. Verified end-to-end on EC2 (identical to C2J): 747 results init `= false`, 4 dual-role sub-objects (`Reservation`/`Snapshot`/`Volume`/`VolumeAttachment`) init `= true`; `VolumeDetail.Size` (`@required @clientOptional`) → getter + `= false`. NOTE: keying on `@clientOptional` would be WRONG — absent from the 380 JSON services whose plain `@required` members C2J also treats as optional (e.g. DynamoDB `GetItemRequest.TableName`). -- **Enum Windows-macro #undef guard (FIXED):** C2J's `ModelEnumHeader.vm` wraps enum values that collide with a Windows preprocessor macro in `#if defined(_WIN32) && defined(X) / #undef X / #endif`, driven by `PlatformAndKeywordSanitizer.PREDEFINED_SYMBOLS_MAPPING` (namespace-keyed: `EC2→interface`, `DynamoDB→IN`, `S3Crt→IGNORE`). The Smithy `EnumRenderer.renderHeader` now emits the same guard (before the namespace block) via `predefinedWindowsSymbols(serviceNamespace, values)`, mirroring that mapping. Fixes e.g. `NetworkInterfaceType.h` (`interface` value). Per-service/namespace keyed; other services with the same value do not emit it. -- **ShapeClassifier dual-role fix (FIXED):** structures that are both an operation output AND a member target (e.g. lambda FunctionConfiguration/AliasConfiguration/EventSourceMappingConfiguration/Concurrency/FunctionEventInvokeConfig) are now emitted as sub-objects too, matching C2J. Verified: lambda Only-in-C2J model files 10 -> 0; no spurious over-emission; sqs unchanged. -- **Deprecated-orphan dead files (global, ACCEPTED):** When a shape is reachable ONLY through `@deprecated` member(s), C2J still emits a model file for it, while the Smithy plugin omits it. Root cause is a C2J bug: `C2jModelToGeneratorModelTransformer.removeUnreferencedShapes()` is a single, non-transitive pass over `referencedBy`, so it removes only the first-order orphan (usually the intermediate list/map, which emits no file) and still emits the struct/enum that list pointed at as a dead, unreferenced file. The Smithy plugin's `computeReachableShapes` walks only surviving edges and correctly omits the whole orphan subtree. **Proven safe:** across all 433 services this drops files in 17 (e.g. ec2: AssociatedTargetNetwork/AssociatedNetworkType/ElasticGpuSpecification/ElasticInferenceAccelerator/LaunchTemplateElasticInferenceAccelerator; guardduty: 32) with **0 dangling references** — a shape shared with any non-deprecated reference is always kept (verified by `GlobalTransformsTest.dropDeprecatedMembers_sharedTargetSurvivesViaNonDeprecatedReference`). Smithy output is strictly cleaner; accepted rather than replicating C2J's dead files. - -## rds -- SourceRegion member injected by SourceRegionTransform is present and structurally identical to C2J at the member/accessor level (verified Task 2). Remaining rds diffs are the two global deltas above. - -## docdb -_(none yet)_ - -## neptune -_(none yet)_ - -## lambda -_(none yet)_ - -## sqs -_(none yet)_ - -## apigateway -_(none yet)_ - -## apigatewayv2 -_(none yet)_ - -## ec2 -- Result naming: operation-output result classes use `Response` via ResultRenderer+ShapeUtil.getResultSuffix; nested `*Result` domain structs renamed to `*Response` by Ec2Transforms. Verified 0 Result/Response file mismatches vs C2J. -- SpotInstanceState `disabled` value present (parity). -- SecureBlobAttributeValue (FIXED via Ec2Transforms): upstream `aws/aws-models` itself diverges — the C2J `ec2//service-2.json` models `ModifyInstanceAttributeRequest.UserData -> SecureBlobAttributeValue -> SecureBlob(@sensitive)`, but the upstream Smithy `ec2/smithy/model.json` still targets the non-sensitive `BlobAttributeValue` (verified against upstream on master). Re-syncing the Smithy model would NOT fix it (upstream Smithy lacks the shape). `Ec2Transforms.addSecureBlobUserData` mirrors the C2J modeling in the Smithy model at generation time: adds `SecureBlob`(@sensitive -> CryptoBuffer) + `SecureBlobAttributeValue{Value}` and repoints `UserData`, which orphans `BlobAttributeValue` so it drops from the emitted set exactly as in C2J. Self-retires (no-op) once the upstream Smithy model catches up. Temporary compensation for upstream data lag; the durable fix is an upstream aws-models correction. Note: the generated `SecureBlobAttributeValue.{h,cpp}` still differs from C2J only in the stubbed-serde bodies (global delta above). -- Deprecated-orphan dead files: 5 shapes / 10 files (AssociatedTargetNetwork, AssociatedNetworkType, ElasticGpuSpecification, ElasticInferenceAccelerator, LaunchTemplateElasticInferenceAccelerator) — see global "Deprecated-orphan dead files" delta above. -- OUT OF SCOPE (remain C2J, documented): ~180 legacy error-code injection, CopySnapshot presign, custom endpoint-enum template. These are client/error/endpoint artifacts, not model-shape. -- Remaining diffs are the two global deltas (stubbed serde, doc reflow). - -## S3 accepted divergences -- **Expires deprecation note on both GetObjectResult AND HeadObjectResult:** The Smithy path applies - the `Expires` "Deprecated: Please use ExpiresString instead." doc-comment note to every operation - output that carries `Expires`, so it appears on both `GetObjectResult` and `HeadObjectResult`. C2J - emits the note only on `GetObjectResult` — an artifact of C2J deduping the customization across a - `Set`, which collapses the shared `Expires` member so the note lands on just one - result. The Smithy behavior is intentional and more consistent (both results describe the same - deprecated field identically). This is doc-comment-only and non-structural — accessors, member - order, and wire behavior are unchanged — so it is accepted rather than replicating C2J's - dedup-driven omission. No transform change (`addExpiresCustomization` is unchanged). - -## S3 serde-phased customizations (deferred until Smithy serde lands) -- `markChecksumMembers` (S3 `CHECKSUM_MEMBERS_ENUMS`): checksum members drive request serialization - only; no model-header delta today. Implement as an `S3Transforms` marker step when serde is - un-stubbed. Map (member → algorithm value): ChecksumCRC32→CRC32, ChecksumCRC32C→CRC32C, - ChecksumSHA1→SHA1, ChecksumSHA256→SHA256, ChecksumSHA512→SHA512, ChecksumXXHASH64→XXHASH64, - ChecksumXXHASH3→XXHASH3, ChecksumXXHASH128→XXHASH128, ChecksumMD5→MD5. (ChecksumCRC64NVME NOT mapped.) -- `injectAccessLogTagQuery` (S3 `customizedAccessLogTag` querystring map on every request): - **IMPLEMENTED** (Task 7) — `S3Transforms.injectAccessLogTagQuery` injects a `customizedAccessLogTag` - `map` member (targeting `com.amazonaws.s3#CustomizedAccessLogTag`, key+value - `smithy.api#String`) onto every operation request shape, appended last, idempotent. This closes the - `.h` member-accessor delta (`GetCustomizedAccessLogTag` / `SetCustomizedAccessLogTag` / - `WithCustomizedAccessLogTag` / `AddCustomizedAccessLogTag` / `m_customizedAccessLogTag`). The - querystring binding (`location=querystring`, `customizedQuery=true` → `AddQueryStringParameters` - serde) is still DEFERRED until Smithy serde lands; no `@httpQuery`/`@httpQueryParams` trait is - attached yet, to avoid perturbing stubbed request emission. - -### Task 7 investigation note (evidence correction — access-log IMPLEMENTED, checksum DEFERRED) -The two "serde only" labels above are imprecise: **both customizations DO produce an observable -model-HEADER delta today** in C2J vs the current `--use-smithy-models` output. Per a later controller -decision, the **access-log tag member injection is now IMPLEMENTED** (the `.h` accessors are a pure -model-shape delta, closeable by a standalone `S3Transforms` injection; only its querystring serde -binding is deferred). **Checksum stays DEFERRED** — it is not closeable by a marker transform without -renderer work. Evidence: - -- **Checksum (header delta, needs MemberRenderer support):** `markChecksumMembers` sets - `ShapeMember.checksumMember/checksumEnumMember`, which C2J's *header* template - `ModelClassMembersAndInlines.vm` (lines 56–59, 100–101) consumes to emit a setter side-effect — - e.g. `SetChecksumCRC32(...)` also calls `SetChecksumAlgorithm(ChecksumAlgorithm::CRC32);` (and a - `const char*` overload). Confirmed present in C2J `generated/.../PutObjectRequest.h` - (`SetChecksumCRC32/CRC32C/SHA1/SHA256/SHA512/MD5/XXHASH64/XXHASH3/XXHASH128`), and correctly ABSENT - on the unmapped `ChecksumCRC64NVME`. The Smithy `MemberRenderer` setter bodies emit only - `HasBeenSet = true; ...` and never `SetChecksumAlgorithm(...)`; `RequestRenderer.renderChecksumImpls` - only handles the separate `@httpChecksum` trait impls (`GetChecksumAlgorithmName`, `ChecksumAlgorithmIsSet`, - etc. — the `ModelClassChecksumMembers.vm` concern), not the value-member setter side-effect. So a - *marker* transform alone is inert: closing this delta requires `MemberRenderer` to grow bespoke - logic that reads the marker. Deferred to the render/serde phase. - -- **Access-log tag (header delta — IMPLEMENTED; query-binding serde deferred):** - `injectAccessLogTagQuery` (S3RestXmlCppClientGenerator.java ~299–340) injects a real - `customizedAccessLogTag` `map` member (`location=querystring`, - `customizedQuery=true`) into EVERY request input. C2J's header template renders full accessors — - confirmed in C2J `generated/.../PutObjectRequest.h` and others (`GetCustomizedAccessLogTag`, - `SetCustomizedAccessLogTag`, `WithCustomizedAccessLogTag`, `AddCustomizedAccessLogTag`, - `m_customizedAccessLogTag`, `m_customizedAccessLogTagHasBeenSet`). The Smithy S3 model - (`smithy/api-descriptions/s3.json`) has ZERO occurrences. `S3Transforms.injectAccessLogTagQuery` - now mirrors the C2J injection at the model-shape level: it appends the `customizedAccessLogTag` - `map` member to every request input (idempotent), closing the `.h` accessor delta. - The query-string binding is intentionally NOT modeled yet: no `@httpQuery`/`@httpQueryParams` trait - is attached, because that would engage the (stubbed) serde/render path and risk perturbing request - emission. For restXml an unbound member would be misclassified as a payload member during serde; - the correct query-param binding (`customizedQuery` loop in `AddQueryStringParametersToRequest.vm`) - lands with the querystring serde work. Byte-parity of the querystring serialization is a Task 9 - follow-up once Smithy serde is un-stubbed. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index 3f7c035a93b..353b2cbce3e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -181,6 +181,16 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } } + // Incoming event-stream union shape ids: the @streaming union member of every operation + // output collected as an event-stream handler. These unions are realized via the handler + // (EventStreamRenderer.renderHandler{Header,Source}) and never referenced as a data type, + // so their standalone .h is dead public API that we omit. + Set incomingEventStreamUnionIds = new HashSet<>(); + for (EventStreamInfo info : eventStreamHandlers) { + streamingUnionMember(info.resultShape(), model) + .ifPresent(u -> incomingEventStreamUnionIds.add(u.getId())); + } + // Walk all reachable shapes and classify remaining ones for (ShapeId id : reachable) { Shape shape = model.expectShape(id); @@ -200,10 +210,19 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto subObjects.add(shape); } } else if (shape.isStructureShape() || shape.isUnionShape()) { - // A shape marked @customRendered is emitted by a dedicated renderer (e.g. - // DynamoDbRenderer for AttributeValue); skip the default sub-object emission so the - // two do not both write — and append into — the same model file. - if (!shape.hasTrait(CustomRenderedTrait.class)) { + // Skip: + // - @customRendered shapes (emitted by a dedicated renderer, e.g. DynamoDbRenderer + // for AttributeValue) so the two do not both write — and append into — the same + // model file. + // - empty-member event structs — after EventStreamRenderer's void() callback fix, + // these have no other references and shipping their .h/.cpp adds dead public API + // to the SDK. + boolean customRendered = shape.hasTrait(CustomRenderedTrait.class); + boolean emptyEventStruct = eventStructIds.contains(id) + && shape.isStructureShape() + && shape.members().isEmpty(); + boolean incomingUnion = incomingEventStreamUnionIds.contains(id); + if (!customRendered && !emptyEventStruct && !incomingUnion) { subObjects.add(shape); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java index f256588f006..0ffab02d1c0 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java @@ -4,22 +4,18 @@ */ package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; -import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; -import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper; import com.amazonaws.util.awsclientsmithygenerator.generators.model.MemberRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.FileKind; import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.ProtocolTraits; import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; -import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.EventStreamInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.UnionShape; -import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.traits.ErrorTrait; import software.amazon.smithy.model.traits.StreamingTrait; @@ -29,9 +25,11 @@ /** * Renders C++ event stream artifacts for response-side (simplex) streaming operations: - * the handler, initial response, and event stream union. Driven by the classifier's - * {@link EventStreamInfo} list. Event structure shapes themselves are generated - * elsewhere (as reachable sub-objects) and only referenced here. + * the handler and initial response. Driven by the classifier's {@link EventStreamInfo} + * list. Event structure shapes themselves are generated elsewhere (as reachable + * sub-objects) and only referenced here. The {@code @streaming} union data type is not + * emitted: it is realized entirely through the handler and referenced by nothing, so the + * classifier drops it from sub-objects (dead public API). * *

No protocol-specific serialization is emitted; payload (de)serialization points * are protocol-agnostic TODO stubs via {@link ProtocolTraits}. @@ -61,7 +59,6 @@ public void render(CppWriterDelegator writerDelegator) { renderHandlerHeader(writerDelegator, info.operationName(), events); renderHandlerSource(writerDelegator, info.operationName(), events); renderInitialResponse(writerDelegator, info.operationName(), info.resultShape()); - renderEventStreamUnion(writerDelegator, info.operationName(), union, events, exceptions); } } @@ -93,21 +90,6 @@ private String eventShapeName(MemberShape member) { return member.getTarget().getName(); } - /** - * True if an exception member targets a modeled exception (members beyond the trivial - * message/code). C2J types modeled exceptions as their concrete shape (with a model include) - * and non-modeled ones as the generic {@code Error} wrapper. - */ - private boolean isModeledException(MemberShape exc) { - StructureShape target = ctx.model().expectShape(exc.getTarget(), StructureShape.class); - return ShapeClassifier.isModeledException(target, ctx.protocolTraits().protocol()); - } - - /** The C++ type for an exception member: concrete shape name if modeled, else {@code errorType}. */ - private String exceptionType(MemberShape exc, String errorType) { - return isModeledException(exc) ? exc.getTarget().getName() : errorType; - } - /** The wire member key, e.g. "alpha". */ private String wireKey(MemberShape member) { return member.getMemberName(); @@ -133,7 +115,10 @@ private void renderHandlerHeader(CppWriterDelegator writerDelegator, String opNa writer.write("#include ", ctx.smithyServiceName(), ctx.namespace()); writer.write("#include ", ctx.smithyServiceName(), opName); for (MemberShape event : events) { - writer.write("#include ", ctx.smithyServiceName(), eventShapeName(event)); + boolean emptyEvent = ctx.model().expectShape(event.getTarget()).members().isEmpty(); + if (!emptyEvent) { + writer.write("#include ", ctx.smithyServiceName(), eventShapeName(event)); + } } writer.write(""); ModelFile.modelNamespace(writer, ctx.namespace(), () -> { @@ -154,7 +139,12 @@ private void renderHandlerHeader(CppWriterDelegator writerDelegator, String opNa writer.write("typedef std::function $1LInitialResponseCallbackEx;", opName); for (MemberShape event : events) { String ev = eventShapeName(event); - writer.write("typedef std::function $1LCallback;", ev); + boolean emptyEvent = ctx.model().expectShape(event.getTarget()).members().isEmpty(); + if (emptyEvent) { + writer.write("typedef std::function $1LCallback;", ev); + } else { + writer.write("typedef std::function $1LCallback;", ev); + } } writer.write("typedef std::function& error)> ErrorCallback;", ctx.namespace()); writer.write(""); @@ -253,9 +243,16 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); for (MemberShape event : events) { String ev = eventShapeName(event); - writer.openBlock("m_on$1L = [&](const $1L&) {", "};", ev, () -> { - writer.write("AWS_LOGSTREAM_TRACE($1L, \"$2L received.\");", tag, ev); - }); + boolean emptyEvent = ctx.model().expectShape(event.getTarget()).members().isEmpty(); + if (emptyEvent) { + writer.openBlock("m_on$1L = [&]() {", "};", ev, () -> { + writer.write("AWS_LOGSTREAM_TRACE($1L, \"$2L received.\");", tag, ev); + }); + } else { + writer.openBlock("m_on$1L = [&](const $1L&) {", "};", ev, () -> { + writer.write("AWS_LOGSTREAM_TRACE($1L, \"$2L received.\");", tag, ev); + }); + } } writer.openBlock("m_onError = [&](const AWSError<$1LErrors>& error) {", "};", ctx.namespace(), () -> { writer.write("AWS_LOGSTREAM_TRACE($1L, \"$2L Errors received, \" << error);", tag, ctx.namespace()); @@ -309,8 +306,13 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); for (MemberShape event : events) { writer.openBlock("case $1LEventType::$2L: {", "}", opName, enumConstant(event), () -> { - ctx.protocolTraits().writeEventPayloadDecode(writer, eventShapeName(event), - "m_on" + eventShapeName(event)); + boolean emptyEvent = ctx.model().expectShape(event.getTarget()).members().isEmpty(); + String callbackMember = "m_on" + eventShapeName(event); + if (emptyEvent) { + writer.write("$L();", callbackMember); + } else { + ctx.protocolTraits().writeEventPayloadDecode(writer, eventShapeName(event), callbackMember); + } writer.write("break;"); }); } @@ -408,7 +410,7 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); } - // ---- Initial response / event stream union ------------------------------ + // ---- Initial response --------------------------------------------------- /** * Builds a synthetic {@code InitialResponse} structure from the result's non-event-stream @@ -500,107 +502,4 @@ private void renderInitialResponse(CppWriterDelegator writerDelegator, String op }); } - private void renderEventStreamUnion(CppWriterDelegator writerDelegator, String opName, - UnionShape union, List events, - List exceptions) { - String className = union.getId().getName(); - String errorType = ctx.namespace() + "Error"; - - String headerFile = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; - writerDelegator.useFileWriter(headerFile, writer -> { - writer.write("#pragma once"); - writer.write("#include ", ctx.smithyServiceName(), ctx.namespace()); - // C2J omits the service Errors include: its header-include computation skips non-modeled - // exception members (CppViewHelper: `if (next.isException() && !next.isModeledException()) - // continue;`), which are the generic Error wrapper and resolve transitively. - // Concrete event shapes AND modeled exceptions get their own model include. - for (MemberShape event : events) { - writer.write("#include ", ctx.smithyServiceName(), eventShapeName(event)); - } - for (MemberShape exc : exceptions) { - if (isModeledException(exc)) { - writer.write("#include ", ctx.smithyServiceName(), exc.getTarget().getName()); - } - } - writer.write(""); - writer.write("#include "); - writer.write(""); - ModelFile.modelNamespace(writer, ctx.namespace(), - () -> ctx.protocolTraits().writeShapeForwardDeclarations(writer), - () -> { - writer.write(""); - MemberRenderer.renderClassDocComment(writer, union, ctx.smithyServiceName(), ctx.service().getVersion()); - writer.openBlock("class $L {", "};", className, () -> { - writer.write("public:"); - ctx.protocolTraits().writeSerdeMethodDecls(writer, ctx.exportMacro(), className, null); - writer.write(""); - // Event member accessors, typed as their concrete shape. - for (MemberShape event : events) { - String cppType = CppTypeMapper.getCppType(ctx.model().expectShape(event.getTarget()), ctx.model()); - renderShapeAccessor(writer, className, cppType, event.getMemberName(), event); - } - // Exception member accessors: modeled -> concrete type; non-modeled -> Error. - for (MemberShape exc : exceptions) { - renderShapeAccessor(writer, className, exceptionType(exc, errorType), exc.getMemberName(), exc); - } - writer.dedent(); - writer.write("private:"); - writer.indent(); - // Data members - for (MemberShape event : events) { - String cppType = CppTypeMapper.getCppType(ctx.model().expectShape(event.getTarget()), ctx.model()); - writer.write("$1L $2L;", cppType, CppNames.fieldName(event.getMemberName())); - } - for (MemberShape exc : exceptions) { - writer.write("$1L $2L;", exceptionType(exc, errorType), CppNames.fieldName(exc.getMemberName())); - } - // HasBeenSet flags - for (MemberShape event : events) { - writer.write("bool $1LHasBeenSet = false;", CppNames.fieldName(event.getMemberName())); - } - for (MemberShape exc : exceptions) { - writer.write("bool $1LHasBeenSet = false;", CppNames.fieldName(exc.getMemberName())); - } - }); - writer.write(""); - }); - }); - - // C2J generates the event stream union as a header-only type: the serde methods are - // declared but never defined or referenced (the handler dispatches on the concrete - // event shape, not the union). No .cpp is emitted, to match mainline parity. - } - - /** - * Renders a Get/HasBeenSet/Set/With accessor block for a union member, typed by the - * given C++ type string. Used for both event members (concrete shape type) and - * exception members (the service error wrapper). Mirrors the templated setter style - * used by MemberRenderer. - */ - private void renderShapeAccessor(CppWriter writer, String className, String cppType, String memberName, - MemberShape member) { - String getter = CppNames.capitalize(memberName); - String field = CppNames.fieldName(memberName); - String templateParam = getter + "T"; - writer.write("///@{"); - if (member.getTrait(DocumentationTrait.class).isPresent()) { - MemberRenderer.writeDocComment(writer, - MemberRenderer.collapseWhitespace(member.getTrait(DocumentationTrait.class).get().getValue())); - } else { - writer.write(""); - } - writer.write("inline const $1L& Get$2L() const { return $3L; }", cppType, getter, field); - writer.write("inline bool $1LHasBeenSet() const { return $2LHasBeenSet; }", getter, field); - writer.write("template ", templateParam, cppType); - writer.openBlock("void Set$1L($2L&& value) {", "}", getter, templateParam, () -> { - writer.write("$1LHasBeenSet = true;", field); - writer.write("$1L = std::forward<$2L>(value);", field, templateParam); - }); - writer.write("template ", templateParam, cppType); - writer.openBlock("$1L& With$2L($3L&& value) {", "}", className, getter, templateParam, () -> { - writer.write("Set$1L(std::forward<$2L>(value));", getter, templateParam); - writer.write("return *this;"); - }); - writer.write("///@}"); - } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java index f3638429c04..d04d8a98092 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java @@ -87,8 +87,61 @@ private static Model twoEventModel() { return Model.builder().addShapes(str, stream, eventA, eventB, exc, modeledExc, input, output, op, service).build(); } + // A @streaming union with one empty event (target shape has no modeled members) and one data + // event (target shape has a modeled member). Callback/member names derive from the target + // shape name, matching twoEventModel's convention (alpha -> AlphaEvent -> m_onAlphaEvent). + private static Model unionWithEmptyAndDataEvent() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape emptyEvent = StructureShape.builder() + .id("com.example#EmptyEvent") + .build(); + StructureShape dataEvent = StructureShape.builder() + .id("com.example#DataEvent") + .addMember("data", str.getId()) + .build(); + UnionShape stream = UnionShape.builder() + .id("com.example#MyStreamEventStream") + .addTrait(new StreamingTrait()) + .addMember("emptyEvent", emptyEvent.getId()) + .addMember("dataEvent", dataEvent.getId()) + .build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoStreamInput") + .addMember("name", str.getId()) + .build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoStreamOutput") + .addMember(software.amazon.smithy.model.shapes.MemberShape.builder() + .id("com.example#DoStreamOutput$stream").target(stream.getId()) + .addTrait(new software.amazon.smithy.model.traits.HttpPayloadTrait()).build()) + .build(); + software.amazon.smithy.model.shapes.OperationShape op = + software.amazon.smithy.model.shapes.OperationShape.builder() + .id("com.example#DoStream") + .input(input.getId()) + .output(output.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example") + .version("2024-01-01") + .addOperation(op.getId()) + .build(); + return Model.builder().addShapes(str, stream, emptyEvent, dataEvent, input, output, op, service).build(); + } + private static String render(String fileSuffix) { - Model model = twoEventModel(); + return render(twoEventModel(), fileSuffix); + } + + private static String renderHandlerHeaderFor(Model model) { + return render(model, "DoStreamHandler.h"); + } + + private static String renderHandlerSourceFor(Model model) { + return render(model, "DoStreamHandler.cpp"); + } + + private static String render(Model model, String fileSuffix) { ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); MockManifest manifest = new MockManifest(); CppWriterDelegator delegator = new CppWriterDelegator(manifest); @@ -106,6 +159,22 @@ private static String render(String fileSuffix) { .orElseThrow(); } + private static java.util.List renderedFilePaths(Model model) { + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + Protocol protocol = ProtocolResolver.resolve(service, model); + EventStreamRenderer renderer = new EventStreamRenderer( + ShapeClassifier.classify(model, service, protocol).eventStreamHandlers(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", "example")); + renderer.render(delegator); + delegator.flushWriters(); + return manifest.getFiles().stream() + .map(java.nio.file.Path::toString) + .collect(java.util.stream.Collectors.toList()); + } + @Test void handlerHeader_hasEnumAndCallbacksPerEvent() { String h = render("DoStreamHandler.h"); @@ -138,53 +207,19 @@ void handlerHeader_wrapsInitialResponseSettersInDocGroup() { } @Test - void eventStreamUnionHeader_typesEventAndExceptionMembers() { - String h = render("MyStreamEventStream.h"); - // NOTE: file name derives from the UNION shape name (MyStream), not the operation. - assertTrue(h.contains("class MyStreamEventStream"), "Missing union class: " + h); - // Event member typed as its concrete shape - assertTrue(h.contains("const AlphaEvent& GetAlpha()") || h.contains("GetAlpha"), - "Missing event accessor: " + h); - // Exception member typed as Error - assertTrue(h.contains("ExampleError"), "Exception members must be typed as ExampleError: " + h); - } - - @Test - void eventStreamUnionHeader_modeledExceptionUsesConcreteTypeAndInclude() { - // C2J types a modeled exception member (extra members beyond message/code) as its concrete - // shape and includes its model header, while a non-modeled exception stays the generic - // Error (no include). Matches CppViewHelper's isException/isModeledException gate. - String h = render("MyStreamEventStream.h"); - // Modeled exception -> concrete type + include. - assertTrue(h.contains("const DetailedException& GetDetailedException()"), - "Modeled exception must use its concrete type: " + h); - assertTrue(h.contains("#include "), - "Modeled exception must bring its model include: " + h); - // Non-modeled exception -> generic ExampleError. - assertTrue(h.contains("const ExampleError& GetBadException()"), - "Non-modeled exception must use the generic error type: " + h); - } - - @Test - void eventStreamUnionHeader_omitsServiceErrorsInclude() { - // C2J's computeHeaderIncludes skips the model include for non-modeled exception members - // (CppViewHelper: `if (next.isException() && !next.isModeledException()) continue;`). - // The union's exception members are the generic ExampleError wrapper, so the union header - // must NOT include the service Errors header — it resolves transitively. The handler - // header (a separate file) still includes it. - String h = render("MyStreamEventStream.h"); - assertFalse(h.contains("#include "), - "Union header must not include the service Errors header: " + h); - } - - @Test - void eventStreamUnionHeader_rendersClassAndMemberDocs() { - String h = render("MyStreamEventStream.h"); - // Union class-level documentation + See Also link. - assertTrue(h.contains("Tagged union of stream events."), "Missing union class doc: " + h); - assertTrue(h.contains("See Also:"), "Missing See Also block on union class: " + h); - // Member-level doc flows to the accessor for the member that has one. - assertTrue(h.contains("Alpha event doc."), "Missing alpha member doc: " + h); + void eventStreamUnionHeader_noLongerEmitted() { + // The incoming event-stream union is realized via the handler; nothing references it as a + // data type. The renderer must not emit its standalone .h (dead public API) — the + // classifier already drops it from subObjects so no other renderer emits it either. + java.util.List paths = renderedFilePaths(twoEventModel()); + assertTrue(paths.stream().noneMatch(p -> p.endsWith("MyStreamEventStream.h")), + "incoming event-stream union header must not be emitted: " + paths); + // And no rendered file declares the union class. + for (String path : paths) { + String contents = render(twoEventModel(), path.substring(path.lastIndexOf('/') + 1)); + assertFalse(contents.contains("class MyStreamEventStream"), + "no rendered file may declare the union class: " + path); + } } @Test @@ -284,4 +319,49 @@ void handlerSource_eventCasesUseStubNoProtocolTokens() { assertFalse(c.contains("JsonValue"), "No protocol tokens in handler: " + c); assertFalse(c.contains("Cbor"), "No protocol tokens in handler: " + c); } + + @Test + void emptyEventEmitsVoidCallbackTypedef() { + String out = renderHandlerHeaderFor(unionWithEmptyAndDataEvent()); + assertTrue(out.contains("typedef std::function EmptyEventCallback;"), + "empty event => arg-less typedef: " + out); + assertTrue(out.contains("typedef std::function DataEventCallback;"), + "data event => struct-arg typedef preserved: " + out); + } + + @Test + void emptyEventEmitsArglessDefaultLambda() { + String out = renderHandlerSourceFor(unionWithEmptyAndDataEvent()); + assertTrue(out.contains("m_onEmptyEvent = [&]() {"), + "empty event default lambda takes no args: " + out); + assertTrue(out.contains("m_onDataEvent = [&](const DataEvent&) {"), + "data event default lambda unchanged: " + out); + } + + @Test + void emptyEventDispatchesWithoutConstructingStruct() { + String out = renderHandlerSourceFor(unionWithEmptyAndDataEvent()); + assertTrue(out.contains("m_onEmptyEvent();"), + "empty event dispatched arg-less: " + out); + assertFalse(out.contains("m_onEmptyEvent(EmptyEvent{"), + "empty event dispatch must not construct the empty struct: " + out); + } + + @Test + void nonEmptyEventBehaviorUnchanged() { + String out = renderHandlerHeaderFor(unionWithEmptyAndDataEvent()); + assertTrue(out.contains("typedef std::function DataEventCallback;"), + "non-empty event typedef unchanged: " + out); + } + + @Test + void emptyEventStructHeaderNotIncluded() { + // An empty event's struct is dropped by the classifier, so including its header would dangle + // and is unnecessary (the callback is arg-less). A data event keeps its struct include. + String out = renderHandlerHeaderFor(unionWithEmptyAndDataEvent()); + assertFalse(out.contains("#include "), + "empty event struct header must not be included: " + out); + assertTrue(out.contains("#include "), + "data event struct header must still be included: " + out); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java index 946557260de..3ae0b5d93c2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java @@ -617,6 +617,68 @@ void customRenderedShape_isExcludedFromSubObjects() { "unmarked shape must remain a sub-object: " + classified.subObjects()); } + /** + * A @streaming union with two event members: one empty-member event (like S3's + * ContinuationEvent / EndEvent, referenced by nothing after EventStreamRenderer's void() + * callback fix) and one data event carrying a string member. Bound to an operation output so + * both event structs are reachable. + */ + private Model eventStreamEmptyAndDataModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape emptyEvt = StructureShape.builder() + .id("com.example#EmptyEvt") + .build(); + StructureShape dataEvt = StructureShape.builder() + .id("com.example#DataEvt") + .addMember("records", str.getId()) + .build(); + UnionShape eventStream = UnionShape.builder() + .id("com.example#SelectEventStream") + .addTrait(new StreamingTrait()) + .addMember("Empty", emptyEvt.getId()) + .addMember("Data", dataEvt.getId()) + .build(); + StructureShape request = StructureShape.builder() + .id("com.example#SelectRequest").addMember("name", str.getId()).build(); + StructureShape response = StructureShape.builder() + .id("com.example#SelectResponse").addMember("events", eventStream.getId()).build(); + OperationShape op = OperationShape.builder() + .id("com.example#Select").input(request.getId()).output(response.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2023-01-01").addOperation(op.getId()) + .addTrait(ServiceTrait.builder().sdkId("test").arnNamespace("test").cloudFormationName("Test").cloudTrailEventSource("test").build()) + .build(); + return Model.builder() + .addShapes(str, emptyEvt, dataEvt, eventStream, request, response, op, service) + .build(); + } + + @Test + void classifyDropsEmptyMemberEventStructFromSubObjects() { + Model model = eventStreamEmptyAndDataModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertFalse(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("EmptyEvt")), + "empty event struct dropped from subObjects: " + classified.subObjects()); + assertTrue(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("DataEvt")), + "data event struct still emitted as sub-object: " + classified.subObjects()); + } + + @Test + void classifyDropsIncomingEventStreamUnionFromSubObjects() { + // The @streaming union bound to an operation output (an incoming event stream) is realized + // via the generated handler; nothing references the union as a data type, so it must not be + // emitted as a standalone sub-object header. + Model model = eventStreamEmptyAndDataModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + assertFalse(classified.subObjects().stream() + .anyMatch(s -> s.getId().getName().equals("SelectEventStream")), + "incoming event-stream union dropped from subObjects: " + classified.subObjects()); + } + @Test void classifiesEnumShape() { // StringShape with @enum trait -> classified as enum From c4991fac8a9be601c1fae716acb667beee9197c3 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 31 Aug 2026 15:08:43 -0400 Subject: [PATCH 29/53] Smithy: restore S3 request AddQueryStringParameters and HasEmbeddedError methods - injectAccessLogTagQuery: mark customizedAccessLogTag @httpQueryParams so RestXml emits AddQueryStringParameters (was missing on 110 requests) - new EmbeddedErrorsTrait + S3Transforms.markEmbeddedErrors (C2J functionsWithEmbeddedErrors set) + RestXmlProtocolTraits emits HasEmbeddedError under the marker (was missing on 92 requests) --- .../model/protocol/ProtocolTraits.java | 22 ++++++ .../model/protocol/RestXmlProtocolTraits.java | 9 +++ .../model/transforms/EmbeddedErrorsTrait.java | 26 +++++++ .../model/transforms/S3Transforms.java | 68 ++++++++++++++++++- .../model/protocol/XmlProtocolTraitsTest.java | 29 ++++++++ .../model/transforms/S3TransformsTest.java | 24 +++++++ 6 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index d7002148dc0..001020ce84d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -190,6 +190,28 @@ default void writeGetRequestSpecificHeadersImpl(CppWriter writer, String classNa }); } + /** + * Declares the {@code HasEmbeddedError} override C2J emits under + * {@code #if($shape.hasEmbeddedErrors())} in {@code RequestHeader.vm}. Text matches C2J exactly + * (unqualified {@code IOStream} / {@code Http::HeaderValueCollection}, resolved via the request + * header's {@code Aws} usings). Only S3 requests carry {@code EmbeddedErrorsTrait}, so the + * caller gates emission on that marker. + */ + default void writeHasEmbeddedErrorDecl(CppWriter writer, String exportMacro) { + writer.write("$L bool HasEmbeddedError(IOStream &body, " + + "const Http::HeaderValueCollection &header) const override;", exportMacro); + } + + /** + * Emits a stubbed {@code HasEmbeddedError} body. The real XML error-sniff is a serde concern + * deferred plugin-wide; returning {@code false} with unnamed params keeps the override present + * (byte-parity for the request header) without tripping {@code -Werror} on unused parameters. + */ + default void writeHasEmbeddedErrorImpl(CppWriter writer, String className) { + writer.write("bool $L::HasEmbeddedError(Aws::IOStream&, " + + "const Aws::Http::HeaderValueCollection&) const { return false; }", className); + } + default void writeAddQueryStringParametersImpl(CppWriter writer, String className) { writer.openBlock("void $L::AddQueryStringParameters(Aws::Http::URI& uri) const {", "}", className, () -> { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index 4eda33f32fd..54b03cf52ac 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -6,6 +6,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.EmbeddedErrorsTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -148,6 +149,10 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, writer.write(""); writeAddQueryStringParametersDecl(writer, exportMacro); } + if (shape.hasTrait(EmbeddedErrorsTrait.class)) { + writer.write(""); + writeHasEmbeddedErrorDecl(writer, exportMacro); + } } @Override @@ -165,5 +170,9 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className); } + if (shape.hasTrait(EmbeddedErrorsTrait.class)) { + writer.write(""); + writeHasEmbeddedErrorImpl(writer, className); + } } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java new file mode 100644 index 00000000000..51fba711240 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java @@ -0,0 +1,26 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 + * request structure that C2J's {@code S3RestXmlCppClientGenerator} lists in its hardcoded + * {@code functionsWithEmbeddedErrors} set ({@code shape.setEmbeddedErrors(true)}). REST-XML request + * rendering turns the marker into the {@code HasEmbeddedError(IOStream&, HeaderValueCollection&)} + * override that {@code RequestHeader.vm} emits under {@code #if($shape.hasEmbeddedErrors())}, so + * these S3 requests match C2J. Kept as a marker + generic renderer rule (not a service-name + * {@code if}) so the renderer stays service-agnostic; only S3 requests ever carry it. + */ +public final class EmbeddedErrorsTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#embeddedErrors"); + + public EmbeddedErrorsTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 1c3aa9c7993..6597d5f5924 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -24,6 +24,7 @@ import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.HttpHeaderTrait; +import software.amazon.smithy.model.traits.HttpQueryParamsTrait; import software.amazon.smithy.model.traits.UnitTypeTrait; import software.amazon.smithy.model.transform.ModelTransformer; import java.util.ArrayList; @@ -55,8 +56,67 @@ private static Model apply(Model model, ServiceShape service) { if (!"s3".equals(name) && !"s3-crt".equals(name)) { return model; } - return injectAccessLogTagQuery(normalizeReplicationStatus(expandBucketLocationConstraint( - hackGetObjectResult(addExpiresCustomization(renameCopyObjectResult(model, service), service)))), service); + return markEmbeddedErrors(injectAccessLogTagQuery(normalizeReplicationStatus( + expandBucketLocationConstraint(hackGetObjectResult( + addExpiresCustomization(renameCopyObjectResult(model, service), service)))), service)); + } + + // C2J's S3RestXmlCppClientGenerator carries a hardcoded functionsWithEmbeddedErrors set; each + // listed request shape gets shape.setEmbeddedErrors(true), which RequestHeader.vm turns into the + // HasEmbeddedError(...) override. Mirror that by stamping EmbeddedErrorsTrait on every request + // structure whose simple name is in the set; REST-XML request rendering emits the method for + // marker-bearing shapes. The lone C2J typo entry (DeleteBucketAnaxlyticsConfigurationRequest) + // is kept verbatim so the set matches C2J exactly; it simply never matches a real shape. + private static final Set EMBEDDED_ERROR_REQUESTS = Set.of( + "AbortMultipartUploadRequest", "CompleteMultipartUploadRequest", "CopyObjectRequest", + "CreateBucketRequest", "CreateMultipartUploadRequest", "CreateSessionRequest", + "DeleteBucketAnaxlyticsConfigurationRequest", "DeleteBucketCorsRequest", + "DeleteBucketEncryptionRequest", "DeleteBucketIntelligentTieringConfigurationRequest", + "DeleteBucketInventoryConfigurationRequest", "DeleteBucketLifecycleRequest", + "DeleteBucketMetricsConfigurationRequest", "DeleteBucketOwnershipControlsRequest", + "DeleteBucketPolicyRequest", "DeleteBucketReplicationRequest", "DeleteBucketRequest", + "DeleteBucketTaggingRequest", "DeleteBucketWebsiteRequest", "DeleteObjectRequest", + "DeleteObjectsRequest", "DeleteObjectTaggingRequest", "DeletePublicAccessBlockRequest", + "GetBucketAccelerateConfigurationRequest", "GetBucketAclRequest", + "GetBucketAnalyticsConfigurationRequest", "GetBucketCorsRequest", "GetBucketEncryptionRequest", + "GetBucketIntelligentTieringConfigurationRequest", "GetBucketInventoryConfigurationRequest", + "GetBucketLifecycleConfigurationRequest", "GetBucketLocationRequest", "GetBucketLoggingRequest", + "GetBucketMetricsConfigurationRequest", "GetBucketNotificationConfigurationRequest", + "GetBucketOwnershipControlsRequest", "GetBucketPolicyRequest", "GetBucketPolicyStatusRequest", + "GetBucketReplicationRequest", "GetBucketRequestPaymentRequest", "GetBucketTaggingRequest", + "GetBucketVersioningRequest", "GetBucketWebsiteRequest", "GetObjectAclRequest", + "GetObjectAttributesRequest", "GetObjectLegalHoldRequest", "GetObjectLockConfigurationRequest", + "GetObjectRetentionRequest", "GetObjectTaggingRequest", "GetPublicAccessBlockRequest", + "HeadBucketRequest", "HeadObjectRequest", "ListBucketAnalyticsConfigurationsRequest", + "ListBucketIntelligentTieringConfigurationsRequest", "ListBucketInventoryConfigurationsRequest", + "ListBucketMetricsConfigurationsRequest", "ListBucketsRequest", "ListDirectoryBucketsRequest", + "ListMultipartUploadsRequest", "ListObjectsRequest", "ListObjectsV2Request", + "ListObjectVersionsRequest", "ListPartsRequest", + "PutBucketAccelerateConfigurationRequest", "PutBucketAclRequest", + "PutBucketAnalyticsConfigurationRequest", "PutBucketCorsRequest", "PutBucketEncryptionRequest", + "PutBucketIntelligentTieringConfigurationRequest", "PutBucketInventoryConfigurationRequest", + "PutBucketLifecycleConfigurationRequest", "PutBucketLoggingRequest", + "PutBucketMetricsConfigurationRequest", "PutBucketNotificationConfigurationRequest", + "PutBucketOwnershipControlsRequest", "PutBucketPolicyRequest", "PutBucketReplicationRequest", + "PutBucketRequestPaymentRequest", "PutBucketTaggingRequest", "PutBucketVersioningRequest", + "PutBucketWebsiteRequest", "PutObjectAclRequest", "PutObjectLegalHoldRequest", + "PutObjectLockConfigurationRequest", "PutObjectRequest", "PutObjectRetentionRequest", + "PutObjectTaggingRequest", "PutPublicAccessBlockRequest", "RestoreObjectRequest", + "SelectObjectContentRequest", "UploadPartCopyRequest", "UploadPartRequest", + "WriteGetObjectResponseRequest"); + + private static Model markEmbeddedErrors(Model model) { + List marked = new ArrayList<>(); + for (StructureShape shape : model.shapes(StructureShape.class).toList()) { + if (EMBEDDED_ERROR_REQUESTS.contains(shape.getId().getName()) + && !shape.hasTrait(EmbeddedErrorsTrait.class)) { + marked.add(shape.toBuilder().addTrait(new EmbeddedErrorsTrait()).build()); + } + } + if (marked.isEmpty()) { + return model; // no request shape from the set is present (idempotent / other model). + } + return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); } // C2J's S3RestXmlCppClientGenerator appends a `customizedAccessLogTag` map member @@ -90,6 +150,10 @@ private static Model injectAccessLogTagQuery(Model model, ServiceShape service) .addMember(MemberShape.builder() .id(req.getId().withMember("customizedAccessLogTag")) .target(mapId) + // @httpQueryParams binds this map to the query string. C2J models it as a + // querystring member on every request, which is what makes every request emit + // AddQueryStringParameters; the trait drives RequestBindings.hasQueryStringMembers. + .addTrait(new HttpQueryParamsTrait()) .build()) .build()); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index dc04e36ef50..e0b90ce6e8a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -235,6 +235,35 @@ void restXml_withQueryMember_emitsAddQueryStringParameters() { assertTrue(d.contains("void AddQueryStringParameters(Aws::Http::URI& uri) const override;"), d); } + private static software.amazon.smithy.model.shapes.StructureShape reqWithEmbeddedErrors() { + return software.amazon.smithy.model.shapes.StructureShape.builder() + .id("com.example#DoThingRequest") + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms + .EmbeddedErrorsTrait()) + .build(); + } + + @Test + void restXml_withEmbeddedErrorsTrait_emitsHasEmbeddedError() { + var req = reqWithEmbeddedErrors(); var model = modelWith(req); + ProtocolTraits xml = new RestXmlProtocolTraits(); + String d = render(w -> xml.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); + assertTrue(d.contains("AWS_EX_API bool HasEmbeddedError(IOStream &body, " + + "const Http::HeaderValueCollection &header) const override;"), d); + String i = render(w -> xml.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains("bool DoThingRequest::HasEmbeddedError("), i); + } + + @Test + void restXml_withoutEmbeddedErrorsTrait_omitsHasEmbeddedError() { + var req = reqWith(false, false); var model = modelWith(req); + ProtocolTraits xml = new RestXmlProtocolTraits(); + String d = render(w -> xml.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); + assertFalse(d.contains("HasEmbeddedError"), d); + String i = render(w -> xml.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertFalse(i.contains("HasEmbeddedError"), i); + } + // ---------- Query/EC2 request contract (Axis-1 gating + protected DumpBodyToUrl) ---------- @Test diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index ecaeda4b691..c7c4902f858 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -309,6 +309,12 @@ void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { assertEquals("smithy.api#String", mapShape.getKey().getTarget().toString()); assertEquals("smithy.api#String", mapShape.getValue().getTarget().toString()); + // Must bind to the query string (@httpQueryParams) so RequestBindings.hasQueryStringMembers + // is true and the request emits AddQueryStringParameters — matching C2J, which renders that + // method on every request via the customizedAccessLogTag querystring member. + assertTrue(tag.hasTrait(software.amazon.smithy.model.traits.HttpQueryParamsTrait.class), + "customizedAccessLogTag must carry @httpQueryParams"); + // Appended after all existing members, preserving prior order. java.util.List order = new java.util.ArrayList<>(input.getAllMembers().keySet()); assertEquals(java.util.List.of("Bucket", "Key", "customizedAccessLogTag"), order, @@ -325,6 +331,24 @@ void doesNotInjectCustomizedAccessLogTagIntoOutput() { "output shape must not gain the access-log tag member"); } + @Test + void stampsEmbeddedErrorsTraitOnRequestInC2jSet() { + ServiceShape svc = s3Service("S3"); + StructureShape inSet = StructureShape.builder().id(NS + "#CreateSessionRequest") + .addMember("Bucket", ShapeId.from("smithy.api#String")).build(); + StructureShape notInSet = StructureShape.builder().id(NS + "#SomeOtherRequest") + .addMember("Bucket", ShapeId.from("smithy.api#String")).build(); + Model m = modelWith(svc, inSet, notInSet); + Model out = S3Transforms.asTransform().apply(m, svc); + + StructureShape marked = out.expectShape(ShapeId.from(NS + "#CreateSessionRequest"), StructureShape.class); + assertTrue(marked.hasTrait(EmbeddedErrorsTrait.class), + "request in the C2J functionsWithEmbeddedErrors set must be marked"); + StructureShape unmarked = out.expectShape(ShapeId.from(NS + "#SomeOtherRequest"), StructureShape.class); + assertFalse(unmarked.hasTrait(EmbeddedErrorsTrait.class), + "request not in the set must not be marked"); + } + @Test void accessLogTagInjectionIsIdempotent() { Model m = accessLogModel(); From 1ddfb2deb1fc1410bc5537f06e106a5830b0113a Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 31 Aug 2026 15:22:26 -0400 Subject: [PATCH 30/53] Smithy: emit real (constant) HasEmbeddedError body instead of stub The XML error-sniff body is constant (not shape-dependent) across C2J's S3 request-source templates, so there is nothing to defer. Move the HasEmbeddedError helpers out of the base ProtocolTraits (they leaked XML parsing into every protocol) into RestXmlProtocolTraits, where the marker is the only emit site, and emit the real parse-body / root-is- logic. --- .../model/protocol/ProtocolTraits.java | 22 --------------- .../model/protocol/RestXmlProtocolTraits.java | 28 +++++++++++++++++++ .../model/protocol/XmlProtocolTraitsTest.java | 5 ++++ 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index 001020ce84d..d7002148dc0 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -190,28 +190,6 @@ default void writeGetRequestSpecificHeadersImpl(CppWriter writer, String classNa }); } - /** - * Declares the {@code HasEmbeddedError} override C2J emits under - * {@code #if($shape.hasEmbeddedErrors())} in {@code RequestHeader.vm}. Text matches C2J exactly - * (unqualified {@code IOStream} / {@code Http::HeaderValueCollection}, resolved via the request - * header's {@code Aws} usings). Only S3 requests carry {@code EmbeddedErrorsTrait}, so the - * caller gates emission on that marker. - */ - default void writeHasEmbeddedErrorDecl(CppWriter writer, String exportMacro) { - writer.write("$L bool HasEmbeddedError(IOStream &body, " - + "const Http::HeaderValueCollection &header) const override;", exportMacro); - } - - /** - * Emits a stubbed {@code HasEmbeddedError} body. The real XML error-sniff is a serde concern - * deferred plugin-wide; returning {@code false} with unnamed params keeps the override present - * (byte-parity for the request header) without tripping {@code -Werror} on unused parameters. - */ - default void writeHasEmbeddedErrorImpl(CppWriter writer, String className) { - writer.write("bool $L::HasEmbeddedError(Aws::IOStream&, " - + "const Aws::Http::HeaderValueCollection&) const { return false; }", className); - } - default void writeAddQueryStringParametersImpl(CppWriter writer, String className) { writer.openBlock("void $L::AddQueryStringParameters(Aws::Http::URI& uri) const {", "}", className, () -> { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index 54b03cf52ac..7291f863b79 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -175,4 +175,32 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writeHasEmbeddedErrorImpl(writer, className); } } + + // C2J RequestHeader.vm decl: unqualified IOStream / Http::HeaderValueCollection, resolved via the + // request header's Aws usings. Only S3 requests carry EmbeddedErrorsTrait, so the caller gates. + private void writeHasEmbeddedErrorDecl(CppWriter writer, String exportMacro) { + writer.write("$L bool HasEmbeddedError(IOStream &body, " + + "const Http::HeaderValueCollection &header) const override;", exportMacro); + } + + // Constant XML error-sniff body, identical across C2J's S3 request-source templates + // (XmlRequestSource / StreamRequestSource / PutBucketNotificationConfigurationRequest): parse the + // response body as XML and report an embedded error when the root element is . It is not + // shape-dependent, so there is nothing to defer. XmlSerializer.h + UnreferencedParam.h and the + // Aws::Utils::Xml / Aws::Utils usings are already in the REQUEST_SOURCE serde includes/usings. + private void writeHasEmbeddedErrorImpl(CppWriter writer, String className) { + writer.openBlock("bool $L::HasEmbeddedError(Aws::IOStream& body, " + + "const Aws::Http::HeaderValueCollection& header) const {", "}", className, () -> { + writer.write("AWS_UNREFERENCED_PARAM(header);"); + writer.write("auto readPointer = body.tellg();"); + writer.write("Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body);"); + writer.write("body.seekg(readPointer);"); + writer.openBlock("if (!doc.WasParseSuccessful()) {", "}", + () -> writer.write("return false;")); + writer.openBlock("if (!doc.GetRootElement().IsNull() " + + "&& doc.GetRootElement().GetName() == Aws::String(\"Error\")) {", "}", + () -> writer.write("return true;")); + writer.write("return false;"); + }); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index e0b90ce6e8a..31336b33e23 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -251,7 +251,12 @@ void restXml_withEmbeddedErrorsTrait_emitsHasEmbeddedError() { assertTrue(d.contains("AWS_EX_API bool HasEmbeddedError(IOStream &body, " + "const Http::HeaderValueCollection &header) const override;"), d); String i = render(w -> xml.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + // The impl is the real constant XML error-sniff body (not a stub) — matches C2J's S3 + // request-source templates: parse the body and report true iff the root element is . assertTrue(i.contains("bool DoThingRequest::HasEmbeddedError("), i); + assertTrue(i.contains("XmlDocument doc = XmlDocument::CreateFromXmlStream(body);"), i); + assertTrue(i.contains("doc.GetRootElement().GetName() == Aws::String(\"Error\")"), i); + assertFalse(i.contains("return false; }"), "impl must not be the one-line stub"); } @Test From d1b2f2e1ba6a84b0c47f27b4f9b4d677588795d5 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 31 Aug 2026 16:13:10 -0400 Subject: [PATCH 31/53] Smithy: S3Transforms retypes PartNumberMarker/NextPartNumberMarker back to int --- .../model/transforms/S3Transforms.java | 31 ++++++++++++- .../model/transforms/S3TransformsTest.java | 43 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 6597d5f5924..83a7bc09fff 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -12,6 +12,7 @@ import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.EnumShape; +import software.amazon.smithy.model.shapes.IntegerShape; import software.amazon.smithy.model.shapes.MapShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; @@ -58,7 +59,8 @@ private static Model apply(Model model, ServiceShape service) { } return markEmbeddedErrors(injectAccessLogTagQuery(normalizeReplicationStatus( expandBucketLocationConstraint(hackGetObjectResult( - addExpiresCustomization(renameCopyObjectResult(model, service), service)))), service)); + addExpiresCustomization(renameCopyObjectResult( + retypePartNumberMarkersToInteger(model), service), service)))), service)); } // C2J's S3RestXmlCppClientGenerator carries a hardcoded functionsWithEmbeddedErrors set; each @@ -331,6 +333,33 @@ private static Model addExpiresCustomization(Model model, ServiceShape service) return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } + // Both request and result on ListParts / GetObjectAttributes reference these two shapes. C2J models + // them as integers, so the shipped SDK exposes int accessors. Coral2Smithy's S3ShapeMutatorTransformer + // instead treats them as opaque pagination tokens: it leaves PartNumberMarker as Coral's string and + // retypes NextPartNumberMarker to string. Retype both back to integer here to preserve the C2J public + // API (int, not Aws::String). The paginator generator is a separate plugin that never sees this + // mutation; it keeps its own NUMERIC_TOKEN_OVERRIDES entry so its `!= 0` check matches the int result. + private static final List PART_NUMBER_MARKER_SHAPES = + List.of("PartNumberMarker", "NextPartNumberMarker"); + + private static Model retypePartNumberMarkersToInteger(Model model) { + String ns = "com.amazonaws.s3"; + List replacements = new ArrayList<>(); + for (String name : PART_NUMBER_MARKER_SHAPES) { + Shape existing = model.getShape(ShapeId.fromParts(ns, name)).orElse(null); + // absent or already integer: nothing to retype (idempotent / other model). + if (existing != null && !(existing instanceof IntegerShape)) { + IntegerShape.Builder b = IntegerShape.builder().id(existing.getId()); + existing.getAllTraits().values().forEach(b::addTrait); + replacements.add(b.build()); + } + } + if (replacements.isEmpty()) { + return model; + } + return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); + } + private static Model retypeExpiresToTimestamp(Model model, String ns) { ShapeId expiresId = ShapeId.fromParts(ns, "Expires"); Shape existing = model.getShape(expiresId).orElse(null); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index c7c4902f858..8b85e34a6b3 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.IntegerShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -147,6 +148,48 @@ void retypesExpiresShapeToTimestamp() { assertTrue(out.expectShape(output.getMember("Expires").orElseThrow().getTarget()) instanceof TimestampShape); } + /** + * Builds an S3 model with a ListParts-style operation whose request and result reference the + * {@code PartNumberMarker} / {@code NextPartNumberMarker} shapes as strings (matching the current + * Smithy model, where Coral2Smithy treats them as opaque pagination tokens). + */ + private static Model partNumberMarkerModel() { + Shape marker = StringShape.builder().id(NS + "#PartNumberMarker").build(); + Shape nextMarker = StringShape.builder().id(NS + "#NextPartNumberMarker").build(); + StructureShape input = StructureShape.builder().id(NS + "#ListPartsRequest") + .addMember("PartNumberMarker", marker.getId()).build(); + StructureShape output = StructureShape.builder().id(NS + "#ListPartsOutput") + .addMember("PartNumberMarker", marker.getId()) + .addMember("NextPartNumberMarker", nextMarker.getId()).build(); + OperationShape op = OperationShape.builder().id(NS + "#ListParts") + .input(input.getId()).output(output.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId("S3").arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(marker, nextMarker, input, output, op, svc).assemble().unwrap(); + } + + @Test + void retypesPartNumberMarkersToInteger() { + Model m = partNumberMarkerModel(); + assertTrue(m.expectShape(ShapeId.from(NS + "#PartNumberMarker")).isStringShape(), + "precondition: PartNumberMarker starts as a string"); + assertTrue(m.expectShape(ShapeId.from(NS + "#NextPartNumberMarker")).isStringShape(), + "precondition: NextPartNumberMarker starts as a string"); + ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); + Model out = S3Transforms.asTransform().apply(m, svc); + assertTrue(out.expectShape(ShapeId.from(NS + "#PartNumberMarker")) instanceof IntegerShape, + "PartNumberMarker retyped to integer to preserve the shipped C2J int API"); + assertTrue(out.expectShape(ShapeId.from(NS + "#NextPartNumberMarker")) instanceof IntegerShape, + "NextPartNumberMarker retyped to integer to preserve the shipped C2J int API"); + // Request and result members both now resolve to integer targets. + StructureShape input = out.expectShape(ShapeId.from(NS + "#ListPartsRequest"), StructureShape.class); + StructureShape output = out.expectShape(ShapeId.from(NS + "#ListPartsOutput"), StructureShape.class); + assertTrue(out.expectShape(input.getMember("PartNumberMarker").orElseThrow().getTarget()) instanceof IntegerShape); + assertTrue(out.expectShape(output.getMember("NextPartNumberMarker").orElseThrow().getTarget()) instanceof IntegerShape); + } + @Test void addsExpiresStringToOutputAndDeprecatesExpires() { Model m = expiresModel(); From 47eeef6d15e763c32ba795bf689c9a38a36b3a0a Mon Sep 17 00:00:00 2001 From: sbaluja Date: Mon, 31 Aug 2026 16:43:06 -0400 Subject: [PATCH 32/53] Smithy: S3Transforms ports IsStreaming override and checksum-member setter customizations --- .../generators/model/MemberRenderer.java | 12 +++ .../model/renderers/RequestRenderer.java | 7 ++ .../model/transforms/ChecksumMemberTrait.java | 27 +++++++ .../transforms/OverrideStreamingTrait.java | 27 +++++++ .../model/transforms/S3Transforms.java | 74 ++++++++++++++++++- .../model/MemberRendererOutputTest.java | 40 ++++++++++ .../generators/model/RequestRendererTest.java | 50 +++++++++++++ .../model/transforms/S3TransformsTest.java | 73 ++++++++++++++++++ 8 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java index fb130f6ae65..72bdf30ea40 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java @@ -7,6 +7,7 @@ import static com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper.isPrimitive; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChecksumMemberTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ListShape; @@ -124,6 +125,9 @@ public void renderPublicAccessors(CppWriter writer) { writer.write("return *this;"); }); } else { + // S3 checksum members (stamped by S3Transforms) also select the ChecksumAlgorithm enum + // in their setter, matching C2J's ModelClassMembersAndInlines.vm isChecksumMember path. + java.util.Optional checksum = member.getTrait(ChecksumMemberTrait.class); writer.write("template ", templateParam, cppType); writer.openBlock("void Set$L($L&& value) {", "}", methodName, templateParam, () -> { writer.write("$LHasBeenSet = true;", fieldName); @@ -136,7 +140,15 @@ public void renderPublicAccessors(CppWriter writer) { } else { writer.write("$L = std::forward<$L>(value);", fieldName, templateParam); } + checksum.ifPresent(t -> + writer.write("SetChecksumAlgorithm(ChecksumAlgorithm::$L);", t.getValue())); }); + checksum.ifPresent(t -> + writer.openBlock("inline void Set$L(const char* value) {", "}", methodName, () -> { + writer.write("$LHasBeenSet = true;", fieldName); + writer.write("$L.assign(value);", fieldName); + writer.write("SetChecksumAlgorithm(ChecksumAlgorithm::$L);", t.getValue()); + })); writer.write("template ", templateParam, cppType); writer.openBlock("$L& With$L($L&& value) {", "}", className, methodName, templateParam, () -> { writer.write("Set$L(std::forward<$L>(value));", methodName, templateParam); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 8622fafc506..1189ffffa7e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -14,6 +14,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.RequestInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.SmithyEndpointsJmesPathVisitor; import software.amazon.smithy.jmespath.JmespathExpression; @@ -155,6 +156,12 @@ private void renderHeader(CppWriterDelegator writerDelegator, renderContentMd5Decl(writer, operation); renderRequestCompressionDecl(writer, operation); + // S3 flips a couple of streaming-base requests back to non-streaming (C2J + // isOverrideStreaming); the marker is stamped by S3Transforms. + if (shape.hasTrait(OverrideStreamingTrait.class)) { + writer.write("$L bool IsStreaming() const override { return false; }", ctx.exportMacro()); + } + if (streamingResponse) { String handlerType = operation.getId().getName() + "Handler"; writer.write(""); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java new file mode 100644 index 00000000000..a0bd440e336 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java @@ -0,0 +1,27 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.SourceLocation; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.StringTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 request + * member that C2J's {@code S3RestXmlCppClientGenerator} flags via {@code member.setChecksumMember(true)} + * + {@code member.setChecksumEnumMember(...)} — the {@code ChecksumCRC32}/{@code ChecksumSHA256}/etc. + * members of any request that also carries a {@code ChecksumAlgorithm} member. The stored value is the + * matching {@code ChecksumAlgorithm} enum constant (e.g. {@code CRC32}). Member rendering turns the + * marker into the C2J {@code ModelClassMembersAndInlines.vm} behavior: each setter also calls + * {@code SetChecksumAlgorithm(ChecksumAlgorithm::)}, plus a {@code const char*} overload that does + * the same. Kept as a marker + generic renderer rule so the member renderer stays service-agnostic. + */ +public final class ChecksumMemberTrait extends StringTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#checksumMember"); + + public ChecksumMemberTrait(String algorithmEnum) { + super(ID, algorithmEnum, SourceLocation.NONE); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java new file mode 100644 index 00000000000..dee0eebb12b --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java @@ -0,0 +1,27 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 + * request structure that C2J's {@code S3RestXmlCppClientGenerator} lists in its + * {@code REQUESTS_TO_OVERRIDE_STREAMING} set ({@code shape.setOverrideStreaming(true)}). These + * requests derive from {@code StreamingS3Request} (a typedef for {@code AmazonStreamingWebServiceRequest}, + * whose {@code IsStreaming()} returns {@code true}) yet must report non-streaming, so request rendering + * turns the marker into the {@code bool IsStreaming() const override { return false; }} override that + * {@code RequestHeader.vm} emits under {@code #if($shape.isOverrideStreaming())}. Kept as a marker + + * generic renderer rule (not a service-name {@code if}) so the renderer stays service-agnostic. + */ +public final class OverrideStreamingTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#overrideStreaming"); + + public OverrideStreamingTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 83a7bc09fff..152635b1050 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -57,10 +57,82 @@ private static Model apply(Model model, ServiceShape service) { if (!"s3".equals(name) && !"s3-crt".equals(name)) { return model; } - return markEmbeddedErrors(injectAccessLogTagQuery(normalizeReplicationStatus( + Model result = markEmbeddedErrors(injectAccessLogTagQuery(normalizeReplicationStatus( expandBucketLocationConstraint(hackGetObjectResult( addExpiresCustomization(renameCopyObjectResult( retypePartNumberMarkersToInteger(model), service), service)))), service)); + result = markOverrideStreaming(result); + return markChecksumMembers(result, service); + } + + // C2J's S3RestXmlCppClientGenerator flips these two requests' isOverrideStreaming on. Both derive + // from StreamingS3Request (== AmazonStreamingWebServiceRequest, whose IsStreaming() returns true), + // so they must override IsStreaming() back to false; RequestRenderer emits that for marked shapes. + private static final Set REQUESTS_TO_OVERRIDE_STREAMING = Set.of( + "PutBucketPolicyRequest", "PutObjectAnnotationRequest"); + + private static Model markOverrideStreaming(Model model) { + List marked = new ArrayList<>(); + for (StructureShape shape : model.shapes(StructureShape.class).toList()) { + if (REQUESTS_TO_OVERRIDE_STREAMING.contains(shape.getId().getName()) + && !shape.hasTrait(OverrideStreamingTrait.class)) { + marked.add(shape.toBuilder().addTrait(new OverrideStreamingTrait()).build()); + } + } + if (marked.isEmpty()) { + return model; // neither request is present (idempotent / other model). + } + return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); + } + + // C2J's S3RestXmlCppClientGenerator maps each checksum member shape name to its ChecksumAlgorithm + // enum constant; every request that also carries a ChecksumAlgorithm member gets these members + // flagged so their setters also call SetChecksumAlgorithm(...). ChecksumCRC64NVME is intentionally + // absent (C2J never listed it), so it keeps a plain setter. + private static final Map CHECKSUM_MEMBERS_ENUMS = Map.ofEntries( + Map.entry("ChecksumCRC32", "CRC32"), + Map.entry("ChecksumCRC32C", "CRC32C"), + Map.entry("ChecksumSHA1", "SHA1"), + Map.entry("ChecksumSHA256", "SHA256"), + Map.entry("ChecksumSHA512", "SHA512"), + Map.entry("ChecksumXXHASH64", "XXHASH64"), + Map.entry("ChecksumXXHASH3", "XXHASH3"), + Map.entry("ChecksumXXHASH128", "XXHASH128"), + Map.entry("ChecksumMD5", "MD5")); + + private static Model markChecksumMembers(Model model, ServiceShape service) { + Set inputShapes = TopDownIndex.of(model).getContainedOperations(service).stream() + .map(OperationShape::getInputShape) + .filter(id -> !id.equals(UnitTypeTrait.UNIT)) + .collect(Collectors.toSet()); + List replacements = new ArrayList<>(); + for (StructureShape req : model.shapes(StructureShape.class).toList()) { + // Only request shapes that already carry a ChecksumAlgorithm member (so SetChecksumAlgorithm + // exists), and only when they hold at least one not-yet-marked checksum member. + boolean isChecksumRequest = inputShapes.contains(req.getId()) + && req.getMember("ChecksumAlgorithm").isPresent(); + boolean needsStamp = isChecksumRequest && req.getAllMembers().values().stream().anyMatch(m -> + CHECKSUM_MEMBERS_ENUMS.containsKey(m.getTarget().getName()) + && !m.hasTrait(ChecksumMemberTrait.class)); + if (needsStamp) { + StructureShape.Builder b = StructureShape.builder().id(req.getId()); + req.getAllTraits().values().forEach(b::addTrait); + for (MemberShape m : req.getAllMembers().values()) { + String enumValue = CHECKSUM_MEMBERS_ENUMS.get(m.getTarget().getName()); + b.addMember(m.getMemberName(), m.getTarget(), mb -> { + m.getAllTraits().values().forEach(mb::addTrait); + if (enumValue != null && !m.hasTrait(ChecksumMemberTrait.class)) { + mb.addTrait(new ChecksumMemberTrait(enumValue)); + } + }); + } + replacements.add(b.build()); + } + } + if (replacements.isEmpty()) { + return model; // no qualifying request (idempotent / other model). + } + return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } // C2J's S3RestXmlCppClientGenerator carries a hardcoded functionsWithEmbeddedErrors set; each diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java index 8eafddf2c4d..7925f00304e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java @@ -5,6 +5,7 @@ package com.amazonaws.util.awsclientsmithygenerator.generators.model; import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChecksumMemberTrait; import org.junit.jupiter.api.Test; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.*; @@ -73,6 +74,45 @@ void fullOutput_matchesExpectedPattern() { assertTrue(privOutput.contains("bool m_hashKeyRangeHasBeenSet = false;")); } + @Test + void checksumMember_setterAlsoSelectsAlgorithm_andEmitsConstCharOverload() { + // C2J ModelClassMembersAndInlines.vm isChecksumMember path: each checksum setter also calls + // SetChecksumAlgorithm(ChecksumAlgorithm::), and a const char* overload does the same. + StringShape str = StringShape.builder().id("com.example#ChecksumCRC32").build(); + StructureShape shape = StructureShape.builder() + .id("com.example#PutObjectRequest") + .addMember("ChecksumCRC32", str.getId(), b -> b.addTrait(new ChecksumMemberTrait("CRC32"))) + .build(); + Model model = Model.builder().addShapes(str, shape).build(); + + CppWriter w = new CppWriter(); + MemberRenderer.forStructure(model, shape, "PutObjectRequest").renderPublicAccessors(w); + String out = w.toString(); + + assertTrue(out.contains("void SetChecksumCRC32(ChecksumCRC32T&& value)"), out); + assertTrue(out.contains("m_checksumCRC32 = std::forward(value);"), out); + assertTrue(out.contains("SetChecksumAlgorithm(ChecksumAlgorithm::CRC32);"), out); + assertTrue(out.contains("inline void SetChecksumCRC32(const char* value) {"), out); + assertTrue(out.contains("m_checksumCRC32.assign(value);"), out); + } + + @Test + void nonChecksumStringMember_hasNoAlgorithmSideEffectOrConstCharOverload() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape shape = StructureShape.builder() + .id("com.example#PutObjectRequest") + .addMember("Key", str.getId()) + .build(); + Model model = Model.builder().addShapes(str, shape).build(); + + CppWriter w = new CppWriter(); + MemberRenderer.forStructure(model, shape, "PutObjectRequest").renderPublicAccessors(w); + String out = w.toString(); + + assertFalse(out.contains("SetChecksumAlgorithm"), out); + assertFalse(out.contains("const char* value"), out); + } + @Test void sparseListAndMap_emitOptionalTypesAndAddOverloads() { // Mirrors C2J's generated SparseNullsOperationRequest.h: a @sparse list/map wraps its diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index aa52eca9798..23127963a4e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -8,6 +8,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; import org.junit.jupiter.api.Test; import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; @@ -92,6 +93,55 @@ private static String renderStreamingOp(boolean inputStreams, boolean outputStre .orElseThrow(); } + private static Model overrideStreamingModel(boolean marked) { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape.Builder inB = StructureShape.builder() + .id("com.example#DoThingRequest").addMember("name", str.getId()); + if (marked) { + inB.addTrait(new OverrideStreamingTrait()); + } + StructureShape input = inB.build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + private static String renderDoThingRequestHeader(Model model) { + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + Protocol protocol = ProtocolResolver.resolve(service, model); + RequestRenderer renderer = new RequestRenderer( + ShapeClassifier.classify(model, service, protocol).requests(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", "example")); + renderer.render(delegator); + delegator.flushWriters(); + return manifest.getFileString( + manifest.getFiles().stream() + .filter(p -> p.toString().endsWith("DoThingRequest.h")) + .findFirst().orElseThrow()) + .orElseThrow(); + } + + @Test + void overrideStreamingTrait_emitsIsStreamingFalse() { + String h = renderDoThingRequestHeader(overrideStreamingModel(true)); + assertTrue(h.contains("bool IsStreaming() const override { return false; }"), + "OverrideStreamingTrait must emit the non-streaming override: " + h); + } + + @Test + void withoutOverrideStreamingTrait_omitsIsStreaming() { + String h = renderDoThingRequestHeader(overrideStreamingModel(false)); + assertFalse(h.contains("IsStreaming"), + "unmarked requests must not emit IsStreaming: " + h); + } + @Test void streamingResponseRequest_hasEventStreamAugmentation() { // Model: operation with streaming OUTPUT only (like SubscribeToShard / ConverseStream) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 8b85e34a6b3..827178f250a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -190,6 +190,79 @@ void retypesPartNumberMarkersToInteger() { assertTrue(out.expectShape(output.getMember("NextPartNumberMarker").orElseThrow().getTarget()) instanceof IntegerShape); } + @Test + void marksOverrideStreamingRequests() { + StructureShape put = StructureShape.builder().id(NS + "#PutObjectAnnotationRequest").build(); + StructureShape policy = StructureShape.builder().id(NS + "#PutBucketPolicyRequest").build(); + StructureShape other = StructureShape.builder().id(NS + "#GetObjectRequest").build(); + ServiceShape svc = s3Service("S3"); + Model out = S3Transforms.asTransform().apply(modelWith(svc, put, policy, other), svc); + assertTrue(out.expectShape(put.getId()).hasTrait(OverrideStreamingTrait.class), + "PutObjectAnnotationRequest is in REQUESTS_TO_OVERRIDE_STREAMING"); + assertTrue(out.expectShape(policy.getId()).hasTrait(OverrideStreamingTrait.class), + "PutBucketPolicyRequest is in REQUESTS_TO_OVERRIDE_STREAMING"); + assertFalse(out.expectShape(other.getId()).hasTrait(OverrideStreamingTrait.class), + "other requests are untouched"); + } + + /** + * Builds an S3 model with a PutObject-style request carrying the checksum members plus a + * non-checksum member; {@code withAlgorithmMember} controls whether the request also has the + * {@code ChecksumAlgorithm} member that gates the C2J customization. + */ + private static Model checksumModel(boolean withAlgorithmMember) { + Shape crc32 = StringShape.builder().id(NS + "#ChecksumCRC32").build(); + Shape sha256 = StringShape.builder().id(NS + "#ChecksumSHA256").build(); + Shape crc64 = StringShape.builder().id(NS + "#ChecksumCRC64NVME").build(); + Shape algo = StringShape.builder().id(NS + "#ChecksumAlgorithm").build(); + Shape key = StringShape.builder().id(NS + "#ObjectKey").build(); + StructureShape.Builder reqB = StructureShape.builder().id(NS + "#PutObjectRequest") + .addMember("ChecksumCRC32", crc32.getId()) + .addMember("ChecksumSHA256", sha256.getId()) + .addMember("ChecksumCRC64NVME", crc64.getId()) + .addMember("Key", key.getId()); + if (withAlgorithmMember) { + reqB.addMember("ChecksumAlgorithm", algo.getId()); + } + StructureShape req = reqB.build(); + StructureShape output = StructureShape.builder().id(NS + "#PutObjectOutput").build(); + OperationShape op = OperationShape.builder().id(NS + "#PutObject") + .input(req.getId()).output(output.getId()).build(); + ServiceShape svc = ServiceShape.builder().id(NS + "#AmazonS3").version("2006-03-01") + .addTrait(ServiceTrait.builder().sdkId("S3").arnNamespace("s3") + .cloudFormationName("S3").cloudTrailEventSource("s3.amazonaws.com").build()) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(crc32, sha256, crc64, algo, key, req, output, op, svc) + .assemble().unwrap(); + } + + @Test + void marksChecksumMembersOnRequestWithChecksumAlgorithm() { + Model m = checksumModel(true); + ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); + Model out = S3Transforms.asTransform().apply(m, svc); + StructureShape req = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + assertEquals("CRC32", + req.getMember("ChecksumCRC32").orElseThrow().expectTrait(ChecksumMemberTrait.class).getValue()); + assertEquals("SHA256", + req.getMember("ChecksumSHA256").orElseThrow().expectTrait(ChecksumMemberTrait.class).getValue()); + // ChecksumCRC64NVME is intentionally absent from C2J's map — it keeps a plain setter. + assertFalse(req.getMember("ChecksumCRC64NVME").orElseThrow().hasTrait(ChecksumMemberTrait.class), + "CRC64NVME is not a C2J checksum member"); + assertFalse(req.getMember("Key").orElseThrow().hasTrait(ChecksumMemberTrait.class), + "non-checksum members are untouched"); + } + + @Test + void doesNotMarkChecksumMembersWithoutChecksumAlgorithm() { + Model m = checksumModel(false); + ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); + Model out = S3Transforms.asTransform().apply(m, svc); + StructureShape req = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + assertFalse(req.getMember("ChecksumCRC32").orElseThrow().hasTrait(ChecksumMemberTrait.class), + "no ChecksumAlgorithm member => C2J does not flag the checksum members"); + } + @Test void addsExpiresStringToOutputAndDeprecatesExpires() { Model m = expiresModel(); From 1affeec5b9bb43acc3daa6b121d453f315ff20d5 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Tue, 1 Sep 2026 11:51:21 -0400 Subject: [PATCH 33/53] Query string parameters and Request specific headers parity Smithy: drop dead CBOR HTTP-binding wiring and correct REQUEST_SOURCE includes Smithy: share RequestHeaderSerializer value expression across scalar and list paths Smithy: RPC protocols (awsJson, rpcv2-cbor) do not wire-serialize HTTP-binding members Smithy: query enums gate on HasBeenSet only (no NOT_SET), matching C2J Smithy: lowercase request header location names to match C2J Smithy: S3 customizedAccessLogTag x- query filter Smithy: dedupe RequestQuerySerializer timestamp stream expression Smithy: RequestQuerySerializer list and query-params-map serialization Smithy: RequestHeaderSerializer prefix-header map and list serialization Smithy: RequestHeaderSerializer scalar header-member serialization --- .../model/protocol/CborProtocolTraits.java | 21 +- .../model/protocol/JsonProtocolTraits.java | 31 +- .../model/protocol/ProtocolTraits.java | 38 ++- .../protocol/QueryXmlProtocolTraits.java | 15 +- .../model/protocol/RestXmlProtocolTraits.java | 24 +- .../renderers/RequestHeaderSerializer.java | 169 ++++++++++ .../renderers/RequestQuerySerializer.java | 187 +++++++++++ .../CustomizedAccessLogTagTrait.java | 28 ++ .../model/transforms/S3Transforms.java | 10 +- .../ProtocolTraitsCharacterizationTest.java | 11 +- .../protocol/CborProtocolTraitsTest.java | 21 ++ .../protocol/JsonProtocolTraitsTest.java | 34 +- .../RequestHeaderSerializerTest.java | 317 ++++++++++++++++++ .../renderers/RequestQuerySerializerTest.java | 268 +++++++++++++++ .../model/transforms/S3TransformsTest.java | 17 + 15 files changed, 1164 insertions(+), 27 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializerTest.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializerTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java index 8baef186b52..1a292aa8706 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java @@ -37,6 +37,12 @@ public boolean widensIntegers() { return true; } + @Override + public boolean serializesHttpBindingMembers() { + // rpcv2Cbor is an RPC protocol: @httpHeader / @httpQuery members go into the body, not the wire. + return false; + } + @Override public void writeShapeForwardDeclarations(CppWriter writer) { writer.writeNamespaceOpen("Utils"); @@ -86,9 +92,11 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of("aws/crt/cbor/Cbor.h"); - // All source kinds share one union (supersets allowed). Usings are unchanged. - case SUBOBJECT_SOURCE: + // All source kinds share one include set. RPC CBOR is an RPC protocol: request sources + // never run the shared @httpQuery / @httpHeader serializers, so they need no URI / + // StringUtils includes — REQUEST_SOURCE carries the same set as every other source kind. case REQUEST_SOURCE: + case SUBOBJECT_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: case EVENT_HANDLER_SOURCE: @@ -166,7 +174,8 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, // (content-type / smithy-protocol / accept) regardless of member bindings. writer.write(""); writeGetRequestSpecificHeadersDecl(writer, exportMacro); - if (RequestBindings.hasQueryStringMembers(shape, model)) { + // RPC CBOR routes @httpQuery members to the body, so no AddQueryStringParameters is emitted. + if (serializesHttpBindingMembers() && RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); writeAddQueryStringParametersDecl(writer, exportMacro); } @@ -204,11 +213,13 @@ public void writeRequestMethodImpls(CppWriter writer, String className, } writer.write("headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);"); writer.write("headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);"); + // RPC CBOR routes @httpHeader members to the body, so no member header serialization + // follows the fixed protocol headers. writer.write("return headers;"); }); - if (RequestBindings.hasQueryStringMembers(shape, model)) { + if (serializesHttpBindingMembers() && RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); - writeAddQueryStringParametersImpl(writer, className); + writeAddQueryStringParametersImpl(writer, className, shape, model); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index 9996841ba71..eace0615ab8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -88,10 +88,21 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of(); + // Request sources additionally serialize @httpQuery members via the shared query + // serializer, which needs URI (AddQueryStringParameter) and StringUtils. These are + // added only here to avoid widening the other source kinds. + case REQUEST_SOURCE: + return List.of( + "aws/core/utils/json/JsonSerializer.h", + "aws/core/utils/UnreferencedParam.h", + "aws/core/utils/memory/stl/AWSStringStream.h", + "aws/core/utils/HashingUtils.h", + "aws/core/utils/StringUtils.h", + "aws/core/http/URI.h", + "utility"); // All source kinds share one union (supersets allowed: a .cpp may carry an // include it doesn't strictly use). Usings are unchanged; only #includes widen. case SUBOBJECT_SOURCE: - case REQUEST_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: case EVENT_HANDLER_SOURCE: @@ -157,6 +168,12 @@ public boolean hasTargetHeader() { return protocol == Protocol.JSON; } + @Override + public boolean serializesHttpBindingMembers() { + // rest-json honors HTTP bindings; awsJson (RPC) routes those members to the body. + return protocol == Protocol.REST_JSON; + } + @Override public void writeRequestMethodDecls(CppWriter writer, String exportMacro, StructureShape shape, OperationShape operation, Model model) { @@ -165,11 +182,12 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, if (RequestBindings.emitsSerializePayload(operation, model)) { writer.write("$L Aws::String SerializePayload() const override;", exportMacro); } - if (hasTargetHeader() || RequestBindings.hasHeaderMembers(shape, model)) { + if (hasTargetHeader() + || (serializesHttpBindingMembers() && RequestBindings.hasHeaderMembers(shape, model))) { writer.write(""); writeGetRequestSpecificHeadersDecl(writer, exportMacro); } - if (RequestBindings.hasQueryStringMembers(shape, model)) { + if (serializesHttpBindingMembers() && RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); writeAddQueryStringParametersDecl(writer, exportMacro); } @@ -183,13 +201,14 @@ public void writeRequestMethodImpls(CppWriter writer, String className, String payloadBody = protocol == Protocol.JSON ? "\"{}\"" : "{}"; writer.write("Aws::String $L::SerializePayload() const { return $L; }", className, payloadBody); } - if (hasTargetHeader() || RequestBindings.hasHeaderMembers(shape, model)) { + if (hasTargetHeader() + || (serializesHttpBindingMembers() && RequestBindings.hasHeaderMembers(shape, model))) { writer.write(""); writeGetRequestSpecificHeadersImpl(writer, className, shape, operation, service, model); } - if (RequestBindings.hasQueryStringMembers(shape, model)) { + if (serializesHttpBindingMembers() && RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); - writeAddQueryStringParametersImpl(writer, className); + writeAddQueryStringParametersImpl(writer, className, shape, model); } } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index d7002148dc0..4954d7fe277 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -7,6 +7,8 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestHeaderSerializer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestQuerySerializer; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; @@ -147,6 +149,23 @@ default boolean hasTargetHeader() { return false; } + /** + * Whether this protocol honors HTTP binding traits ({@code @httpHeader} / + * {@code @httpPrefixHeaders} / {@code @httpQuery} / {@code @httpQueryParams}) by serializing + * those members onto the wire (request headers / query string). + * + *

REST protocols (rest-json, rest-xml, query/ec2) return {@code true}. RPC protocols + * (awsJson1_0/1_1, rpcv2Cbor) route these members into the request body instead, so + * they return {@code false}: their {@code GetRequestSpecificHeaders} still emits the fixed + * protocol headers ({@code X-Amz-Target} for awsJson; {@code Content-Type}/{@code smithy-protocol}/ + * {@code Accept} for CBOR), but no member header/query serialization is emitted, and no + * {@code AddQueryStringParameters} method is generated. Matches the legacy C2J per-protocol + * behavior (byte-parity reference). + */ + default boolean serializesHttpBindingMembers() { + return true; + } + /** * Whether {@code integer} members widen to {@code int64_t} (rather than {@code int}) in this * protocol's sub-object and result headers. C2J does this only for CBOR @@ -186,15 +205,28 @@ default void writeGetRequestSpecificHeadersImpl(CppWriter writer, String classNa writer.write("headers.insert(Aws::Http::HeaderValuePair(\"X-Amz-Target\", \"$L.$L\"));", service.getId().getName(), operation.getId().getName()); } + // C2J declares the stringstream once, immediately after `headers`, whenever the request + // has ≥1 header member (even all-enum/timestamp members, which never use it). RPC + // protocols route HTTP-binding members to the body, so neither the stringstream nor the + // member serialization is emitted for them. + if (serializesHttpBindingMembers() && RequestBindings.hasHeaderMembers(shape, model)) { + writer.write("Aws::StringStream ss;"); + } + if (serializesHttpBindingMembers()) { + RequestHeaderSerializer.render(writer, shape, model); + } writer.write("return headers;"); }); } - default void writeAddQueryStringParametersImpl(CppWriter writer, String className) { + default void writeAddQueryStringParametersImpl(CppWriter writer, String className, + StructureShape shape, Model model) { writer.openBlock("void $L::AddQueryStringParameters(Aws::Http::URI& uri) const {", "}", className, () -> { - writer.write("AWS_UNREFERENCED_PARAM(uri);"); - writer.write("// TODO: serialize httpQuery/httpQueryParams members"); + // C2J declares the stringstream unconditionally in AddQueryStringParameters; every query + // case routes its value through it. + writer.write("Aws::StringStream ss;"); + RequestQuerySerializer.render(writer, shape, model); }); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java index b4409b578ca..4fdd005e202 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java @@ -95,8 +95,19 @@ public List serdeIncludes(FileKind kind) { case RESULT_HEADER: // Query/EC2 result headers forward-declare XmlDocument; no serde include. return List.of(); - case SUBOBJECT_SOURCE: + // Request sources additionally serialize @httpQuery members via the shared query + // serializer, which needs URI (AddQueryStringParameter), StringUtils, and the + // stringstream. URI.h is added only here to avoid widening the other source kinds. case REQUEST_SOURCE: + return List.of( + "aws/core/utils/xml/XmlSerializer.h", + "aws/core/utils/logging/LogMacros.h", + "aws/core/utils/UnreferencedParam.h", + "aws/core/utils/StringUtils.h", + "aws/core/utils/memory/stl/AWSStringStream.h", + "aws/core/utils/HashingUtils.h", + "aws/core/http/URI.h"); + case SUBOBJECT_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: case EVENT_HANDLER_SOURCE: @@ -230,7 +241,7 @@ public void writeRequestMethodImpls(CppWriter writer, String className, } if (RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); - writeAddQueryStringParametersImpl(writer, className); + writeAddQueryStringParametersImpl(writer, className, shape, model); } writer.write(""); writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { uri.SetQueryString(SerializePayload()); }", diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index 7291f863b79..db5838d18e9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -75,9 +75,22 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of(); - // All source kinds share one union (supersets allowed). Usings are unchanged. - case SUBOBJECT_SOURCE: + // Request sources additionally serialize @httpHeader/@httpQuery members, which need + // StringUtils (to_string), URI (URLEncodePath for x-amz-copy-source), and + // (std::accumulate for comma-joined list headers). C2J pulls these per-shape; the + // data-driven set carries them for every request source (superset). case REQUEST_SOURCE: + return List.of( + "aws/core/utils/xml/XmlSerializer.h", + "aws/core/utils/memory/stl/AWSStringStream.h", + "aws/core/utils/UnreferencedParam.h", + "aws/core/utils/HashingUtils.h", + "aws/core/utils/StringUtils.h", + "aws/core/http/URI.h", + "numeric", + "utility"); + // The remaining source kinds share one union (supersets allowed). + case SUBOBJECT_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: case EVENT_HANDLER_SOURCE: @@ -99,9 +112,12 @@ public List serdeUsings(FileKind kind) { switch (kind) { case EVENT_HANDLER_SOURCE: return List.of(serdeNamespace()); + // Request sources add Aws::Http so URI::URLEncodePath resolves unqualified (C2J emits + // `using namespace Aws::Http;` in every XML request source that serializes headers/query). + case REQUEST_SOURCE: + return List.of("Aws::Utils::Xml", "Aws::Utils", "Aws::Http"); case RESULT_SOURCE: case INITIAL_RESPONSE_SOURCE: - case REQUEST_SOURCE: case SUBOBJECT_SOURCE: return List.of("Aws::Utils::Xml", "Aws::Utils"); default: @@ -168,7 +184,7 @@ public void writeRequestMethodImpls(CppWriter writer, String className, } if (RequestBindings.hasQueryStringMembers(shape, model)) { writer.write(""); - writeAddQueryStringParametersImpl(writer, className); + writeAddQueryStringParametersImpl(writer, className, shape, model); } if (shape.hasTrait(EmbeddedErrorsTrait.class)) { writer.write(""); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java new file mode 100644 index 00000000000..82cd84eed55 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java @@ -0,0 +1,169 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpHeaderTrait; +import software.amazon.smithy.model.traits.HttpPrefixHeadersTrait; +import software.amazon.smithy.model.traits.SparseTrait; +import software.amazon.smithy.model.traits.TimestampFormatTrait; + +import java.util.Locale; + +/** + * Emits the {@code @httpHeader} member-serialization loop body for a request (operation-input) + * structure's {@code GetRequestSpecificHeaders()}, byte-matching the legacy C2J + * {@code ModelClassHeaderMembersSource.vm}. + * + *

Protocol-agnostic: the member serialization is byte-identical across REST-XML, JSON, + * REST-JSON, Query-XML, EC2, and CBOR, so this renderer never branches on protocol. The + * caller ({@code ProtocolTraits.writeGetRequestSpecificHeadersImpl}) owns the surrounding + * {@code Aws::Http::HeaderValueCollection headers;} / {@code Aws::StringStream ss;} declarations, + * the protocol prologue (e.g. {@code X-Amz-Target}), and {@code return headers;}. + * + *

Every member is {@code HasBeenSet}-gated (C2J clears {@code required} on all members), and + * enum members additionally guard against {@code ::NOT_SET}. + * + *

Scope: {@code @httpHeader} members (string / {@code x-amz-copy-source} / enum / boolean / + * blob / timestamp scalars, plus lists joined via {@code std::accumulate}) and + * {@code @httpPrefixHeaders} maps (looped, with sparse-value {@code has_value()} unwrapping). + */ +public final class RequestHeaderSerializer { + + private RequestHeaderSerializer() {} + + /** + * Emits the header-member serialization for every header-bound member of {@code shape}, in + * model order: {@code @httpHeader} scalars/lists, and {@code @httpPrefixHeaders} maps. Members + * carrying neither trait are skipped. + */ + public static void render(CppWriter writer, StructureShape shape, Model model) { + for (MemberShape member : shape.getAllMembers().values()) { + // C2J lowercases HTTP header location names (and @httpPrefixHeaders prefixes); query + // names stay case-sensitive. Locale.ROOT avoids locale-dependent casing surprises. + member.getTrait(HttpHeaderTrait.class).ifPresent(trait -> + renderHeaderMember(writer, member, trait.getValue().toLowerCase(Locale.ROOT), model)); + member.getTrait(HttpPrefixHeadersTrait.class).ifPresent(trait -> + renderPrefixHeadersMap(writer, member, trait.getValue().toLowerCase(Locale.ROOT), model)); + } + } + + private static void renderHeaderMember(CppWriter writer, MemberShape member, String location, + Model model) { + Shape target = model.expectShape(member.getTarget()); + String field = CppNames.fieldName(member.getMemberName()); + + if (target.isListShape()) { + Shape element = model.expectShape(target.asListShape().get().getMember().getTarget()); + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + renderListBody(writer, field, location, element, model)); + return; + } + + if (CppTypeMapper.isEnum(target)) { + String enumType = CppTypeMapper.getCppType(target, model, false); + writer.openBlock("if ($1LHasBeenSet && $1L != $2L::NOT_SET) {", "}", field, enumType, () -> + writer.write("headers.emplace(\"$1L\", $2L);", + location, headerValueExpression(target, field, model))); + return; + } + + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + renderScalarBody(writer, field, location, target, model)); + } + + // @httpPrefixHeaders map: each entry becomes a header whose name is the trait prefix + // concatenated with the entry key. A @sparse map's value is Aws::Crt::Optional, so the emplace + // is guarded on has_value() and unwrapped via value(). + private static void renderPrefixHeadersMap(CppWriter writer, MemberShape member, String prefix, + Model model) { + Shape target = model.expectShape(member.getTarget()); + String field = CppNames.fieldName(member.getMemberName()); + boolean sparse = target.hasTrait(SparseTrait.class); + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + writer.openBlock("for (const auto& item : $L) {", "}", field, () -> { + writer.write("ss << \"$L\" << item.first;", prefix); + if (sparse) { + writer.write( + "if (item.second.has_value()) { headers.emplace(ss.str(), item.second.value()); }"); + } else { + writer.write("headers.emplace(ss.str(), item.second);"); + } + writer.write("ss.str(\"\");"); + })); + } + + // @httpHeader list: comma-joins the elements into a single header value via std::accumulate. + private static void renderListBody(CppWriter writer, String field, String location, Shape element, + Model model) { + String elementType = CppTypeMapper.getCppType(element, model, false); + writer.write("headers.emplace(\"$1L\", std::accumulate(std::begin($2L), std::end($2L), Aws::String{},", + location, field); + writer.write(" [](const Aws::String& acc, const $L& item) -> Aws::String {", elementType); + writer.write(" const auto headerValue = $L;", headerValueExpression(element, "item", model)); + writer.write(" return acc.empty() ? headerValue : acc + \",\" + headerValue;"); + writer.write(" }));"); + } + + // Shared per-type header value expression, keyed on the target shape: enum → Mapper lookup, + // timestamp → the header timestamp mapping (epoch-seconds→Seconds(), date-time→ISO_8601, + // else→RFC822), primitive → to_string, any other (string) value used directly. The value + // expression (the field for a scalar member, the loop var for a list element) is the parameter, + // so the scalar and list paths share one copy of the enum-Mapper and timestamp-format mappings. + private static String headerValueExpression(Shape shape, String valueExpr, Model model) { + if (CppTypeMapper.isEnum(shape)) { + String enumType = CppTypeMapper.getCppType(shape, model, false); + return enumType + "Mapper::GetNameFor" + enumType + "(" + valueExpr + ")"; + } + if (shape.isTimestampShape()) { + String format = shape.getTrait(TimestampFormatTrait.class) + .map(TimestampFormatTrait::getValue) + .orElse("http-date"); + if (format.equals("epoch-seconds")) { + return "StringUtils::to_string(" + valueExpr + ".Seconds())"; + } + String dateFormat = format.equals("date-time") ? "ISO_8601" : "RFC822"; + return valueExpr + ".ToGmtString(Aws::Utils::DateFormat::" + dateFormat + ")"; + } + if (CppTypeMapper.isPrimitive(shape)) { + return "StringUtils::to_string(" + valueExpr + ")"; + } + return valueExpr; + } + + private static void renderScalarBody(CppWriter writer, String field, String location, Shape target, + Model model) { + if (target.isBooleanShape()) { + writer.write("ss << std::boolalpha << $L;", field); + emplaceFromStream(writer, location); + return; + } + if (target.isBlobShape()) { + writer.write("ss << HashingUtils::Base64Encode($L);", field); + emplaceFromStream(writer, location); + return; + } + if (target.isTimestampShape()) { + writer.write("headers.emplace(\"$L\", $L);", location, headerValueExpression(target, field, model)); + return; + } + // string / default scalar + writer.write("ss << $L;", field); + String value = location.equals("x-amz-copy-source") ? "URI::URLEncodePath(ss.str())" : "ss.str()"; + writer.write("headers.emplace(\"$L\", $L);", location, value); + writer.write("ss.str(\"\");"); + } + + private static void emplaceFromStream(CppWriter writer, String location) { + writer.write("headers.emplace(\"$L\", ss.str());", location); + writer.write("ss.str(\"\");"); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java new file mode 100644 index 00000000000..ce686fa91be --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java @@ -0,0 +1,187 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppNames; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.CppTypeMapper; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.CustomizedAccessLogTagTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpQueryParamsTrait; +import software.amazon.smithy.model.traits.HttpQueryTrait; +import software.amazon.smithy.model.traits.TimestampFormatTrait; + +/** + * Emits the {@code @httpQuery} member-serialization loop body for a request (operation-input) + * structure's {@code AddQueryStringParameters(Aws::Http::URI&)}, byte-matching the legacy C2J + * {@code AddQueryStringParametersToRequest.vm}. + * + *

Protocol-agnostic: the query member serialization is byte-identical across REST-XML, + * Query-XML, EC2, JSON, and CBOR, so this renderer never branches on protocol. The caller + * ({@code ProtocolTraits.writeAddQueryStringParametersImpl}) owns the surrounding + * {@code Aws::StringStream ss;} declaration and the method scaffold; {@code uri} is the + * {@code Aws::Http::URI&} method parameter. + * + *

Every member is {@code HasBeenSet}-gated (C2J clears {@code required} on all members). Unlike + * headers, query enum members are NOT additionally guarded against {@code ::NOT_SET} — C2J's query + * template ({@code AddQueryStringParameter.vm}) gates on {@code HasBeenSet} only. + * + *

Scope: scalar / string / enum / timestamp {@code @httpQuery} members, {@code @httpQuery} + * lists (looped, one query parameter per element under the fixed location), and + * {@code @httpQueryParams} maps (looped, each entry keyed by the map's own key — scalar value, + * enum key via {@code Mapper}, or list value via an inner loop). Unlike headers, every query + * case routes its value through the shared {@code ss} stringstream. The query timestamp default + * is {@code date-time} (ISO_8601), differing from the header default (RFC822). + * + *

The S3 {@code customizedAccessLogTag} member (stamped with {@link CustomizedAccessLogTagTrait} + * by {@code S3Transforms}) is a special case: C2J models it with a {@code customizedQuery} flag, so + * it is skipped in the normal {@code @httpQueryParams} loop and instead emits an {@code x-}-prefix + * filter block once after the loop, byte-matching {@code AddQueryStringParametersToRequest.vm}. + */ +public final class RequestQuerySerializer { + + private RequestQuerySerializer() {} + + /** + * Emits the query-member serialization for every {@code @httpQuery} scalar/string/enum/timestamp + * member of {@code shape}, in model order. Members carrying no {@code @httpQuery} trait are skipped. + */ + public static void render(CppWriter writer, StructureShape shape, Model model) { + for (MemberShape member : shape.getAllMembers().values()) { + member.getTrait(HttpQueryTrait.class).ifPresent(trait -> + renderQueryMember(writer, member, trait.getValue(), model)); + member.getTrait(HttpQueryParamsTrait.class).ifPresent(trait -> { + // The S3 customizedAccessLogTag member carries @httpQueryParams (to keep the request + // emitting AddQueryStringParameters) but is not serialized as a normal map — it emits + // the x- filter block after this loop instead. + if (!member.hasTrait(CustomizedAccessLogTagTrait.class)) { + renderQueryParamsMap(writer, member, model); + } + }); + } + // C2J's customizedQuery block: emitted once, after the normal member loop, for the (single) + // marked S3 customizedAccessLogTag member. NOT HasBeenSet-gated. + for (MemberShape member : shape.getAllMembers().values()) { + if (member.hasTrait(CustomizedAccessLogTagTrait.class)) { + renderCustomizedAccessLogTagFilter(writer, member); + } + } + } + + // C2J's AddQueryStringParametersToRequest.vm customizedQuery block: keep only LogTags whose key + // starts with "x-", then add the collected map to the URI. Emitted byte-for-byte. + private static void renderCustomizedAccessLogTagFilter(CppWriter writer, MemberShape member) { + String field = CppNames.fieldName(member.getMemberName()); + writer.openBlock("if (!$L.empty()) {", "}", field, () -> { + writer.write("// only accept customized LogTag which starts with \"x-\""); + writer.write("Aws::Map collectedLogTags;"); + writer.openBlock("for (const auto& entry : $L) {", "}", field, () -> + writer.openBlock("if (!entry.first.empty() && !entry.second.empty() && " + + "entry.first.substr(0, 2) == \"x-\") {", "}", () -> + writer.write("collectedLogTags.emplace(entry.first, entry.second);"))); + writer.openBlock("if (!collectedLogTags.empty()) {", "}", () -> + writer.write("uri.AddQueryStringParameter(collectedLogTags);")); + }); + } + + private static void renderQueryMember(CppWriter writer, MemberShape member, String location, + Model model) { + Shape target = model.expectShape(member.getTarget()); + String field = CppNames.fieldName(member.getMemberName()); + + // @httpQuery list: one query parameter per element, all under the same fixed location. + if (target.isListShape()) { + Shape element = model.expectShape(target.asListShape().get().getMember().getTarget()); + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + writer.openBlock("for (const auto& item : $L) {", "}", field, () -> { + writer.write("ss << $L;", elementStreamExpression("item", element, model)); + writer.write("uri.AddQueryStringParameter(\"$L\", ss.str());", location); + writer.write("ss.str(\"\");"); + })); + return; + } + + if (CppTypeMapper.isEnum(target)) { + String enumType = CppTypeMapper.getCppType(target, model, false); + // C2J's query template gates enums on HasBeenSet only (no NOT_SET clause, unlike headers). + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + emitStreamed(writer, location, + enumType + "Mapper::GetNameFor" + enumType + "(" + field + ")")); + return; + } + + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + emitStreamed(writer, location, elementStreamExpression(field, target, model))); + } + + private static void emitStreamed(CppWriter writer, String location, String streamExpression) { + writer.write("ss << $L;", streamExpression); + writer.write("uri.AddQueryStringParameter(\"$L\", ss.str());", location); + writer.write("ss.str(\"\");"); + } + + // @httpQueryParams map: each entry becomes a query parameter keyed by the map's own key + // (there is no fixed location). A scalar value streams directly; a list value fans out to one + // query parameter per element via an inner loop; an enum key is mapped through its Mapper. + private static void renderQueryParamsMap(CppWriter writer, MemberShape member, Model model) { + Shape target = model.expectShape(member.getTarget()); + String field = CppNames.fieldName(member.getMemberName()); + Shape key = model.expectShape(target.asMapShape().get().getKey().getTarget()); + Shape value = model.expectShape(target.asMapShape().get().getValue().getTarget()); + String keyExpression = queryParamKeyExpression(key, model); + + writer.openBlock("if ($LHasBeenSet) {", "}", field, () -> + writer.openBlock("for (auto& item : $L) {", "}", field, () -> { + if (value.isListShape()) { + Shape element = model.expectShape(value.asListShape().get().getMember().getTarget()); + writer.openBlock("for (auto& innerItem : item.second) {", "}", () -> { + writer.write("ss << $L;", elementStreamExpression("innerItem", element, model)); + writer.write("uri.AddQueryStringParameter($L, ss.str());", keyExpression); + writer.write("ss.str(\"\");"); + }); + } else { + writer.write("ss << $L;", elementStreamExpression("item.second", value, model)); + writer.write("uri.AddQueryStringParameter($L, ss.str());", keyExpression); + writer.write("ss.str(\"\");"); + } + })); + } + + // Query parameter key for an @httpQueryParams entry: an enum key routes through its Mapper, + // any other (string) key uses the raw entry key. Both terminate in .c_str() since + // AddQueryStringParameter takes a const char* key. + private static String queryParamKeyExpression(Shape key, Model model) { + if (CppTypeMapper.isEnum(key)) { + String enumType = CppTypeMapper.getCppType(key, model, false); + return enumType + "Mapper::GetNameFor" + enumType + "(item.first).c_str()"; + } + return "item.first.c_str()"; + } + + // Shared stream expression for a scalar member, list element, or map value: enum → Mapper + // lookup, timestamp → the query timestamp mapping (date-time→ISO_8601, http-date→RFC822, + // epoch-seconds→SecondsWithMSPrecision()), any other value streamed directly. The non-enum + // scalar path reuses this too (enum scalars are handled inline before reaching here). + private static String elementStreamExpression(String var, Shape target, Model model) { + if (CppTypeMapper.isEnum(target)) { + String enumType = CppTypeMapper.getCppType(target, model, false); + return enumType + "Mapper::GetNameFor" + enumType + "(" + var + ")"; + } + if (target.isTimestampShape()) { + String format = target.getTrait(TimestampFormatTrait.class) + .map(TimestampFormatTrait::getValue) + .orElse("date-time"); + if (format.equals("epoch-seconds")) { + return var + ".SecondsWithMSPrecision()"; + } + String dateFormat = format.equals("http-date") ? "RFC822" : "ISO_8601"; + return var + ".ToGmtString(Aws::Utils::DateFormat::" + dateFormat + ")"; + } + return var; + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java new file mode 100644 index 00000000000..cb40c23c71e --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java @@ -0,0 +1,28 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link S3Transforms} on the + * {@code customizedAccessLogTag} map member it injects onto every S3 request. C2J models that + * member with a distinct {@code customizedQuery} flag rather than an ordinary query-string map: + * its {@code AddQueryStringParametersToRequest.vm} skips the normal {@code @httpQueryParams} loop + * for it and instead emits the {@code x-}-prefix filter block ({@code collectedLogTags}). This + * marker preserves that distinction — {@code RequestQuerySerializer} skips the marked member in + * the normal map loop and emits the {@code x-} filter block for it after the loop. The member + * keeps its {@code @httpQueryParams} trait so the request still declares + * {@code AddQueryStringParameters} ({@code RequestBindings.hasQueryStringMembers}). + */ +public final class CustomizedAccessLogTagTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#customizedAccessLogTag"); + + public CustomizedAccessLogTagTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 152635b1050..61fcfffdd21 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -194,9 +194,10 @@ private static Model markEmbeddedErrors(Model model) { } // C2J's S3RestXmlCppClientGenerator appends a `customizedAccessLogTag` map member - // to every operation request shape. It renders as an ordinary map member in the .h; the query- - // string binding (location=querystring, customizedQuery=true) is a serde concern deferred until - // Smithy serde lands, so no @httpQuery/@httpQueryParams trait is attached here. + // to every operation request shape, modeled with a distinct `customizedQuery` flag. It binds to + // the query string via @httpQueryParams (so every request emits AddQueryStringParameters), and + // additionally carries the CustomizedAccessLogTagTrait marker so RequestQuerySerializer skips the + // normal map loop for it and instead emits C2J's x--prefix filter block. private static Model injectAccessLogTagQuery(Model model, ServiceShape service) { ShapeId mapId = ShapeId.fromParts("com.amazonaws.s3", "CustomizedAccessLogTag"); ShapeId stringId = ShapeId.from("smithy.api#String"); @@ -228,6 +229,9 @@ private static Model injectAccessLogTagQuery(Model model, ServiceShape service) // querystring member on every request, which is what makes every request emit // AddQueryStringParameters; the trait drives RequestBindings.hasQueryStringMembers. .addTrait(new HttpQueryParamsTrait()) + // Marker for C2J's customizedQuery flag: RequestQuerySerializer skips the normal + // map loop for this member and emits the x--prefix filter block instead. + .addTrait(new CustomizedAccessLogTagTrait()) .build()) .build()); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java index 01834ac14ae..2936fe29d35 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java @@ -391,12 +391,17 @@ void requestHeader_alwaysHasSerializePayload_neverSerdeIncludes(Protocol p) { @ParameterizedTest @EnumSource(value = Protocol.class, names = {"JSON"}) - void awsJson_request_hasTargetHeaderAndQueryAndSerialize(Protocol p) { + void awsJson_request_hasTargetHeaderAndSerialize_noWireBindings(Protocol p) { String h = file(p, "DoThingRequest.h"); assertTrue(h.contains("SerializePayload() const override;"), h); - assertTrue(h.contains("GetRequestSpecificHeaders() const override;"), h); // header member OR target - assertTrue(h.contains("AddQueryStringParameters(Aws::Http::URI& uri) const override;"), h); + assertTrue(h.contains("GetRequestSpecificHeaders() const override;"), h); // X-Amz-Target + // RPC awsJson routes @httpHeader/@httpQuery members to the body: no AddQueryStringParameters, + // and no member header serialization inside GetRequestSpecificHeaders. + assertFalse(h.contains("AddQueryStringParameters(Aws::Http::URI& uri) const override;"), h); assertFalse(h.contains("DumpBodyToUrl"), h); + String c = file(p, "DoThingRequest.cpp"); + assertTrue(c.contains("X-Amz-Target"), c); + assertFalse(c.contains("uri.AddQueryStringParameter"), c); } @ParameterizedTest diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java index 258c1d41361..4a1cea49663 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java @@ -175,6 +175,27 @@ void requestWithInput_emitsContentTypeAndEncoderPayload() { assertTrue(i.contains("headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);"), i); } + @Test + void cbor_queryMember_notWireSerialized_keepsProtocolHeaders() { + // RPC CBOR routes @httpQuery members to the body; no AddQueryStringParameters method, but + // the fixed CBOR protocol headers are still emitted. + var req = reqWith(false, true); var op = opWithInput(req); var model = modelWith(req); + String d = render(w -> cbor.writeRequestMethodDecls(w, "AWS_EX_API", req, op, model)); + assertFalse(d.contains("AddQueryStringParameters"), d); + String i = render(w -> cbor.writeRequestMethodImpls(w, "DoThingRequest", req, op, svcAthena(), model)); + assertFalse(i.contains("AddQueryStringParameters"), i); + assertTrue(i.contains("headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);"), i); + } + + @Test + void cbor_headerMember_notWireSerialized_keepsProtocolHeaders() { + var req = reqWith(true, false); var op = opWithInput(req); var model = modelWith(req); + String i = render(w -> cbor.writeRequestMethodImpls(w, "DoThingRequest", req, op, svcAthena(), model)); + assertFalse(i.contains("headers.emplace(\"x-h\""), i); + assertFalse(i.contains("ss << m_h;"), i); + assertTrue(i.contains("headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);"), i); + } + // hasRequest()==false (input targets smithy.api#Unit): SerializePayload returns {}, NO CONTENT_TYPE. @Test void noInputRequest_returnsEmptyBracesAndOmitsContentType() { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 7f4281bf8f2..9590f2f830d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -175,10 +175,42 @@ void restJson_withHeaderMember_emitsHeadersMethodWithoutTarget() { } @Test - void json_withQueryMember_emitsAddQueryStringParameters() { + void awsJson_headerMember_notWireSerialized_keepsTarget() { + // RPC awsJson routes @httpHeader members to the JSON body; GetRequestSpecificHeaders still + // emits X-Amz-Target but performs no member header serialization. + var req = reqWith(true, false); var model = modelWith(req); + String i = render(w -> json.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains("X-Amz-Target"), i); + assertFalse(i.contains("headers.emplace(\"x-h\""), i); + assertFalse(i.contains("ss << m_h;"), i); + } + + @Test + void awsJson_queryMember_notWireSerialized() { + // RPC awsJson routes @httpQuery members to the body; no AddQueryStringParameters is emitted. var req = reqWith(false, true); var model = modelWith(req); String d = render(w -> json.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); + assertFalse(d.contains("AddQueryStringParameters"), d); + String i = render(w -> json.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertFalse(i.contains("AddQueryStringParameters"), i); + } + + @Test + void restJson_headerMember_isWireSerialized() { + // REST protocols honor HTTP bindings: the @httpHeader member is serialized onto the wire. + var req = reqWith(true, false); var model = modelWith(req); + String i = render(w -> restJson.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains("if (m_hHasBeenSet) {"), i); + assertTrue(i.contains("headers.emplace(\"x-h\", ss.str());"), i); + } + + @Test + void restJson_queryMember_isWireSerialized() { + var req = reqWith(false, true); var model = modelWith(req); + String d = render(w -> restJson.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); assertTrue(d.contains("void AddQueryStringParameters(Aws::Http::URI& uri) const override;"), d); + String i = render(w -> restJson.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains("uri.AddQueryStringParameter(\"q\", ss.str());"), i); } @Test diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializerTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializerTest.java new file mode 100644 index 00000000000..e77a05d3b1d --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializerTest.java @@ -0,0 +1,317 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.BlobShape; +import software.amazon.smithy.model.shapes.BooleanShape; +import software.amazon.smithy.model.shapes.EnumShape; +import software.amazon.smithy.model.shapes.IntegerShape; +import software.amazon.smithy.model.shapes.ListShape; +import software.amazon.smithy.model.shapes.MapShape; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.TimestampShape; +import software.amazon.smithy.model.traits.HttpHeaderTrait; +import software.amazon.smithy.model.traits.HttpPrefixHeadersTrait; +import software.amazon.smithy.model.traits.SparseTrait; +import software.amazon.smithy.model.traits.TimestampFormatTrait; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies {@link RequestHeaderSerializer} emits the scalar {@code @httpHeader} member + * serialization (string / {@code x-amz-copy-source} / enum / boolean / blob / timestamp) + * byte-for-byte with the legacy C2J {@code ModelClassHeaderMembersSource.vm} output. + */ +class RequestHeaderSerializerTest { + + private static String render(StructureShape shape, Model model) { + CppWriter w = new CppWriter(); + RequestHeaderSerializer.render(w, shape, model); + return w.toString(); + } + + @Test + void stringHeader_gatedAndStreamed() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("CacheControl", s.getId(), b -> b.addTrait(new HttpHeaderTrait("cache-control"))) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_cacheControlHasBeenSet) {"), out); + assertTrue(out.contains("ss << m_cacheControl;"), out); + assertTrue(out.contains("headers.emplace(\"cache-control\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void copySourceHeader_isUrlEncoded() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("CopySource", s.getId(), b -> b.addTrait(new HttpHeaderTrait("x-amz-copy-source"))) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_copySourceHasBeenSet) {"), out); + assertTrue(out.contains("ss << m_copySource;"), out); + assertTrue(out.contains( + "headers.emplace(\"x-amz-copy-source\", URI::URLEncodePath(ss.str()));"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void enumHeader_usesMapperAndNotSetGuard() { + EnumShape acl = EnumShape.builder().id("com.ex#ObjectCannedACL") + .addMember("PRIVATE", "private") + .addMember("PUBLIC_READ", "public-read") + .build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("ACL", acl.getId(), b -> b.addTrait(new HttpHeaderTrait("x-amz-acl"))) + .build(); + Model m = Model.builder().addShapes(acl, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_aCLHasBeenSet && m_aCL != ObjectCannedACL::NOT_SET) {"), out); + assertTrue(out.contains( + "headers.emplace(\"x-amz-acl\", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL));"), out); + // Enums never route through the stringstream. + assertFalse(out.contains("ss << m_aCL"), out); + } + + @Test + void booleanHeader_usesBoolalpha() { + BooleanShape b = BooleanShape.builder().id("com.ex#B").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("BypassGovernanceRetention", b.getId(), + mb -> mb.addTrait(new HttpHeaderTrait("x-amz-bypass-governance-retention"))) + .build(); + Model m = Model.builder().addShapes(b, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_bypassGovernanceRetentionHasBeenSet) {"), out); + assertTrue(out.contains("ss << std::boolalpha << m_bypassGovernanceRetention;"), out); + assertTrue(out.contains( + "headers.emplace(\"x-amz-bypass-governance-retention\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void blobHeader_base64() { + BlobShape blob = BlobShape.builder().id("com.ex#Blob").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("SSECustomerKeyMD5", blob.getId(), + mb -> mb.addTrait(new HttpHeaderTrait("x-amz-server-side-encryption-customer-key-MD5"))) + .build(); + Model m = Model.builder().addShapes(blob, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_sSECustomerKeyMD5HasBeenSet) {"), out); + assertTrue(out.contains("ss << HashingUtils::Base64Encode(m_sSECustomerKeyMD5);"), out); + // C2J lowercases header locations: the model's uppercase "MD5" segment becomes "md5". + assertTrue(out.contains( + "headers.emplace(\"x-amz-server-side-encryption-customer-key-md5\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void timestampHeader_defaultRfc822() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpHeaderTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_expiresHasBeenSet) {"), out); + assertTrue(out.contains( + "headers.emplace(\"expires\", m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822));"), out); + // Timestamps emplace directly; they never touch the stringstream. + assertFalse(out.contains("ss << m_expires"), out); + } + + @Test + void timestampHeader_dateTimeTraitMapsToIso8601() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T") + .addTrait(new TimestampFormatTrait("date-time")).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpHeaderTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "headers.emplace(\"expires\", m_expires.ToGmtString(Aws::Utils::DateFormat::ISO_8601));"), out); + } + + @Test + void epochSecondsTimestampHeader_usesSeconds() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T") + .addTrait(new TimestampFormatTrait("epoch-seconds")).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpHeaderTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "headers.emplace(\"expires\", StringUtils::to_string(m_expires.Seconds()));"), out); + } + + @Test + void prefixHeadersMap_loopsWithPrefix() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#Meta") + .key(s.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Metadata", map.getId(), + b -> b.addTrait(new HttpPrefixHeadersTrait("x-amz-meta-"))) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_metadataHasBeenSet) {"), out); + assertTrue(out.contains("for (const auto& item : m_metadata) {"), out); + assertTrue(out.contains("ss << \"x-amz-meta-\" << item.first;"), out); + assertTrue(out.contains("headers.emplace(ss.str(), item.second);"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void sparsePrefixHeadersMap_unwrapsOptional() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#Meta") + .key(s.getId()).value(s.getId()) + .addTrait(new SparseTrait()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Metadata", map.getId(), + b -> b.addTrait(new HttpPrefixHeadersTrait("x-amz-meta-"))) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("for (const auto& item : m_metadata) {"), out); + assertTrue(out.contains("ss << \"x-amz-meta-\" << item.first;"), out); + assertTrue(out.contains( + "if (item.second.has_value()) { headers.emplace(ss.str(), item.second.value()); }"), out); + // The sparse form never emits the plain unconditional emplace. + assertFalse(out.contains("headers.emplace(ss.str(), item.second);"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void listHeader_accumulatesCommaJoined() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("X", list.getId(), b -> b.addTrait(new HttpHeaderTrait("x-h"))) + .build(); + Model m = Model.builder().addShapes(s, list, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_xHasBeenSet) {"), out); + assertTrue(out.contains( + "headers.emplace(\"x-h\", std::accumulate(std::begin(m_x), std::end(m_x), Aws::String{},"), out); + assertTrue(out.contains( + "[](const Aws::String& acc, const Aws::String& item) -> Aws::String {"), out); + assertTrue(out.contains("const auto headerValue = item;"), out); + assertTrue(out.contains("return acc.empty() ? headerValue : acc + \",\" + headerValue;"), out); + assertTrue(out.contains("}));"), out); + } + + @Test + void listHeader_enumElement_usesMapper() { + EnumShape e = EnumShape.builder().id("com.ex#ObjectAttributes") + .addMember("ETAG", "ETag").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(e.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("X", list.getId(), + b -> b.addTrait(new HttpHeaderTrait("x-amz-object-attributes"))) + .build(); + Model m = Model.builder().addShapes(e, list, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "[](const Aws::String& acc, const ObjectAttributes& item) -> Aws::String {"), out); + assertTrue(out.contains( + "const auto headerValue = ObjectAttributesMapper::GetNameForObjectAttributes(item);"), out); + } + + @Test + void listHeader_timestampElement_usesToGmtString() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(ts.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("X", list.getId(), b -> b.addTrait(new HttpHeaderTrait("x-h"))) + .build(); + Model m = Model.builder().addShapes(ts, list, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "[](const Aws::String& acc, const Aws::Utils::DateTime& item) -> Aws::String {"), out); + assertTrue(out.contains( + "const auto headerValue = item.ToGmtString(Aws::Utils::DateFormat::RFC822);"), out); + } + + @Test + void listHeader_primitiveElement_usesToString() { + IntegerShape i = IntegerShape.builder().id("com.ex#I").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(i.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("X", list.getId(), b -> b.addTrait(new HttpHeaderTrait("x-h"))) + .build(); + Model m = Model.builder().addShapes(i, list, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "[](const Aws::String& acc, const int& item) -> Aws::String {"), out); + assertTrue(out.contains("const auto headerValue = StringUtils::to_string(item);"), out); + } + + @Test + void mixedCaseHeaderLocation_isLowercased() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("CacheControl", s.getId(), b -> b.addTrait(new HttpHeaderTrait("Cache-Control"))) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + String out = render(req, m); + // C2J lowercases HTTP header location names; the mixed-case model name must be emitted lowercase. + assertTrue(out.contains("headers.emplace(\"cache-control\", ss.str());"), out); + assertFalse(out.contains("Cache-Control"), out); + } + + @Test + void mixedCaseEnumHeaderLocation_isLowercased() { + EnumShape acl = EnumShape.builder().id("com.ex#ObjectCannedACL") + .addMember("PRIVATE", "private") + .build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("ACL", acl.getId(), b -> b.addTrait(new HttpHeaderTrait("X-Amz-ACL"))) + .build(); + Model m = Model.builder().addShapes(acl, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "headers.emplace(\"x-amz-acl\", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL));"), out); + assertFalse(out.contains("X-Amz-ACL"), out); + } + + @Test + void mixedCasePrefixHeaders_prefixIsLowercased() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#Meta") + .key(s.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Metadata", map.getId(), + b -> b.addTrait(new HttpPrefixHeadersTrait("X-Amz-Meta-"))) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("ss << \"x-amz-meta-\" << item.first;"), out); + assertFalse(out.contains("X-Amz-Meta-"), out); + } + + @Test + void memberWithoutHeaderTrait_emitsNothing() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Body", s.getId()) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + assertTrue(render(req, m).isBlank(), render(req, m)); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializerTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializerTest.java new file mode 100644 index 00000000000..5d5b53fa0b5 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializerTest.java @@ -0,0 +1,268 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers; + +import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; +import org.junit.jupiter.api.Test; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.EnumShape; +import software.amazon.smithy.model.shapes.ListShape; +import software.amazon.smithy.model.shapes.MapShape; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.shapes.TimestampShape; +import software.amazon.smithy.model.traits.HttpQueryParamsTrait; +import software.amazon.smithy.model.traits.HttpQueryTrait; +import software.amazon.smithy.model.traits.TimestampFormatTrait; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies {@link RequestQuerySerializer} emits the scalar / string / enum / timestamp + * {@code @httpQuery} member serialization byte-for-byte with the legacy C2J + * {@code AddQueryStringParametersToRequest.vm} output. {@code @httpQuery} lists and + * {@code @httpQueryParams} maps are handled separately and are not exercised here. + */ +class RequestQuerySerializerTest { + + private static String render(StructureShape shape, Model model) { + CppWriter w = new CppWriter(); + RequestQuerySerializer.render(w, shape, model); + return w.toString(); + } + + @Test + void stringQuery_gatedAndAdded() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Prefix", s.getId(), b -> b.addTrait(new HttpQueryTrait("prefix"))) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_prefixHasBeenSet) {"), out); + assertTrue(out.contains("ss << m_prefix;"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"prefix\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void enumQuery_streamsMapper() { + EnumShape e = EnumShape.builder().id("com.ex#EncodingType") + .addMember("URL", "url") + .build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("EncodingType", e.getId(), b -> b.addTrait(new HttpQueryTrait("encoding-type"))) + .build(); + Model m = Model.builder().addShapes(e, req).build(); + String out = render(req, m); + // C2J's query template (AddQueryStringParameter.vm) gates query enums on HasBeenSet only — + // there is no NOT_SET clause for query members (unlike headers). + assertTrue(out.contains("if (m_encodingTypeHasBeenSet) {"), out); + assertFalse(out.contains("NOT_SET"), out); + assertTrue(out.contains( + "ss << EncodingTypeMapper::GetNameForEncodingType(m_encodingType);"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"encoding-type\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void timestampQuery_defaultIso8601() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpQueryTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_expiresHasBeenSet) {"), out); + assertTrue(out.contains( + "ss << m_expires.ToGmtString(Aws::Utils::DateFormat::ISO_8601);"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"expires\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void timestampQuery_httpDateTraitMapsToRfc822() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T") + .addTrait(new TimestampFormatTrait("http-date")).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpQueryTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains( + "ss << m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822);"), out); + } + + @Test + void timestampQuery_epochSecondsTrait() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T") + .addTrait(new TimestampFormatTrait("epoch-seconds")).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expires", ts.getId(), b -> b.addTrait(new HttpQueryTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_expiresHasBeenSet) {"), out); + assertTrue(out.contains("ss << m_expires.SecondsWithMSPrecision();"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"expires\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void memberWithoutQueryTrait_emitsNothing() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Body", s.getId()) + .build(); + Model m = Model.builder().addShapes(s, req).build(); + assertTrue(render(req, m).isBlank(), render(req, m)); + } + + @Test + void listQuery_loopsSameLocation() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Ids", list.getId(), b -> b.addTrait(new HttpQueryTrait("id"))) + .build(); + Model m = Model.builder().addShapes(s, list, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_idsHasBeenSet) {"), out); + assertTrue(out.contains("for (const auto& item : m_ids) {"), out); + assertTrue(out.contains("ss << item;"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"id\", ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void listQuery_enumElement_streamsMapper() { + EnumShape e = EnumShape.builder().id("com.ex#EncodingType") + .addMember("URL", "url").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(e.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("EncodingTypes", list.getId(), b -> b.addTrait(new HttpQueryTrait("encoding-type"))) + .build(); + Model m = Model.builder().addShapes(e, list, req).build(); + String out = render(req, m); + assertTrue(out.contains("for (const auto& item : m_encodingTypes) {"), out); + assertTrue(out.contains("ss << EncodingTypeMapper::GetNameForEncodingType(item);"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"encoding-type\", ss.str());"), out); + } + + @Test + void listQuery_timestampElement_defaultIso8601() { + TimestampShape ts = TimestampShape.builder().id("com.ex#T").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(ts.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Expirations", list.getId(), b -> b.addTrait(new HttpQueryTrait("expires"))) + .build(); + Model m = Model.builder().addShapes(ts, list, req).build(); + String out = render(req, m); + assertTrue(out.contains("for (const auto& item : m_expirations) {"), out); + assertTrue(out.contains( + "ss << item.ToGmtString(Aws::Utils::DateFormat::ISO_8601);"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(\"expires\", ss.str());"), out); + } + + @Test + void queryParamsMap_scalarValue_usesEntryKey() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#M").key(s.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Params", map.getId(), b -> b.addTrait(new HttpQueryParamsTrait())) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("if (m_paramsHasBeenSet) {"), out); + assertTrue(out.contains("for (auto& item : m_params) {"), out); + assertTrue(out.contains("ss << item.second;"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(item.first.c_str(), ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void queryParamsMap_listValue_innerLoop() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + ListShape list = ListShape.builder().id("com.ex#L").member(s.getId()).build(); + MapShape map = MapShape.builder().id("com.ex#M").key(s.getId()).value(list.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Params", map.getId(), b -> b.addTrait(new HttpQueryParamsTrait())) + .build(); + Model m = Model.builder().addShapes(s, list, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("for (auto& item : m_params) {"), out); + assertTrue(out.contains("for (auto& innerItem : item.second) {"), out); + assertTrue(out.contains("ss << innerItem;"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(item.first.c_str(), ss.str());"), out); + assertTrue(out.contains("ss.str(\"\");"), out); + } + + @Test + void customizedAccessLogTagMarker_emitsXFilterBlockAndSkipsNormalMap() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#M").key(s.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("customizedAccessLogTag", map.getId(), b -> b + .addTrait(new HttpQueryParamsTrait()) + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms + .CustomizedAccessLogTagTrait())) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + + // The x- filter block is emitted verbatim (NOT HasBeenSet-gated). + assertTrue(out.contains("if (!m_customizedAccessLogTag.empty()) {"), out); + assertTrue(out.contains("// only accept customized LogTag which starts with \"x-\""), out); + assertTrue(out.contains("Aws::Map collectedLogTags;"), out); + assertTrue(out.contains("for (const auto& entry : m_customizedAccessLogTag) {"), out); + assertTrue(out.contains( + "if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == \"x-\") {"), + out); + assertTrue(out.contains("collectedLogTags.emplace(entry.first, entry.second);"), out); + assertTrue(out.contains("if (!collectedLogTags.empty()) {"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(collectedLogTags);"), out); + + // The marked member must be skipped in the normal @httpQueryParams loop. + assertFalse(out.contains("if (m_customizedAccessLogTagHasBeenSet) {"), out); + assertFalse(out.contains("for (auto& item : m_customizedAccessLogTag) {"), out); + } + + @Test + void plainQueryParamsMap_withoutMarker_stillNormalSerialization() { + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#M").key(s.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Params", map.getId(), b -> b.addTrait(new HttpQueryParamsTrait())) + .build(); + Model m = Model.builder().addShapes(s, map, req).build(); + String out = render(req, m); + + // A plain @httpQueryParams map (no marker) keeps the Task-4 normal map serialization. + assertTrue(out.contains("if (m_paramsHasBeenSet) {"), out); + assertTrue(out.contains("for (auto& item : m_params) {"), out); + assertTrue(out.contains("ss << item.second;"), out); + assertTrue(out.contains("uri.AddQueryStringParameter(item.first.c_str(), ss.str());"), out); + // No x- filter block for a plain map. + assertFalse(out.contains("collectedLogTags"), out); + } + + @Test + void queryParamsMap_enumKey_usesMapper() { + EnumShape key = EnumShape.builder().id("com.ex#KeyEnum") + .addMember("A", "a").build(); + StringShape s = StringShape.builder().id("com.ex#S").build(); + MapShape map = MapShape.builder().id("com.ex#M").key(key.getId()).value(s.getId()).build(); + StructureShape req = StructureShape.builder().id("com.ex#R") + .addMember("Params", map.getId(), b -> b.addTrait(new HttpQueryParamsTrait())) + .build(); + Model m = Model.builder().addShapes(key, s, map, req).build(); + String out = render(req, m); + assertTrue(out.contains("for (auto& item : m_params) {"), out); + assertTrue(out.contains("ss << item.second;"), out); + assertTrue(out.contains( + "uri.AddQueryStringParameter(KeyEnumMapper::GetNameForKeyEnum(item.first).c_str(), ss.str());"), out); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 827178f250a..9879cc9a88e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -437,6 +437,23 @@ void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { "access-log tag member appended last"); } + @Test + void stampsCustomizedAccessLogTagMarkerAndKeepsQueryParams() { + Model m = accessLogModel(); + Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + + StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); + MemberShape tag = input.getMember("customizedAccessLogTag").orElseThrow(); + + // C2J models this member with a distinct customizedQuery flag; mirror that with the marker. + assertTrue(tag.hasTrait(CustomizedAccessLogTagTrait.class), + "injected member must carry the CustomizedAccessLogTag marker"); + // The marker is additive: @httpQueryParams must remain so the request still emits + // AddQueryStringParameters (RequestBindings.hasQueryStringMembers). + assertTrue(tag.hasTrait(software.amazon.smithy.model.traits.HttpQueryParamsTrait.class), + "customizedAccessLogTag must still carry @httpQueryParams alongside the marker"); + } + @Test void doesNotInjectCustomizedAccessLogTagIntoOutput() { Model m = accessLogModel(); From 40ad6dc7946db1e04e1d553cb2c0265e74f478fe Mon Sep 17 00:00:00 2001 From: sbaluja Date: Tue, 1 Sep 2026 16:47:09 -0400 Subject: [PATCH 34/53] glacier customizations and code cleanup --- .../generators/model/MemberRenderer.java | 3 +- .../generators/model/ModelCodegenPlugin.java | 4 +- .../model/protocol/JsonProtocolTraits.java | 8 +- .../model/protocol/ProtocolTraits.java | 9 + .../protocol/QueryXmlProtocolTraits.java | 10 +- .../AdditionalRequestHeadersTrait.java | 52 ++++++ .../model/transforms/Ec2Transforms.java | 13 +- .../model/transforms/GlacierTransforms.java | 104 +++++++++++ .../model/transforms/S3Transforms.java | 66 +++---- .../model/transforms/SqsTransforms.java | 14 +- .../model/transforms/TransformSupport.java | 40 +++++ .../protocol/JsonProtocolTraitsTest.java | 26 +++ .../ProtocolTraitsIncludeSetTest.java | 16 ++ .../transforms/GlacierTransformsTest.java | 162 ++++++++++++++++++ .../transforms/TransformSupportTest.java | 40 +++++ 15 files changed, 491 insertions(+), 76 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java index 72bdf30ea40..d12bfbe576f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java @@ -20,6 +20,7 @@ import software.amazon.smithy.model.traits.StreamingTrait; import java.util.Map; +import java.util.Optional; /** * Renders C++ accessor methods (Get/Set/With/Add) and private member fields @@ -127,7 +128,7 @@ public void renderPublicAccessors(CppWriter writer) { } else { // S3 checksum members (stamped by S3Transforms) also select the ChecksumAlgorithm enum // in their setter, matching C2J's ModelClassMembersAndInlines.vm isChecksumMember path. - java.util.Optional checksum = member.getTrait(ChecksumMemberTrait.class); + Optional checksum = member.getTrait(ChecksumMemberTrait.class); writer.write("template ", templateParam, cppType); writer.openBlock("void Set$L($L&& value) {", "}", methodName, templateParam, () -> { writer.write("$LHasBeenSet = true;", fieldName); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 5fe596ffbec..0079380c411 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -11,6 +11,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.DynamoDbTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlacierTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3ControlTransforms; @@ -62,7 +63,8 @@ public void execute(PluginContext context) { AccessAnalyzerTransforms.asTransform(), DynamoDbTransforms.asTransform(), S3Transforms.asTransform(), - S3ControlTransforms.asTransform() + S3ControlTransforms.asTransform(), + GlacierTransforms.asTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index eace0615ab8..fac78e66949 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -88,9 +88,10 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of(); - // Request sources additionally serialize @httpQuery members via the shared query - // serializer, which needs URI (AddQueryStringParameter) and StringUtils. These are - // added only here to avoid widening the other source kinds. + // Request sources additionally serialize @httpHeader/@httpQuery members via the shared + // serializers, which need URI (AddQueryStringParameter), StringUtils, and + // (std::accumulate for comma-joined list @httpHeader members). These are added only + // here to avoid widening the other source kinds. case REQUEST_SOURCE: return List.of( "aws/core/utils/json/JsonSerializer.h", @@ -99,6 +100,7 @@ public List serdeIncludes(FileKind kind) { "aws/core/utils/HashingUtils.h", "aws/core/utils/StringUtils.h", "aws/core/http/URI.h", + "numeric", "utility"); // All source kinds share one union (supersets allowed: a .cpp may carry an // include it doesn't strictly use). Usings are unchanged; only #includes widen. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index 4954d7fe277..f144e81d2e1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -9,6 +9,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestHeaderSerializer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestQuerySerializer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.AdditionalRequestHeadersTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; @@ -205,6 +206,14 @@ default void writeGetRequestSpecificHeadersImpl(CppWriter writer, String classNa writer.write("headers.insert(Aws::Http::HeaderValuePair(\"X-Amz-Target\", \"$L.$L\"));", service.getId().getName(), operation.getId().getName()); } + // Per-service constant request headers (C2J metadata.additionalHeaders, e.g. Glacier's + // x-amz-glacier-version). Streaming requests derive from AmazonStreamingWebServiceRequest + // and bypass Request::GetHeaders, so these are emitted here — matching + // StreamRequestSource.vm, which inserts them after X-Amz-Target and before the + // member-driven headers. The trait is stamped only on request shapes that need it. + shape.getTrait(AdditionalRequestHeadersTrait.class).ifPresent(trait -> + trait.getHeaders().forEach((name, value) -> + writer.write("headers.insert(Aws::Http::HeaderValuePair(\"$L\", \"$L\"));", name, value))); // C2J declares the stringstream once, immediately after `headers`, whenever the request // has ≥1 header member (even all-enum/timestamp members, which never use it). RPC // protocols route HTTP-binding members to the body, so neither the stringstream nor the diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java index 4fdd005e202..2d6be30a89c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java @@ -95,9 +95,10 @@ public List serdeIncludes(FileKind kind) { case RESULT_HEADER: // Query/EC2 result headers forward-declare XmlDocument; no serde include. return List.of(); - // Request sources additionally serialize @httpQuery members via the shared query - // serializer, which needs URI (AddQueryStringParameter), StringUtils, and the - // stringstream. URI.h is added only here to avoid widening the other source kinds. + // Request sources additionally serialize @httpHeader/@httpQuery members via the shared + // serializers, which need URI (AddQueryStringParameter), StringUtils, the stringstream, + // and (std::accumulate for comma-joined list @httpHeader members). URI.h is + // added only here to avoid widening the other source kinds. case REQUEST_SOURCE: return List.of( "aws/core/utils/xml/XmlSerializer.h", @@ -106,7 +107,8 @@ public List serdeIncludes(FileKind kind) { "aws/core/utils/StringUtils.h", "aws/core/utils/memory/stl/AWSStringStream.h", "aws/core/utils/HashingUtils.h", - "aws/core/http/URI.h"); + "aws/core/http/URI.h", + "numeric"); case SUBOBJECT_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java new file mode 100644 index 00000000000..5abe1607c67 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java @@ -0,0 +1,52 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.SourceLocation; +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.node.ObjectNode; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AbstractTrait; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Internal marker (never declared in any model file) placed by {@link GlacierTransforms} on each + * request structure that C2J attaches constant request headers to via + * {@code metadata.setAdditionalHeaders(...)}. It carries the ordered header name → value pairs + * (for Glacier, {@code x-amz-glacier-version} → the service API version). + * + *

C2J emits these headers from the {@code Request} base class ({@code GetHeaders}) for + * ordinary requests, but a streaming request derives from {@code AmazonStreamingWebServiceRequest} + * and bypasses that base, so {@code StreamRequestSource.vm} instead emits them inside the request's + * own {@code GetRequestSpecificHeaders}. The base class stays C2J-generated, so only the streaming + * requests carry this marker; request rendering turns it into the matching {@code headers.insert(...)} + * lines. Kept as a data-carrying marker + generic renderer rule so the renderer stays + * service-agnostic. + */ +public final class AdditionalRequestHeadersTrait extends AbstractTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#additionalRequestHeaders"); + + private final Map headers; + + public AdditionalRequestHeadersTrait(Map headers) { + super(ID, SourceLocation.NONE); + this.headers = Collections.unmodifiableMap(new LinkedHashMap<>(headers)); + } + + /** Ordered header name → value pairs, emitted verbatim into {@code GetRequestSpecificHeaders}. */ + public Map getHeaders() { + return headers; + } + + @Override + protected Node createNode() { + ObjectNode.Builder builder = Node.objectNodeBuilder(); + headers.forEach(builder::withMember); + return builder.build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java index 49d7cd1607a..c15df915a39 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java @@ -10,10 +10,8 @@ import software.amazon.smithy.model.shapes.BlobShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.ServiceShape; -import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; -import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.SensitiveTrait; import software.amazon.smithy.model.transform.ModelTransformer; @@ -146,15 +144,6 @@ private static Model renameResultShapesToResponse(Model model) { } private static Model addSpotInstanceStateDisabled(Model model) { - Optional enumShape = model.shapes() - .filter(s -> "SpotInstanceState".equals(s.getId().getName())) - .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) - .findFirst(); - if (enumShape.isEmpty()) { - return model; - } - return TransformSupport.appendValues(enumShape.get(), List.of("disabled")) - .map(updated -> model.toBuilder().addShape(updated).build()) - .orElse(model); + return TransformSupport.appendEnumValuesByName(model, "SpotInstanceState", List.of("disabled")); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java new file mode 100644 index 00000000000..bab9d7fe54f --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java @@ -0,0 +1,104 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpHeaderTrait; +import software.amazon.smithy.model.traits.HttpQueryTrait; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * Glacier parity with the legacy C2J {@code GlacierRestJsonCppClientGenerator} for the + * {@code Model::} namespace. C2J sets {@code metadata.additionalHeaders} to + * {@code {x-amz-glacier-version: }}, which the {@code Request} base class emits + * for ordinary requests. That base stays C2J-generated, so the only gap in the Smithy-generated + * model is the streaming requests ({@code UploadArchive}, {@code UploadMultipartPart}): they derive + * from {@code AmazonStreamingWebServiceRequest} and bypass the base {@code GetHeaders}, so C2J's + * {@code StreamRequestSource.vm} emits the constant header inside their own + * {@code GetRequestSpecificHeaders}. This stamps {@link AdditionalRequestHeadersTrait} on those + * streaming request inputs; request rendering turns it into the matching {@code headers.insert(...)}. + * Self-guards on the raw smithy service name and no-ops when the model has no streaming request. + */ +public final class GlacierTransforms { + + private static final String GLACIER_VERSION_HEADER = "x-amz-glacier-version"; + + private GlacierTransforms() {} + + public static ModelTransform asTransform() { + return GlacierTransforms::apply; + } + + private static Model apply(Model model, ServiceShape service) { + if (!"glacier".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { + return model; + } + return retypeLimitQueryMembersToString(addAdditionalHeaders(model, service), service); + } + + private static Model addAdditionalHeaders(Model model, ServiceShape service) { + Map additionalHeaders = new LinkedHashMap<>(); + additionalHeaders.put(GLACIER_VERSION_HEADER, service.getVersion()); + + List marked = new ArrayList<>(); + for (OperationShape operation : TopDownIndex.of(model).getContainedOperations(service)) { + if (ShapeClassifier.isRawStreamingPayloadRequest(operation, model)) { + StructureShape input = model.expectShape(operation.getInputShape(), StructureShape.class); + if (!input.hasTrait(AdditionalRequestHeadersTrait.class)) { + marked.add(input.toBuilder() + .addTrait(new AdditionalRequestHeadersTrait(additionalHeaders)).build()); + } + } + } + if (marked.isEmpty()) { + return model; // no streaming request present (idempotent / trimmed model). + } + return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); + } + + // Upstream Coral2Smithy's GlacierTransformer retypes every header/query `limit` (page-size) member + // from string to smithy.api#Integer, arguing the wire form (a query param) is unchanged. But the + // C++ SDK historically shipped these as Aws::String, so consuming the integer would break the + // public API (Aws::String GetLimit() -> int GetLimit()). This inverts the upstream retype for the + // header/query `limit` members, retargeting them back to the service string shape — matching C2J + // and the sibling string members (e.g. marker). Only these page-size members are query/header + // bound; body `limit` members (whose type change would alter serialization) are never retyped by + // Coral2Smithy and so are already string. Pagination is unaffected: the paginators continue via + // the `Marker` continuation token and never read or write `limit`. + private static Model retypeLimitQueryMembersToString(Model model, ServiceShape service) { + ShapeId stringTarget = ShapeId.fromParts(service.getId().getNamespace(), "string"); + if (!model.getShape(stringTarget).isPresent()) { + throw new IllegalStateException( + "Expected service string shape " + stringTarget + " to retype Glacier limit members"); + } + Set replacements = model.shapes(MemberShape.class) + .filter(member -> member.getMemberName().equals("limit")) + .filter(member -> member.hasTrait(HttpQueryTrait.ID) || member.hasTrait(HttpHeaderTrait.ID)) + .filter(member -> !model.expectShape(member.getTarget()).isStringShape()) + .map(member -> member.toBuilder().target(stringTarget).build()) + .collect(Collectors.toSet()); + if (replacements.isEmpty()) { + return model; // already string (idempotent / upstream stopped retyping). + } + return ModelTransformer.create().replaceShapes(model, new ArrayList<>(replacements)); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 61fcfffdd21..4abbb61b85e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -23,7 +23,6 @@ import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.TimestampShape; import software.amazon.smithy.model.traits.DocumentationTrait; -import software.amazon.smithy.model.traits.EnumTrait; import software.amazon.smithy.model.traits.HttpHeaderTrait; import software.amazon.smithy.model.traits.HttpQueryParamsTrait; import software.amazon.smithy.model.traits.UnitTypeTrait; @@ -115,16 +114,17 @@ private static Model markChecksumMembers(Model model, ServiceShape service) { CHECKSUM_MEMBERS_ENUMS.containsKey(m.getTarget().getName()) && !m.hasTrait(ChecksumMemberTrait.class)); if (needsStamp) { - StructureShape.Builder b = StructureShape.builder().id(req.getId()); - req.getAllTraits().values().forEach(b::addTrait); + // Re-add only the checksum members with the marker; addMember replaces in place, so + // the other members (and the shape's traits/source) carry over untouched via toBuilder. + StructureShape.Builder b = req.toBuilder(); for (MemberShape m : req.getAllMembers().values()) { String enumValue = CHECKSUM_MEMBERS_ENUMS.get(m.getTarget().getName()); - b.addMember(m.getMemberName(), m.getTarget(), mb -> { - m.getAllTraits().values().forEach(mb::addTrait); - if (enumValue != null && !m.hasTrait(ChecksumMemberTrait.class)) { + if (enumValue != null && !m.hasTrait(ChecksumMemberTrait.class)) { + b.addMember(m.getMemberName(), m.getTarget(), mb -> { + m.getAllTraits().values().forEach(mb::addTrait); mb.addTrait(new ChecksumMemberTrait(enumValue)); - } - }); + }); + } } replacements.add(b.build()); } @@ -275,16 +275,8 @@ private static Model normalizeReplicationStatus(Model model) { private static final List MISSING_REGIONS = List.of("us-iso-west-1", "us-east-1"); private static Model expandBucketLocationConstraint(Model model) { - Optional enumShape = model.shapes() - .filter(s -> "BucketLocationConstraint".equals(s.getId().getName())) - .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) - .findFirst(); - if (enumShape.isEmpty()) { - return model; - } - return TransformSupport.appendEnumValues(enumShape.get(), regionNameValueMap()) - .map(updated -> model.toBuilder().addShape(updated).build()) - .orElse(model); + return TransformSupport.appendEnumEntriesByName( + model, "BucketLocationConstraint", regionNameValueMap()); } private static Map regionNameValueMap() { @@ -313,14 +305,11 @@ private static Model hackGetObjectResult(Model model) { ShapeId id2ShapeId = ShapeId.fromParts(ns, "ObjectId2"); StringShape id2Shape = StringShape.builder().id(id2ShapeId).build(); - StructureShape.Builder b = StructureShape.builder().id(output.getId()); - output.getAllTraits().values().forEach(b::addTrait); - output.getAllMembers().values().forEach(m -> - b.addMember(m.getMemberName(), m.getTarget(), - mb -> m.getAllTraits().values().forEach(mb::addTrait))); - b.addMember("Id2", id2ShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-id-2"))); + StructureShape withId2 = output.toBuilder() + .addMember("Id2", id2ShapeId, mb -> mb.addTrait(new HttpHeaderTrait("x-amz-id-2"))) + .build(); - return model.toBuilder().addShapes(id2Shape, b.build()).build(); + return model.toBuilder().addShapes(id2Shape, withId2).build(); } // C2J renames both the CopyObjectResult domain shape (to CopyObjectResultDetails) and the @@ -380,23 +369,16 @@ private static Model addExpiresCustomization(Model model, ServiceShape service) // Only customize structs that lack ExpiresString (idempotent). if (struct.getMember("ExpiresString").isEmpty()) { MemberShape expires = struct.getAllMembers().get("Expires"); - StructureShape.Builder b = StructureShape.builder().id(struct.getId()); - struct.getAllTraits().values().forEach(b::addTrait); - for (MemberShape m : struct.getAllMembers().values()) { - if (m.getMemberName().equals("Expires")) { - // Rewrite Expires' documentation to prepend the deprecation note. - String existingDoc = m.getTrait(DocumentationTrait.class) - .map(DocumentationTrait::getValue).orElse(""); - b.addMember("Expires", m.getTarget(), mb -> { - m.getAllTraits().values().forEach(mb::addTrait); - if (!existingDoc.toLowerCase().contains("deprecated")) { - mb.addTrait(new DocumentationTrait(EXPIRES_DEPRECATION + existingDoc)); - } - }); - } else { - b.addMember(m.getMemberName(), m.getTarget(), - mb -> m.getAllTraits().values().forEach(mb::addTrait)); - } + StructureShape.Builder b = struct.toBuilder(); + // Prepend the deprecation note to Expires' documentation (idempotent); addMember + // replaces the member in place, and adding a DocumentationTrait supersedes the old one. + String existingDoc = expires.getTrait(DocumentationTrait.class) + .map(DocumentationTrait::getValue).orElse(""); + if (!existingDoc.toLowerCase().contains("deprecated")) { + b.addMember("Expires", expires.getTarget(), mb -> { + expires.getAllTraits().values().forEach(mb::addTrait); + mb.addTrait(new DocumentationTrait(EXPIRES_DEPRECATION + existingDoc)); + }); } // Add ExpiresString cloning Expires' traits (so it reads the same header), retargeted. b.addMember("ExpiresString", expiresStringId, diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java index 68d55f1c46e..4c6698b8f6c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java @@ -8,11 +8,8 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ServiceShape; -import software.amazon.smithy.model.shapes.Shape; -import software.amazon.smithy.model.traits.EnumTrait; import java.util.List; -import java.util.Optional; /** * Adds the unmodeled {@code QueueAttributeName} enum values that the legacy C2J @@ -35,15 +32,6 @@ private static Model apply(Model model, ServiceShape service) { if (!"sqs".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { return model; } - Optional target = model.shapes() - .filter(s -> ENUM_NAME.equals(s.getId().getName())) - .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) - .findFirst(); - if (target.isEmpty()) { - return model; - } - return TransformSupport.appendValues(target.get(), ADDED_VALUES) - .map(updated -> model.toBuilder().addShape(updated).build()) - .orElse(model); + return TransformSupport.appendEnumValuesByName(model, ENUM_NAME, ADDED_VALUES); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java index 54c585aa68c..3d6df1ca2cf 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -7,6 +7,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.EnumRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; +import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; @@ -142,6 +143,45 @@ static Optional appendEnumValues(Shape enumShape, Map nam .build()); } + /** + * Locates an enum shape by its simple (relative) name and appends the given identifier-safe wire + * {@code values}, returning the model with the updated shape — or unchanged when the shape is + * absent or every value is already present. Wraps the per-service pattern of adding unmodeled + * enum values; see {@link #appendValues} for the identifier-safe precondition on {@code values}. + * + *

The lookup matches the first shape whose relative name equals {@code simpleName} and which + * is an enum (Smithy 2.0 {@code EnumShape} or a legacy {@code StringShape} with an {@code @enum} + * trait). Callers are expected to have already scoped generation to a single service. + */ + static Model appendEnumValuesByName(Model model, String simpleName, List values) { + return findEnumByName(model, simpleName) + .flatMap(shape -> appendValues(shape, values)) + .map(updated -> model.toBuilder().addShape(updated).build()) + .orElse(model); + } + + /** + * Locates an enum shape by its simple (relative) name and appends the given {@code member-name -> + * wire-value} entries (allowing non-identifier-safe wire values, e.g. region strings), returning + * the model with the updated shape — or unchanged when the shape is absent or every value is + * already present. Wraps the per-service pattern; see {@link #appendEnumValues} for the + * member-name precondition and value semantics. + */ + static Model appendEnumEntriesByName(Model model, String simpleName, Map nameToValue) { + return findEnumByName(model, simpleName) + .flatMap(shape -> appendEnumValues(shape, nameToValue)) + .map(updated -> model.toBuilder().addShape(updated).build()) + .orElse(model); + } + + /** The first enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code @enum}) whose relative name matches. */ + private static Optional findEnumByName(Model model, String simpleName) { + return model.shapes() + .filter(s -> simpleName.equals(s.getId().getName())) + .filter(s -> s.isEnumShape() || s.hasTrait(EnumTrait.class)) + .findFirst(); + } + /** The current wire values of an enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code @enum}). */ private static List existingWireValues(Shape enumShape) { if (enumShape.isEnumShape()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 9590f2f830d..1a1957d5568 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -204,6 +204,32 @@ void restJson_headerMember_isWireSerialized() { assertTrue(i.contains("headers.emplace(\"x-h\", ss.str());"), i); } + @Test + void restJson_additionalHeadersTrait_emitsConstantHeaderBeforeMemberHeaders() { + // A streaming request marked with AdditionalRequestHeadersTrait (Glacier's + // x-amz-glacier-version) emits the constant header inside GetRequestSpecificHeaders, + // ordered after any X-Amz-Target and before the member-driven headers (StreamRequestSource.vm). + var req = reqWith(true, false).toBuilder() + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms + .AdditionalRequestHeadersTrait(java.util.Map.of("x-amz-glacier-version", "2012-06-01"))) + .build(); + var model = modelWith(req); + String i = render(w -> restJson.writeRequestMethodImpls( + w, "UploadArchiveRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains( + "headers.insert(Aws::Http::HeaderValuePair(\"x-amz-glacier-version\", \"2012-06-01\"));"), i); + assertTrue(i.indexOf("x-amz-glacier-version") < i.indexOf("Aws::StringStream ss;"), + "constant header precedes the member-driven headers: " + i); + } + + @Test + void restJson_noAdditionalHeadersTrait_emitsNoConstantHeader() { + var req = reqWith(true, false); var model = modelWith(req); + String i = render(w -> restJson.writeRequestMethodImpls( + w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertFalse(i.contains("x-amz-glacier-version"), i); + } + @Test void restJson_queryMember_isWireSerialized() { var req = reqWith(false, true); var model = modelWith(req); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java index d0b31058eba..e9a42e13787 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java @@ -47,6 +47,22 @@ void queryXml_subobjectHeader_hasStreamFwd() { q.serdeIncludes(FileKind.SUBOBJECT_HEADER).toString()); } + @Test + void requestSource_everyProtocolIncludesNumericForListHeaderAccumulate() { + // RequestHeaderSerializer emits std::accumulate for list-typed @httpHeader members and is + // protocol-agnostic, so every protocol's REQUEST_SOURCE must declare . Guards the + // JSON/QueryXml regression where only RestXml carried it (relying on transitive includes). + for (ProtocolTraits t : List.of( + new JsonProtocolTraits(Protocol.JSON), + new JsonProtocolTraits(Protocol.REST_JSON), + new QueryXmlProtocolTraits(Protocol.QUERY_XML), + new QueryXmlProtocolTraits(Protocol.EC2), + new RestXmlProtocolTraits())) { + List inc = t.serdeIncludes(FileKind.REQUEST_SOURCE); + assertTrue(inc.contains("numeric"), t.protocol() + " REQUEST_SOURCE: " + inc); + } + } + @Test void restXml_requestSource_hasUtilityAndXmlSerializer() { ProtocolTraits x = new RestXmlProtocolTraits(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java new file mode 100644 index 00000000000..2aba1d64a30 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java @@ -0,0 +1,162 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.BlobShape; +import software.amazon.smithy.model.shapes.IntegerShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpPayloadTrait; +import software.amazon.smithy.model.traits.HttpQueryTrait; +import software.amazon.smithy.model.traits.StreamingTrait; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class GlacierTransformsTest { + + static final String NS = "com.amazonaws.glacier"; + + private static ServiceShape glacierService(String sdkId, OperationShape... operations) { + ServiceShape.Builder b = ServiceShape.builder().id(NS + "#Glacier").version("2012-06-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("glacier") + .cloudFormationName("Glacier").cloudTrailEventSource("glacier.amazonaws.com").build()); + for (OperationShape op : operations) { + b.addOperation(op.getId()); + } + return b.build(); + } + + // A raw streaming-payload request: input struct with an @httpPayload member targeting a + // @streaming blob (matches Glacier's UploadArchive/UploadMultipartPart body member). + private static StructureShape streamingInput(String name) { + return StructureShape.builder().id(NS + "#" + name) + .addMember(MemberShape.builder().id(NS + "#" + name + "$body") + .target(NS + "#Stream").addTrait(new HttpPayloadTrait()).build()) + .build(); + } + + private static StructureShape plainInput(String name) { + return StructureShape.builder().id(NS + "#" + name) + .addMember(MemberShape.builder().id(NS + "#" + name + "$vaultName") + .target("smithy.api#String").build()) + .build(); + } + + // A paginateable request: input struct with an integer @httpQuery `limit` (page-size) member, + // matching the type Coral2Smithy's GlacierTransformer produces upstream. + private static StructureShape queryLimitInput(String name) { + return StructureShape.builder().id(NS + "#" + name) + .addMember(MemberShape.builder().id(NS + "#" + name + "$limit") + .target(NS + "#intType").addTrait(new HttpQueryTrait("limit")).build()) + .build(); + } + + private static OperationShape op(String name, StructureShape input) { + return OperationShape.builder().id(NS + "#" + name).input(input.getId()).build(); + } + + private static Model modelWith(ServiceShape svc, software.amazon.smithy.model.shapes.Shape... shapes) { + Model.Builder b = Model.builder().addShape(svc) + .addShape(BlobShape.builder().id(NS + "#Stream").addTrait(new StreamingTrait()).build()) + // The service string shape the limit retype retargets to (siblings like marker use it). + .addShape(StringShape.builder().id(NS + "#string").build()) + .addShape(IntegerShape.builder().id(NS + "#intType").build()) + .addShape(StringShape.builder().id("smithy.api#String").build()); + for (software.amazon.smithy.model.shapes.Shape s : shapes) { + b.addShape(s); + } + return b.build(); + } + + @Test + void noOpForOtherService() { + ServiceShape svc = ServiceShape.builder().id("com.amazonaws.other#Other").version("1") + .addTrait(ServiceTrait.builder().sdkId("Other").arnNamespace("other") + .cloudFormationName("Other").cloudTrailEventSource("other").build()).build(); + Model m = Model.builder().addShape(svc).build(); + Model out = GlacierTransforms.asTransform().apply(m, svc); + assertSame(m, out, "non-glacier service must be untouched"); + } + + @Test + void stampsVersionHeaderOnStreamingRequestInputs() { + StructureShape upload = streamingInput("UploadArchiveInput"); + OperationShape uploadOp = op("UploadArchive", upload); + ServiceShape svc = glacierService("Glacier", uploadOp); + Model out = GlacierTransforms.asTransform().apply(modelWith(svc, upload, uploadOp), svc); + + AdditionalRequestHeadersTrait trait = out + .expectShape(ShapeId.from(NS + "#UploadArchiveInput"), StructureShape.class) + .getTrait(AdditionalRequestHeadersTrait.class) + .orElseThrow(() -> new AssertionError("streaming request input must carry the trait")); + assertEquals(1, trait.getHeaders().size()); + assertEquals("2012-06-01", trait.getHeaders().get("x-amz-glacier-version"), + "header value is the service API version"); + } + + @Test + void doesNotStampNonStreamingRequestInputs() { + StructureShape plain = plainInput("CompleteVaultLockInput"); + OperationShape plainOp = op("CompleteVaultLock", plain); + ServiceShape svc = glacierService("Glacier", plainOp); + Model out = GlacierTransforms.asTransform().apply(modelWith(svc, plain, plainOp), svc); + + assertFalse(out.expectShape(ShapeId.from(NS + "#CompleteVaultLockInput"), StructureShape.class) + .hasTrait(AdditionalRequestHeadersTrait.class), + "non-streaming request input must not carry the trait"); + } + + @Test + void retypesQueryLimitMemberBackToString() { + StructureShape listJobs = queryLimitInput("ListJobsInput"); + OperationShape listJobsOp = op("ListJobs", listJobs); + ServiceShape svc = glacierService("Glacier", listJobsOp); + Model out = GlacierTransforms.asTransform().apply(modelWith(svc, listJobs, listJobsOp), svc); + + MemberShape limit = out.expectShape(ShapeId.from(NS + "#ListJobsInput"), StructureShape.class) + .getMember("limit").orElseThrow(); + assertEquals(NS + "#string", limit.getTarget().toString(), + "query limit member retargeted to the service string shape"); + assertTrue(out.expectShape(limit.getTarget()).isStringShape(), "target is a string shape"); + } + + @Test + void leavesQueryLimitUnchangedWhenAlreadyString() { + StructureShape listJobs = StructureShape.builder().id(NS + "#ListJobsInput") + .addMember(MemberShape.builder().id(NS + "#ListJobsInput$limit") + .target(NS + "#string").addTrait(new HttpQueryTrait("limit")).build()) + .build(); + OperationShape listJobsOp = op("ListJobs", listJobs); + ServiceShape svc = glacierService("Glacier", listJobsOp); + Model out = GlacierTransforms.asTransform().apply(modelWith(svc, listJobs, listJobsOp), svc); + + MemberShape limit = out.expectShape(ShapeId.from(NS + "#ListJobsInput"), StructureShape.class) + .getMember("limit").orElseThrow(); + assertEquals(NS + "#string", limit.getTarget().toString(), "already-string limit is untouched"); + } + + @Test + void isIdempotent() { + StructureShape upload = streamingInput("UploadArchiveInput"); + OperationShape uploadOp = op("UploadArchive", upload); + ServiceShape svc = glacierService("Glacier", uploadOp); + Model once = GlacierTransforms.asTransform().apply(modelWith(svc, upload, uploadOp), svc); + Model twice = GlacierTransforms.asTransform().apply(once, svc); + + assertTrue(twice.expectShape(ShapeId.from(NS + "#UploadArchiveInput"), StructureShape.class) + .hasTrait(AdditionalRequestHeadersTrait.class), + "re-applying keeps a single trait without error"); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java index f16b7f325c8..86f54fbb4de 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupportTest.java @@ -7,6 +7,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; import org.junit.jupiter.api.Test; import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; +import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.Shape; @@ -178,6 +179,45 @@ void appendEnumValues_nonIdentifierMemberName_throws() { () -> TransformSupport.appendEnumValues(shape, map("us-east-1", "us-east-1"))); } + @Test + void appendEnumValuesByName_appendsToNamedEnum() { + EnumShape state = EnumShape.builder().id("com.example#SpotInstanceState") + .addMember("open", "open").build(); + Model out = TransformSupport.appendEnumValuesByName( + Model.builder().addShape(state).build(), "SpotInstanceState", List.of("disabled")); + EnumShape e = out.expectShape(state.getId()).asEnumShape().orElseThrow(); + assertTrue(e.getEnumValues().values().contains("disabled"), "value appended"); + assertTrue(e.getEnumValues().values().contains("open"), "existing value preserved"); + } + + @Test + void appendEnumValuesByName_shapeAbsent_returnsSameModel() { + EnumShape other = EnumShape.builder().id("com.example#Other").addMember("a", "a").build(); + Model in = Model.builder().addShape(other).build(); + assertSame(in, TransformSupport.appendEnumValuesByName(in, "Missing", List.of("x")), + "absent enum: the model is returned unchanged"); + } + + @Test + void appendEnumValuesByName_allValuesPresent_returnsSameModel() { + EnumShape state = EnumShape.builder().id("com.example#S").addMember("a", "a").build(); + Model in = Model.builder().addShape(state).build(); + assertSame(in, TransformSupport.appendEnumValuesByName(in, "S", List.of("a")), + "idempotent: no new values means the model is returned unchanged"); + } + + @Test + void appendEnumEntriesByName_appendsHyphenatedRegionValue() { + EnumShape region = EnumShape.builder().id("com.example#BucketLocationConstraint") + .addMember("us_west_2", "us-west-2").build(); + Model out = TransformSupport.appendEnumEntriesByName( + Model.builder().addShape(region).build(), "BucketLocationConstraint", + map("us_east_1", "us-east-1")); + EnumShape e = out.expectShape(region.getId()).asEnumShape().orElseThrow(); + assertTrue(e.getEnumValues().values().contains("us-east-1"), "hyphenated value appended"); + assertTrue(e.getAllMembers().containsKey("us_east_1"), "identifier-safe member name"); + } + @Test void renameMember_existingJsonName_isNotOverridden() { StructureShape s = StructureShape.builder().id("com.example#Req") From e5348394df20fa6aed1688ff6b305e160d755473 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Tue, 1 Sep 2026 17:04:46 -0400 Subject: [PATCH 35/53] Smithy: emit request DumpBodyToUrl override protocol-agnostically --- .../generators/model/ModelCodegenPlugin.java | 4 +- .../model/protocol/JsonProtocolTraits.java | 9 ++ .../protocol/QueryXmlProtocolTraits.java | 15 +-- .../model/renderers/RequestRenderer.java | 15 +++ .../transforms/SupportsPresigningTrait.java | 27 ++++++ .../SupportsPresigningTransform.java | 58 ++++++++++++ .../ProtocolTraitsCharacterizationTest.java | 12 ++- .../generators/model/RequestRendererTest.java | 37 ++++++++ .../protocol/JsonProtocolTraitsTest.java | 25 +++++ .../model/protocol/XmlProtocolTraitsTest.java | 14 +-- .../SupportsPresigningTransformTest.java | 92 +++++++++++++++++++ 11 files changed, 286 insertions(+), 22 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 0079380c411..6714c7a0dd9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -18,6 +18,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SqsTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTransform; import software.amazon.smithy.build.PluginContext; import software.amazon.smithy.build.SmithyBuildPlugin; import software.amazon.smithy.model.Model; @@ -64,7 +65,8 @@ public void execute(PluginContext context) { DynamoDbTransforms.asTransform(), S3Transforms.asTransform(), S3ControlTransforms.asTransform(), - GlacierTransforms.asTransform() + GlacierTransforms.asTransform(), + SupportsPresigningTransform.asTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index fac78e66949..a8e2370b0c4 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -6,6 +6,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -212,5 +213,13 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className, shape, model); } + // A presignable request (e.g. Polly's SynthesizeSpeech) declares the protocol-agnostic + // DumpBodyToUrl override (emitted by RequestRenderer); the real body defers with serde, as + // SerializePayload does, so this is a stub. UnreferencedParam.h is in serdeIncludes(REQUEST_SOURCE). + if (shape.hasTrait(SupportsPresigningTrait.class)) { + writer.write(""); + writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }", + className); + } } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java index 2d6be30a89c..84c9baf6906 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java @@ -216,18 +216,9 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, writer.write(""); writeAddQueryStringParametersDecl(writer, exportMacro); } - writer.write(""); - // DumpBodyToUrl is a protected virtual in AmazonWebServiceRequest, so the override - // is bracketed under protected: and the section restored to public: afterwards, - // matching the legacy C2J layout. - writer.dedent(); - writer.write("protected:"); - writer.indent(); - writer.write("$L void DumpBodyToUrl(Aws::Http::URI& uri) const override;", exportMacro); - writer.dedent(); - writer.write(""); - writer.write("public:"); - writer.indent(); + // The protected DumpBodyToUrl override declaration is emitted protocol-agnostically by + // RequestRenderer (gated on SupportsPresigningTrait), which all query/ec2 requests carry; + // only the impl below is protocol-specific. } @Override diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 1189ffffa7e..84680e5fbeb 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -15,6 +15,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.RequestInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.SmithyEndpointsJmesPathVisitor; import software.amazon.smithy.jmespath.JmespathExpression; @@ -150,6 +151,20 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.write("$L std::shared_ptr GetBody() const override;", ctx.exportMacro()); } ctx.protocolTraits().writeRequestMethodDecls(writer, ctx.exportMacro(), shape, operation, ctx.model()); + // DumpBodyToUrl is emitted protocol-agnostically (C2J RequestHeader.vm gates it only on + // $shape.supportsPresigning). It is a protected virtual in AmazonWebServiceRequest, so the + // override is bracketed under protected: and the section restored to public: afterwards. + if (shape.hasTrait(SupportsPresigningTrait.class)) { + writer.write(""); + writer.dedent(); + writer.write("protected:"); + writer.indent(); + writer.write("$L void DumpBodyToUrl(Aws::Http::URI& uri) const override;", ctx.exportMacro()); + writer.dedent(); + writer.write(""); + writer.write("public:"); + writer.indent(); + } // Request-feature methods driven by operation traits, in C2J RequestHeader.vm order: // @httpChecksum, @httpChecksumRequired (legacy Content-MD5), then @requestCompression. renderChecksumDecls(writer, shape, operation); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java new file mode 100644 index 00000000000..8dd4b6eaa04 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java @@ -0,0 +1,27 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link SupportsPresigningTransform} + * on each request structure that C2J's generators flag with {@code shape.setSupportsPresigning(true)} + * (every query/ec2 request via {@code QueryCppClientGenerator}, plus Polly's {@code SynthesizeSpeech}). + * C2J's shared {@code RequestHeader.vm} emits the protected {@code DumpBodyToUrl(Aws::Http::URI&)} + * override under {@code #if($shape.supportsPresigning())}, independent of protocol; request rendering + * turns this marker into that same protected override so the declaration stays protocol-agnostic + * while each protocol supplies only the method body. Kept as a marker + generic renderer rule (not a + * service-name {@code if}) so the renderer stays service-agnostic. + */ +public final class SupportsPresigningTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#supportsPresigning"); + + public SupportsPresigningTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java new file mode 100644 index 00000000000..2b048b687cf --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java @@ -0,0 +1,58 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.traits.UnitTypeTrait; + +import java.util.ArrayList; +import java.util.List; + +/** + * Stamps the internal {@link SupportsPresigningTrait} onto the request structures that C2J flags + * with {@code shape.setSupportsPresigning(true)}, so the protocol-agnostic {@code DumpBodyToUrl} + * override is emitted by request rendering. C2J's {@code QueryCppClientGenerator} sets the flag on + * every query/ec2 request; Polly additionally sets it on {@code SynthesizeSpeech}. No-op for any + * other service, leaving the model instance untouched. + */ +public final class SupportsPresigningTransform { + + private SupportsPresigningTransform() {} + + public static ModelTransform asTransform() { + return SupportsPresigningTransform::apply; + } + + private static Model apply(Model model, ServiceShape service) { + Protocol protocol = ProtocolResolver.resolve(service, model); + boolean queryLike = protocol == Protocol.QUERY_XML || protocol == Protocol.EC2; + boolean polly = "polly".equals(ServiceNameUtil.getSmithyServiceName(service, null)); + if (!queryLike && !polly) { + return model; + } + List updated = new ArrayList<>(); + for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + boolean target = queryLike + ? !op.getInputShape().equals(UnitTypeTrait.UNIT) + : "SynthesizeSpeech".equals(op.getId().getName()); + if (target) { + model.getShape(op.getInputShape()).flatMap(Shape::asStructureShape) + .filter(s -> !s.hasTrait(SupportsPresigningTrait.class)) + .ifPresent(s -> updated.add( + s.toBuilder().addTrait(new SupportsPresigningTrait()).build())); + } + } + return updated.isEmpty() ? model + : model.toBuilder().addShapes(updated.toArray(new Shape[0])).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java index 2936fe29d35..921e61d5e2b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java @@ -74,7 +74,7 @@ private static Model modelFor(Protocol p) { .build(); // Input carries a plain member, an httpHeader member, and an httpQuery member so // both request Axis-1 predicates (header + query) fire. - StructureShape input = StructureShape.builder() + StructureShape.Builder inputBuilder = StructureShape.builder() .id("com.example#DoThingInput") .addMember("name", str.getId()) .addMember("nested", nested.getId()) @@ -83,8 +83,14 @@ private static Model modelFor(Protocol p) { .addTrait(new software.amazon.smithy.model.traits.HttpHeaderTrait("X-Thing")).build()) .addMember(software.amazon.smithy.model.shapes.MemberShape.builder() .id("com.example#DoThingInput$q").target(str.getId()) - .addTrait(new software.amazon.smithy.model.traits.HttpQueryTrait("q")).build()) - .build(); + .addTrait(new software.amazon.smithy.model.traits.HttpQueryTrait("q")).build()); + // SupportsPresigningTransform stamps every query/ec2 request; mirror it in the fixture so this + // end-to-end characterization pins the same post-transform output (protected DumpBodyToUrl decl). + if (p == Protocol.QUERY_XML || p == Protocol.EC2) { + inputBuilder.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model + .transforms.SupportsPresigningTrait()); + } + StructureShape input = inputBuilder.build(); // Output carries a plain member and an httpResponseCode member. StructureShape output = StructureShape.builder() .id("com.example#DoThingOutput") diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 23127963a4e..556066faf67 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -9,6 +9,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.RenderContext; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.RequestRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import org.junit.jupiter.api.Test; import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; @@ -142,6 +143,42 @@ void withoutOverrideStreamingTrait_omitsIsStreaming() { "unmarked requests must not emit IsStreaming: " + h); } + private static Model supportsPresigningModel(boolean marked) { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape.Builder inB = StructureShape.builder() + .id("com.example#DoThingRequest").addMember("name", str.getId()); + if (marked) { + inB.addTrait(new SupportsPresigningTrait()); + } + StructureShape input = inB.build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void supportsPresigningTrait_emitsProtectedDumpBodyToUrlOverride() { + // C2J's RequestHeader.vm emits DumpBodyToUrl protocol-agnostically under + // #if($shape.supportsPresigning()); the marker drives the same protected override here. + String h = renderDoThingRequestHeader(supportsPresigningModel(true)); + assertTrue(h.contains("protected:"), "presignable request must open a protected: section: " + h); + assertTrue(h.contains( + "AWS_EXAMPLE_API void DumpBodyToUrl(Aws::Http::URI& uri) const override;"), + "presignable request must declare the DumpBodyToUrl override: " + h); + assertTrue(h.contains("public:"), "presignable request must restore public: afterwards: " + h); + } + + @Test + void withoutSupportsPresigningTrait_omitsDumpBodyToUrl() { + String h = renderDoThingRequestHeader(supportsPresigningModel(false)); + assertFalse(h.contains("DumpBodyToUrl"), + "unmarked requests must not declare DumpBodyToUrl: " + h); + } + @Test void streamingResponseRequest_hasEventStreamAugmentation() { // Model: operation with streaming OUTPUT only (like SubscribeToShard / ConverseStream) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 1a1957d5568..daad7f4a1f2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -239,6 +239,31 @@ void restJson_queryMember_isWireSerialized() { assertTrue(i.contains("uri.AddQueryStringParameter(\"q\", ss.str());"), i); } + @Test + void supportsPresigning_emitsDumpBodyToUrlStubImpl() { + // A presignable request (Polly SynthesizeSpeech) carries SupportsPresigningTrait; the decl is + // emitted by RequestRenderer, and JsonProtocolTraits supplies a stub impl that defers serde. + var req = reqWith(false, false).toBuilder() + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms + .SupportsPresigningTrait()) + .build(); + var model = modelWith(req); + String i = render(w -> restJson.writeRequestMethodImpls( + w, "SynthesizeSpeechRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains( + "void SynthesizeSpeechRequest::DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }"), + i); + } + + @Test + void withoutSupportsPresigning_omitsDumpBodyToUrlImpl() { + var req = reqWith(false, false); var model = modelWith(req); + String i = render(w -> restJson.writeRequestMethodImpls( + w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertFalse(i.contains("DumpBodyToUrl"), + "non-presignable request must not emit a DumpBodyToUrl impl: " + i); + } + @Test void payloadStubs_areProtocolAgnostic() { String event = render(w -> json.writeEventPayloadDecode(w, "ShardEvent", "m_onShardEvent")); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index 31336b33e23..ea9d11d1241 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -272,14 +272,15 @@ void restXml_withoutEmbeddedErrorsTrait_omitsHasEmbeddedError() { // ---------- Query/EC2 request contract (Axis-1 gating + protected DumpBodyToUrl) ---------- @Test - void queryXml_serializePayloadAndProtectedDumpBodyToUrl() { + void queryXml_serializePayloadAndDumpBodyToUrlImpl() { + // The DumpBodyToUrl DECL is now emitted protocol-agnostically by RequestRenderer (gated on + // SupportsPresigningTrait), so the query traits' decls no longer carry it; only the IMPL is here. var req = reqWith(false, false); var model = modelWith(req); ProtocolTraits q = new QueryXmlProtocolTraits(Protocol.QUERY_XML); String d = renderInClassBody(w -> q.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); assertTrue(d.contains("Aws::String SerializePayload() const override;"), d); - assertTrue(d.contains("void DumpBodyToUrl(Aws::Http::URI& uri) const override;"), d); - assertTrue(d.contains("protected:"), d); - assertTrue(d.contains("public:"), d); + assertFalse(d.contains("DumpBodyToUrl"), + "DumpBodyToUrl decl moved to RequestRenderer; query traits must not emit it: " + d); assertFalse(d.contains("GetRequestSpecificHeaders"), d); String i = render(w -> q.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); assertTrue(i.contains("Aws::String DoThingRequest::SerializePayload() const { return {}; }"), i); @@ -287,12 +288,13 @@ void queryXml_serializePayloadAndProtectedDumpBodyToUrl() { } @Test - void queryXml_withHeaderMember_alsoEmitsHeaders_andStillDumpBodyToUrl() { + void queryXml_withHeaderMember_alsoEmitsHeaders() { var req = reqWith(true, false); var model = modelWith(req); ProtocolTraits q = new QueryXmlProtocolTraits(Protocol.QUERY_XML); String d = renderInClassBody(w -> q.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); assertTrue(d.contains("GetRequestSpecificHeaders() const override;"), d); - assertTrue(d.contains("DumpBodyToUrl"), d); + assertFalse(d.contains("DumpBodyToUrl"), + "DumpBodyToUrl decl moved to RequestRenderer; query traits must not emit it: " + d); } // ---------- Query/EC2 result ResponseMetadata / requestId extraction ---------- diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java new file mode 100644 index 00000000000..239b957d0ad --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java @@ -0,0 +1,92 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.aws.traits.protocols.AwsQueryTrait; +import software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait; +import software.amazon.smithy.aws.traits.protocols.RestJson1Trait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.Trait; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class SupportsPresigningTransformTest { + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + private static boolean stamped(Model m, String requestShapeName) { + return m.expectShape(ShapeId.from("com.example#" + requestShapeName), StructureShape.class) + .hasTrait(SupportsPresigningTrait.class); + } + + /** Two operations (each with a distinct input) under a service carrying {@code protocolTrait}. */ + private static Model twoOpModel(Trait protocolTrait, ServiceTrait serviceTrait, + String opAName, String opBName) { + StructureShape inA = StructureShape.builder().id("com.example#" + opAName + "Request").build(); + StructureShape inB = StructureShape.builder().id("com.example#" + opBName + "Request").build(); + OperationShape opA = OperationShape.builder() + .id("com.example#" + opAName).input(inA.getId()).build(); + OperationShape opB = OperationShape.builder() + .id("com.example#" + opBName).input(inB.getId()).build(); + ServiceShape.Builder svc = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(protocolTrait) + .addOperation(opA.getId()).addOperation(opB.getId()); + if (serviceTrait != null) { + svc.addTrait(serviceTrait); + } + return Model.assembler().addShapes(inA, inB, opA, opB, svc.build()).assemble().unwrap(); + } + + private static ServiceTrait pollyServiceTrait() { + return ServiceTrait.builder().sdkId("polly").arnNamespace("polly") + .cloudFormationName("Polly").cloudTrailEventSource("polly").build(); + } + + @Test + void queryXmlService_stampsEveryOperationInput() { + Model m = twoOpModel(new AwsQueryTrait(), null, "GetUser", "CreateUser"); + Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "GetUserRequest"), "query input must be stamped"); + assertTrue(stamped(out, "CreateUserRequest"), "query input must be stamped"); + } + + @Test + void ec2Service_stampsEveryOperationInput() { + Model m = twoOpModel(new Ec2QueryTrait(), null, "DescribeThings", "RunThings"); + Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "DescribeThingsRequest"), "ec2 input must be stamped"); + assertTrue(stamped(out, "RunThingsRequest"), "ec2 input must be stamped"); + } + + @Test + void pollyService_stampsOnlySynthesizeSpeechInput() { + Model m = twoOpModel(RestJson1Trait.builder().build(), pollyServiceTrait(), + "SynthesizeSpeech", "DescribeVoices"); + Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "SynthesizeSpeechRequest"), "Polly SynthesizeSpeech must be stamped"); + assertFalse(stamped(out, "DescribeVoicesRequest"), + "Polly must stamp only SynthesizeSpeech, not other operations"); + } + + @Test + void plainRestJsonService_stampsNothing() { + Model m = twoOpModel(RestJson1Trait.builder().build(), null, "GetThing", "PutThing"); + Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + assertSame(m, out, "a non-query, non-Polly rest-json service must be left untouched"); + assertFalse(stamped(out, "GetThingRequest")); + assertFalse(stamped(out, "PutThingRequest")); + } +} From 7e148a50a0cd21825ce56e353b67054c31dc71fc Mon Sep 17 00:00:00 2001 From: sbaluja Date: Tue, 1 Sep 2026 17:11:10 -0400 Subject: [PATCH 36/53] Smithy: ignore @deprecated operations so orphaned request/result structs are not emitted --- .../generators/model/ShapeClassifier.java | 7 +-- .../model/transforms/GlobalTransforms.java | 21 ++++++- .../model/GlobalTransformsTest.java | 61 +++++++++++++++++++ .../generators/model/ShapeClassifierTest.java | 49 +++++++++++++++ 4 files changed, 133 insertions(+), 5 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index 353b2cbce3e..ecbba4994d8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -8,7 +8,6 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.CustomRenderedTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import software.amazon.smithy.model.Model; -import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.EnumShape; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; @@ -105,7 +104,6 @@ private ShapeClassifier() {} * @return classified shapes grouped by generation bucket */ public static ClassifiedShapes classify(Model model, ServiceShape service, Protocol protocol) { - TopDownIndex index = TopDownIndex.of(model); Set reachable = GlobalTransforms.computeReachableShapes(model, service); Set inputShapeIds = new HashSet<>(); @@ -122,8 +120,9 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto List outgoingEventStreams = new ArrayList<>(); List blobPayloadEvents = new ArrayList<>(); - // Collect operation inputs/outputs and identify event stream handlers - for (OperationShape op : index.getContainedOperations(service)) { + // Collect operation inputs/outputs and identify event stream handlers. Deprecated operations + // are excluded (matching legacy C2J), so their orphaned request/result structs never emit. + for (OperationShape op : GlobalTransforms.nonDeprecatedOperations(model, service)) { // Use getInputShape() (not getInput()) so no-input operations, whose input // target is smithy.api#Unit, still produce a RequestInfo. C2J emits a Request // class for every operation; the generated client method references it. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 19f27ff1965..2fac9fcc43c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -140,7 +140,7 @@ private static List> reservedRenames(StructureShape st public static Set computeReachableShapes(Model model, ServiceShape service) { Walker walker = new Walker(model); Set reachable = new HashSet<>(); - for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + for (OperationShape op : nonDeprecatedOperations(model, service)) { addReachableFrom(op.getInputShape(), walker, model, reachable); op.getOutput().ifPresent(id -> addReachableFrom(id, walker, model, reachable)); op.getErrors().forEach(id -> addReachableFrom(id, walker, model, reachable)); @@ -153,6 +153,25 @@ private static void addReachableFrom(ShapeId root, Walker walker, Model model, S model.getShape(root).ifPresent(shape -> out.addAll(walker.walkShapeIds(shape))); } + /** + * Returns the service's operations excluding any marked {@code @deprecated}. Legacy C2J drops + * deprecated operations entirely (they never appear in the generated client), so their input and + * output structures — orphaned once the operation is gone — are not emitted either. This is the + * single filter used by every emission-driving iteration over the service's operations + * ({@link #computeReachableShapes} and {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier#classify}) + * so reachability and classification stay in agreement. A structure still referenced by a live + * operation remains reachable through that operation, so shared structures are unaffected. + * + * @param model the Smithy model + * @param service the service whose operations are being generated + * @return the service's non-deprecated operations + */ + public static List nonDeprecatedOperations(Model model, ServiceShape service) { + return TopDownIndex.of(model).getContainedOperations(service).stream() + .filter(op -> !op.hasTrait(DeprecatedTrait.class)) + .collect(Collectors.toList()); + } + /** * Returns this class as a ModelTransform. * diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index 727706c24aa..777388f8cfe 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -447,6 +447,67 @@ void computeReachableShapes_errorShapes_areReachable() { assertTrue(reachable.contains(ShapeId.from("com.example#MyError"))); } + @Test + void computeReachableShapes_excludesStructReachableOnlyViaDeprecatedOperation() { + // A @deprecated operation is dropped entirely (matching legacy C2J, which omits deprecated + // operations). A struct reachable ONLY through the deprecated op's input must fall out of the + // reachable set, while a struct shared with a live op stays reachable via that live op. + StructureShape deprecatedOnly = StructureShape.builder() + .id("com.example#DeprecatedOnly") + .addMember(MemberShape.builder() + .id("com.example#DeprecatedOnly$x").target("smithy.api#String").build()) + .build(); + StructureShape shared = StructureShape.builder() + .id("com.example#SharedDetail") + .addMember(MemberShape.builder() + .id("com.example#SharedDetail$y").target("smithy.api#String").build()) + .build(); + StructureShape deprecatedInput = StructureShape.builder() + .id("com.example#DeprecatedInput") + .addMember(MemberShape.builder() + .id("com.example#DeprecatedInput$only").target(deprecatedOnly.getId()).build()) + .addMember(MemberShape.builder() + .id("com.example#DeprecatedInput$shared").target(shared.getId()).build()) + .build(); + StructureShape deprecatedOutput = StructureShape.builder() + .id("com.example#DeprecatedOutput").build(); + StructureShape liveInput = StructureShape.builder() + .id("com.example#LiveInput") + .addMember(MemberShape.builder() + .id("com.example#LiveInput$shared").target(shared.getId()).build()) + .build(); + StructureShape liveOutput = StructureShape.builder() + .id("com.example#LiveOutput").build(); + OperationShape deprecatedOp = OperationShape.builder() + .id("com.example#DeprecatedOp") + .input(deprecatedInput.getId()).output(deprecatedOutput.getId()) + .addTrait(software.amazon.smithy.model.traits.DeprecatedTrait.builder().build()) + .build(); + OperationShape liveOp = OperationShape.builder() + .id("com.example#LiveOp") + .input(liveInput.getId()).output(liveOutput.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#MyService").version("2024-01-01") + .addOperation(deprecatedOp.getId()).addOperation(liveOp.getId()) + .build(); + Model model = Model.assembler() + .addShapes(deprecatedOnly, shared, deprecatedInput, deprecatedOutput, + liveInput, liveOutput, deprecatedOp, liveOp, service) + .assemble().unwrap(); + + Set reachable = GlobalTransforms.computeReachableShapes(model, service); + + assertFalse(reachable.contains(ShapeId.from("com.example#DeprecatedOnly")), + "struct reachable only via a @deprecated operation must be excluded"); + assertFalse(reachable.contains(ShapeId.from("com.example#DeprecatedInput")), + "the input of a @deprecated operation must be excluded"); + assertTrue(reachable.contains(ShapeId.from("com.example#SharedDetail")), + "struct shared with a live operation must remain reachable"); + assertTrue(reachable.contains(ShapeId.from("com.example#LiveInput")), + "the input of a live operation must remain reachable"); + } + // --- dropDeprecatedMembers tests --- @Test diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java index 3ae0b5d93c2..42517bc1492 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java @@ -679,6 +679,55 @@ void classifyDropsIncomingEventStreamUnionFromSubObjects() { "incoming event-stream union dropped from subObjects: " + classified.subObjects()); } + @Test + void deprecatedOperation_inputAndOutputExcludedFromRequestsAndResults() { + // Legacy C2J drops @deprecated operations entirely, so their orphaned request/result structs + // are never emitted. The classifier must not put a @deprecated op's input in requests nor its + // output in results, while a live op's input/output are present. + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape deprecatedRequest = StructureShape.builder() + .id("com.example#DeprecatedRequest").addMember("id", str.getId()).build(); + StructureShape deprecatedResponse = StructureShape.builder() + .id("com.example#DeprecatedResponse").addMember("r", str.getId()).build(); + StructureShape liveRequest = StructureShape.builder() + .id("com.example#LiveRequest").addMember("id", str.getId()).build(); + StructureShape liveResponse = StructureShape.builder() + .id("com.example#LiveResponse").addMember("r", str.getId()).build(); + OperationShape deprecatedOp = OperationShape.builder() + .id("com.example#DeprecatedOp") + .input(deprecatedRequest.getId()).output(deprecatedResponse.getId()) + .addTrait(DeprecatedTrait.builder().build()) + .build(); + OperationShape liveOp = OperationShape.builder() + .id("com.example#LiveOp") + .input(liveRequest.getId()).output(liveResponse.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2023-01-01") + .addOperation(deprecatedOp.getId()).addOperation(liveOp.getId()) + .addTrait(ServiceTrait.builder().sdkId("test").arnNamespace("test") + .cloudFormationName("Test").cloudTrailEventSource("test").build()) + .build(); + Model model = Model.builder() + .addShapes(str, deprecatedRequest, deprecatedResponse, liveRequest, liveResponse, + deprecatedOp, liveOp, service) + .build(); + var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); + + assertTrue(classified.requests().stream() + .noneMatch(r -> r.shape().getId().getName().equals("DeprecatedRequest")), + "deprecated op input must not be a request: " + classified.requests()); + assertTrue(classified.results().stream() + .noneMatch(r -> r.shape().getId().getName().equals("DeprecatedResponse")), + "deprecated op output must not be a result: " + classified.results()); + assertTrue(classified.requests().stream() + .anyMatch(r -> r.shape().getId().getName().equals("LiveRequest")), + "live op input must be a request: " + classified.requests()); + assertTrue(classified.results().stream() + .anyMatch(r -> r.shape().getId().getName().equals("LiveResponse")), + "live op output must be a result: " + classified.results()); + } + @Test void classifiesEnumShape() { // StringShape with @enum trait -> classified as enum From 5bdb74fb9917dfe80225aee799c178f7583bcf5d Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 00:17:51 -0400 Subject: [PATCH 37/53] Smithy: injectResponseMetadata skips @deprecated operation outputs --- .../model/transforms/GlobalTransforms.java | 3 +- .../model/GlobalTransformsTest.java | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 2fac9fcc43c..a37787ebd3a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -259,9 +259,8 @@ public static Model injectResponseMetadata(Model model, ServiceShape service) { List replacements = new ArrayList<>(); replacements.add(responseMetadata); - TopDownIndex index = TopDownIndex.of(model); Set outputIds = new HashSet<>(); - for (OperationShape op : index.getContainedOperations(service)) { + for (OperationShape op : nonDeprecatedOperations(model, service)) { op.getOutput().ifPresent(outputIds::add); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index 777388f8cfe..1198a76430d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -789,6 +789,54 @@ void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataStruc "ResponseMetadata should have a RequestId member"); } + @Test + void injectResponseMetadata_skipsDeprecatedOperationOutputSharedByLiveOp() { + // A @deprecated operation's output that is ALSO reused as a nested member by a live op's + // output is reachable/emitted as a sub-object, but C2J drops the deprecated op entirely and + // never injects ResponseMetadata into that shape. Only genuine live-op outputs get it. + StructureShape sharedOutput = StructureShape.builder() + .id("com.example#SharedOutput") + .addMember(MemberShape.builder() + .id("com.example#SharedOutput$value").target("smithy.api#String").build()) + .build(); + StructureShape liveOutput = StructureShape.builder() + .id("com.example#LiveOutput") + .addMember(MemberShape.builder() + .id("com.example#LiveOutput$nested").target(sharedOutput.getId()).build()) + .build(); + StructureShape deprecatedInput = StructureShape.builder() + .id("com.example#DeprecatedInput").build(); + StructureShape liveInput = StructureShape.builder() + .id("com.example#LiveInput").build(); + OperationShape deprecatedOp = OperationShape.builder() + .id("com.example#DeprecatedOp") + .input(deprecatedInput.getId()).output(sharedOutput.getId()) + .addTrait(software.amazon.smithy.model.traits.DeprecatedTrait.builder().build()) + .build(); + OperationShape liveOp = OperationShape.builder() + .id("com.example#LiveOp") + .input(liveInput.getId()).output(liveOutput.getId()) + .build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#Example").version("2024-01-01") + .addTrait(new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait()) + .addOperation(deprecatedOp.getId()).addOperation(liveOp.getId()) + .build(); + Model model = Model.assembler().addShapes(sharedOutput, liveOutput, deprecatedInput, + liveInput, deprecatedOp, liveOp, service).assemble().unwrap(); + + Model out = GlobalTransforms.injectResponseMetadata(model, serviceOf(model, "Example")); + + StructureShape sharedAfter = out.expectShape( + ShapeId.from("com.example#SharedOutput"), StructureShape.class); + assertFalse(sharedAfter.getMember("ResponseMetadata").isPresent(), + "a @deprecated op's output (only reused as a nested member) must not gain ResponseMetadata"); + StructureShape liveAfter = out.expectShape( + ShapeId.from("com.example#LiveOutput"), StructureShape.class); + assertTrue(liveAfter.getMember("ResponseMetadata").isPresent(), + "a genuine live-op output must still gain ResponseMetadata"); + } + @Test void injectResponseMetadata_awsJsonWithoutQueryCompatible_leavesResultUnchanged() { // Plain awsJson1_0 (no @awsQueryCompatible) must NOT get ResponseMetadata injected. From 29aa6bfea9b4d2f5b91ba019eb47b7ab8f0ecb0f Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 00:22:21 -0400 Subject: [PATCH 38/53] Smithy: RequestRenderer emits SignBody override for @unsignedPayload operations --- .../model/renderers/RequestRenderer.java | 16 ++++++ .../generators/model/RequestRendererTest.java | 52 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 84680e5fbeb..e64117d50c9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -24,6 +24,7 @@ import software.amazon.smithy.model.node.NodeVisitor; import software.amazon.smithy.model.node.StringNode; import software.amazon.smithy.aws.traits.HttpChecksumTrait; +import software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait; import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.StructureShape; @@ -169,6 +170,7 @@ private void renderHeader(CppWriterDelegator writerDelegator, // @httpChecksum, @httpChecksumRequired (legacy Content-MD5), then @requestCompression. renderChecksumDecls(writer, shape, operation); renderContentMd5Decl(writer, operation); + renderSignBodyDecl(writer, shape, operation); renderRequestCompressionDecl(writer, operation); // S3 flips a couple of streaming-base requests back to non-streaming (C2J @@ -501,6 +503,20 @@ private void renderContentMd5Decl(CppWriter writer, OperationShape operation) { } } + /** + * Declares the inline {@code SignBody} override for an operation carrying + * {@code aws.auth#unsignedPayload} whose request has at least one member. C2J's + * RequestHeader.vm emits this for a {@code v4-unsigned-body} request + * ({@code #if(!$shape.signBody && $shape.members.size() > 0)}); the Smithy equivalent is the + * {@code @unsignedPayload} operation trait. This closes {@code Model::}-namespace parity only: + * the Smithy runtime does not consume {@code SignBody()} (it hardcodes signing). + */ + private void renderSignBodyDecl(CppWriter writer, StructureShape shape, OperationShape operation) { + if (operation.hasTrait(UnsignedPayloadTrait.class) && !shape.getAllMembers().isEmpty()) { + writer.write("$L bool SignBody() const override { return false; }", ctx.exportMacro()); + } + } + /** The C++ enum type name of a checksum algorithm/validation-mode member named by @httpChecksum. */ private String checksumMemberEnumType(StructureShape shape, OperationShape operation, String memberName) { MemberShape member = shape.getAllMembers().get(memberName); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 556066faf67..f70ac806d0d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -947,4 +947,56 @@ void operationContextParams_multiSelectFlattenPattern_endToEnd() { "Missing result push for " + branch + ": " + c); } } + + // --- aws.auth#unsignedPayload (SignBody) --- + + /** + * Operation carrying {@code aws.auth#unsignedPayload}. When {@code emptyInput} is false the input + * has a member; when true the input has none (exercises the {@code !members.isEmpty()} guard). + * When {@code marked} is false the trait is omitted. + */ + private static Model unsignedPayloadModel(boolean marked, boolean emptyInput) { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape.Builder inB = StructureShape.builder().id("com.example#DoThingRequest"); + if (!emptyInput) { + inB.addMember("name", str.getId()); + } + StructureShape input = inB.build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + OperationShape.Builder opB = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()); + if (marked) { + opB.addTrait(new software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait()); + } + OperationShape op = opB.build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void unsignedPayloadTrait_emitsSignBodyFalse() { + // C2J RequestHeader.vm: a v4-unsigned-body request with members emits SignBody() -> false. + // In Smithy that maps to the operation carrying aws.auth#unsignedPayload. + String h = renderDoThingRequestHeader(unsignedPayloadModel(true, false)); + assertTrue(h.contains("bool SignBody() const override { return false; }"), + "@unsignedPayload op with members must emit SignBody() -> false: " + h); + } + + @Test + void withoutUnsignedPayloadTrait_omitsSignBody() { + String h = renderDoThingRequestHeader(unsignedPayloadModel(false, false)); + assertFalse(h.contains("SignBody"), + "op without @unsignedPayload must not emit SignBody: " + h); + } + + @Test + void unsignedPayloadTraitWithEmptyRequest_omitsSignBody() { + // The !members.isEmpty() guard: an @unsignedPayload op whose request has no members + // must not emit SignBody (matches C2J's $shape.members.size() > 0 gate). + String h = renderDoThingRequestHeader(unsignedPayloadModel(true, true)); + assertFalse(h.contains("SignBody"), + "@unsignedPayload op with an empty request must not emit SignBody: " + h); + } } From 0710a06709954da98e5d4b104fd96561a2811246 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 00:31:09 -0400 Subject: [PATCH 39/53] Smithy: emit request IsChunked() override for chunked-encoding operations --- .../generators/model/ModelCodegenPlugin.java | 4 +- .../model/renderers/RequestRenderer.java | 9 ++ .../transforms/ChunkedEncodingTrait.java | 28 +++++ .../transforms/ChunkedEncodingTransform.java | 61 ++++++++++ .../generators/model/RequestRendererTest.java | 35 ++++++ .../ChunkedEncodingTransformTest.java | 110 ++++++++++++++++++ 6 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 6714c7a0dd9..bb55352e32e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -9,6 +9,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.AccessAnalyzerTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.DynamoDbTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlacierTransforms; @@ -66,7 +67,8 @@ public void execute(PluginContext context) { S3Transforms.asTransform(), S3ControlTransforms.asTransform(), GlacierTransforms.asTransform(), - SupportsPresigningTransform.asTransform() + SupportsPresigningTransform.asTransform(), + ChunkedEncodingTransform.asTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index e64117d50c9..6a23bbebdd5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -14,6 +14,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.RequestInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; @@ -171,6 +172,14 @@ private void renderHeader(CppWriterDelegator writerDelegator, renderChecksumDecls(writer, shape, operation); renderContentMd5Decl(writer, operation); renderSignBodyDecl(writer, shape, operation); + + // Chunked-encoding requests emit IsChunked() -> true right after SignBody and before + // IsStreaming (C2J RequestHeader.vm order); the marker is stamped by + // ChunkedEncodingTransform. + if (shape.hasTrait(ChunkedEncodingTrait.class)) { + writer.write("$L bool IsChunked() const override { return true; }", ctx.exportMacro()); + } + renderRequestCompressionDecl(writer, operation); // S3 flips a couple of streaming-base requests back to non-streaming (C2J diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java new file mode 100644 index 00000000000..db7744e5e2b --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java @@ -0,0 +1,28 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link ChunkedEncodingTransform} on + * each request structure for which C2J's {@code RequestHeader.vm} emits + * {@code bool IsChunked() const override { return true; }}. C2J gates that override on + * {@code ($metadata.serviceId=="MediaStore Data" || $operation.supportsChunkedEncoding)} together + * with {@code $shape.hasStreamMembers() && !$shape.signBody && $shape.members.size() > 0}; S3 sets + * {@code supportsChunkedEncoding} on {@code WriteGetObjectResponse} only. The transform collapses + * that emit-time condition into a single stamping decision so request rendering only has to turn the + * marker into the override. Kept as a marker + generic renderer rule (not a service-name {@code if}) + * so the renderer stays service-agnostic. + */ +public final class ChunkedEncodingTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#chunkedEncoding"); + + public ChunkedEncodingTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java new file mode 100644 index 00000000000..2529fcc6dff --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java @@ -0,0 +1,61 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier; +import software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; + +import java.util.ArrayList; +import java.util.List; + +/** + * Stamps the internal {@link ChunkedEncodingTrait} onto the request structures for which C2J's + * {@code RequestHeader.vm} emits {@code bool IsChunked() const override { return true; }}. C2J gates + * that override on {@code ($metadata.serviceId=="MediaStore Data" || $operation.supportsChunkedEncoding)} + * (S3 sets {@code supportsChunkedEncoding} on {@code WriteGetObjectResponse} only) combined with + * {@code $shape.hasStreamMembers() && !$shape.signBody && $shape.members.size() > 0}. This transform + * collapses that emit-time condition into a single stamping decision: an operation qualifies when it + * carries {@code aws.auth#unsignedPayload} (the {@code !signBody} proxy), its input is a raw + * streaming payload request (the {@code hasStreamMembers} proxy, which also guarantees members > 0), + * and either the service is MediaStore Data or the operation is S3's {@code WriteGetObjectResponse}. + * No-op for any other service/operation, leaving the model instance untouched. + */ +public final class ChunkedEncodingTransform { + + private static final String WRITE_GET_OBJECT_RESPONSE = "WriteGetObjectResponse"; + + private ChunkedEncodingTransform() {} + + public static ModelTransform asTransform() { + return ChunkedEncodingTransform::apply; + } + + private static Model apply(Model model, ServiceShape service) { + boolean mediaStoreData = + "mediastore-data".equals(ServiceNameUtil.getSmithyServiceName(service, null)); + List updated = new ArrayList<>(); + for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + boolean supportsChunkedEncoding = + mediaStoreData || WRITE_GET_OBJECT_RESPONSE.equals(op.getId().getName()); + if (supportsChunkedEncoding + && op.hasTrait(UnsignedPayloadTrait.class) + && ShapeClassifier.isRawStreamingPayloadRequest(op, model)) { + model.getShape(op.getInputShape()).flatMap(Shape::asStructureShape) + .filter(s -> !s.hasTrait(ChunkedEncodingTrait.class)) + .ifPresent(s -> updated.add( + s.toBuilder().addTrait(new ChunkedEncodingTrait()).build())); + } + } + return updated.isEmpty() ? model + : model.toBuilder().addShapes(updated.toArray(new Shape[0])).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index f70ac806d0d..6abe568d27c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -999,4 +999,39 @@ void unsignedPayloadTraitWithEmptyRequest_omitsSignBody() { assertFalse(h.contains("SignBody"), "@unsignedPayload op with an empty request must not emit SignBody: " + h); } + + // --- aws.cpp.internal#chunkedEncoding (IsChunked) --- + + private static Model chunkedEncodingModel(boolean marked) { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape.Builder inB = StructureShape.builder() + .id("com.example#DoThingRequest").addMember("name", str.getId()); + if (marked) { + inB.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTrait()); + } + StructureShape input = inB.build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void chunkedEncodingTrait_emitsIsChunkedTrue() { + // C2J RequestHeader.vm emits IsChunked() -> true for a chunked-encoding request; the marker + // (stamped by ChunkedEncodingTransform) drives the same override here. + String h = renderDoThingRequestHeader(chunkedEncodingModel(true)); + assertTrue(h.contains("bool IsChunked() const override { return true; }"), + "ChunkedEncodingTrait must emit the IsChunked override: " + h); + } + + @Test + void withoutChunkedEncodingTrait_omitsIsChunked() { + String h = renderDoThingRequestHeader(chunkedEncodingModel(false)); + assertFalse(h.contains("IsChunked"), + "unmarked requests must not emit IsChunked: " + h); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java new file mode 100644 index 00000000000..bc3515b8060 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java @@ -0,0 +1,110 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.BlobShape; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.model.traits.HttpPayloadTrait; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class ChunkedEncodingTransformTest { + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + private static boolean stamped(Model m, String requestShapeName) { + return m.expectShape(ShapeId.from("com.example#" + requestShapeName), StructureShape.class) + .hasTrait(ChunkedEncodingTrait.class); + } + + private static ServiceTrait serviceTrait(String sdkId) { + return ServiceTrait.builder().sdkId(sdkId).arnNamespace("ns") + .cloudFormationName("Cfn").cloudTrailEventSource("src").build(); + } + + /** + * Builds a single-operation service. {@code streaming} adds a raw {@code @httpPayload} blob body + * (plus a plain member so members > 0); {@code unsigned} adds {@code aws.auth#unsignedPayload}. + */ + private static Model oneOpModel(String sdkId, String opName, boolean streaming, boolean unsigned) { + StringShape str = StringShape.builder().id("com.example#String").build(); + BlobShape blob = BlobShape.builder().id("com.example#Body").build(); + StructureShape.Builder inB = StructureShape.builder().id("com.example#" + opName + "Request") + .addMember("name", str.getId()); + if (streaming) { + inB.addMember(MemberShape.builder() + .id("com.example#" + opName + "Request$body").target(blob.getId()) + .addTrait(new HttpPayloadTrait()).build()); + } + StructureShape input = inB.build(); + OperationShape.Builder opB = OperationShape.builder() + .id("com.example#" + opName).input(input.getId()); + if (unsigned) { + opB.addTrait(new UnsignedPayloadTrait()); + } + OperationShape op = opB.build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(serviceTrait(sdkId)) + .addOperation(op.getId()).build(); + return Model.assembler().addShapes(str, blob, input, op, service).assemble().unwrap(); + } + + @Test + void mediaStoreDataUnsignedStreamingOp_stampsInput() { + Model m = oneOpModel("MediaStore Data", "PutObject", true, true); + Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "PutObjectRequest"), + "MediaStore Data unsigned-payload streaming request must be stamped"); + } + + @Test + void mediaStoreDataNonStreamingOp_notStamped() { + Model m = oneOpModel("MediaStore Data", "DescribeObject", false, true); + Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + assertSame(m, out, "no qualifying operation must leave the model untouched"); + assertFalse(stamped(out, "DescribeObjectRequest"), + "a non-streaming request must not be stamped"); + } + + @Test + void mediaStoreDataSignedStreamingOp_notStamped() { + Model m = oneOpModel("MediaStore Data", "PutObject", true, false); + Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + assertSame(m, out, "no qualifying operation must leave the model untouched"); + assertFalse(stamped(out, "PutObjectRequest"), + "a signed (no @unsignedPayload) request must not be stamped"); + } + + @Test + void s3WriteGetObjectResponseUnsignedStreamingOp_stampsInput() { + Model m = oneOpModel("S3", "WriteGetObjectResponse", true, true); + Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "WriteGetObjectResponseRequest"), + "S3 WriteGetObjectResponse unsigned-payload streaming request must be stamped"); + } + + @Test + void unrelatedServiceStreamingOp_notStamped() { + Model m = oneOpModel("S3", "PutObject", true, true); + Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + assertSame(m, out, "an unrelated operation must leave the model untouched"); + assertFalse(stamped(out, "PutObjectRequest"), + "only WriteGetObjectResponse (or MediaStore Data) may be stamped"); + } +} From 939dcd9c62eb281d9268b9170e3aba5555980281 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 00:38:51 -0400 Subject: [PATCH 40/53] Smithy: emit request IsLongPollingOperation() override for long-polling operations --- .../generators/model/ModelCodegenPlugin.java | 4 +- .../model/renderers/RequestRenderer.java | 7 ++ .../model/transforms/LongPollingTrait.java | 29 +++++ .../transforms/LongPollingTransform.java | 63 +++++++++++ .../generators/model/RequestRendererTest.java | 51 +++++++++ .../transforms/LongPollingTransformTest.java | 102 ++++++++++++++++++ 6 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index bb55352e32e..1bf8ecf3831 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -15,6 +15,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlacierTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LongPollingTransform; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3ControlTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; @@ -68,7 +69,8 @@ public void execute(PluginContext context) { S3ControlTransforms.asTransform(), GlacierTransforms.asTransform(), SupportsPresigningTransform.asTransform(), - ChunkedEncodingTransform.asTransform() + ChunkedEncodingTransform.asTransform(), + LongPollingTransform.asTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 6a23bbebdd5..0f37b41a3f5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -15,6 +15,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier.RequestInfo; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeRenderer; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTrait; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LongPollingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; @@ -141,6 +142,12 @@ private void renderHeader(CppWriterDelegator writerDelegator, if (streamingRequest) { writer.write("inline virtual bool IsEventStreamRequest() const override { return true; }"); } + // Long-polling requests emit IsLongPollingOperation() -> true with the top identity + // methods (C2J RequestHeader.vm order: after IsEventStreamRequest, before + // HasEventStreamResponse); the marker is stamped by LongPollingTransform. + if (shape.hasTrait(LongPollingTrait.class)) { + writer.write("inline virtual bool IsLongPollingOperation() const override { return true; }"); + } if (streamingResponse) { writer.write("inline virtual bool HasEventStreamResponse() const override { return true; }"); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java new file mode 100644 index 00000000000..d213ad92c68 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java @@ -0,0 +1,29 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.node.Node; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AnnotationTrait; + +/** + * Internal marker (never declared in any model file) placed by {@link LongPollingTransform} on the + * request structure of each operation for which C2J's {@code RequestHeader.vm} emits + * {@code bool IsLongPollingOperation() const override { return true; }} (gated on + * {@code $operation.longPolling}). C2J sets that flag from + * {@code C2jModelToGeneratorModelTransformer.LONG_POLLING_OPERATIONS}, a hardcoded per-serviceId set + * ({@code SQS: [ReceiveMessage]}, {@code SFN: [GetActivityTask]}, + * {@code SWF: [PollForActivityTask, PollForDecisionTask]}). The transform collapses that lookup into a + * single stamping decision so request rendering only has to turn the marker into the override. Kept as + * a marker + generic renderer rule (not a service-name {@code if}) so the renderer stays + * service-agnostic. + */ +public final class LongPollingTrait extends AnnotationTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#longPolling"); + + public LongPollingTrait() { + super(ID, Node.objectNode()); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java new file mode 100644 index 00000000000..6ad636277bc --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java @@ -0,0 +1,63 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Stamps the internal {@link LongPollingTrait} onto the request structures of the long-polling + * operations that C2J flags with {@code operation.setLongPolling(true)}, so the + * {@code IsLongPollingOperation() -> true} override is emitted by request rendering. C2J's + * {@code C2jModelToGeneratorModelTransformer.LONG_POLLING_OPERATIONS} keys the set on the C2J + * {@code serviceId} ({@code SQS}, {@code SFN}, {@code SWF}); the Smithy equivalent is the RAW smithy + * service name (the lowercased/hyphenated sdkId from + * {@link ServiceNameUtil#getSmithyServiceName(ServiceShape, Map)} with a {@code null} service map, so + * no c2jMap remap such as {@code sfn->states} is applied). No-op for any other service, leaving the + * model instance untouched. + */ +public final class LongPollingTransform { + + private static final Map> LONG_POLLING_OPERATIONS = Map.of( + "sqs", Set.of("ReceiveMessage"), + "sfn", Set.of("GetActivityTask"), + "swf", Set.of("PollForActivityTask", "PollForDecisionTask") + ); + + private LongPollingTransform() {} + + public static ModelTransform asTransform() { + return LongPollingTransform::apply; + } + + private static Model apply(Model model, ServiceShape service) { + Set longPollOps = + LONG_POLLING_OPERATIONS.get(ServiceNameUtil.getSmithyServiceName(service, null)); + if (longPollOps == null) { + return model; + } + List updated = new ArrayList<>(); + for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { + if (longPollOps.contains(op.getId().getName())) { + model.getShape(op.getInputShape()).flatMap(Shape::asStructureShape) + .filter(s -> !s.hasTrait(LongPollingTrait.class)) + .ifPresent(s -> updated.add( + s.toBuilder().addTrait(new LongPollingTrait()).build())); + } + } + return updated.isEmpty() ? model + : model.toBuilder().addShapes(updated.toArray(new Shape[0])).build(); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 6abe568d27c..30c5df9d600 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -1034,4 +1034,55 @@ void withoutChunkedEncodingTrait_omitsIsChunked() { assertFalse(h.contains("IsChunked"), "unmarked requests must not emit IsChunked: " + h); } + + // --- aws.cpp.internal#longPolling (IsLongPollingOperation) --- + + private static Model longPollingModel(boolean marked) { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape.Builder inB = StructureShape.builder() + .id("com.example#DoThingRequest").addMember("name", str.getId()); + if (marked) { + inB.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LongPollingTrait()); + } + StructureShape input = inB.build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()).build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void longPollingTrait_emitsIsLongPollingOperationTrue() { + // C2J RequestHeader.vm emits IsLongPollingOperation() -> true for a long-polling request + // (gated on $operation.longPolling); the marker (stamped by LongPollingTransform) drives the + // same override here. + String h = renderDoThingRequestHeader(longPollingModel(true)); + assertTrue(h.contains("bool IsLongPollingOperation() const override { return true; }"), + "LongPollingTrait must emit the IsLongPollingOperation override: " + h); + } + + @Test + void longPollingTrait_emittedWithTopIdentityMethods() { + // Ordering: IsLongPollingOperation sits with the top identity methods (after + // GetServiceRequestName, before SerializePayload), NOT down with the SignBody/IsChunked + // block. Matches C2J RequestHeader.vm lines 57-64. + String h = renderDoThingRequestHeader(longPollingModel(true)); + int requestName = h.indexOf("GetServiceRequestName"); + int longPolling = h.indexOf("IsLongPollingOperation"); + int serializePayload = h.indexOf("SerializePayload"); + assertTrue(requestName >= 0 && longPolling > requestName, + "IsLongPollingOperation must come after GetServiceRequestName: " + h); + assertTrue(serializePayload >= 0 && longPolling < serializePayload, + "IsLongPollingOperation must come before SerializePayload (top identity block): " + h); + } + + @Test + void withoutLongPollingTrait_omitsIsLongPollingOperation() { + String h = renderDoThingRequestHeader(longPollingModel(false)); + assertFalse(h.contains("IsLongPollingOperation"), + "unmarked requests must not emit IsLongPollingOperation: " + h); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java new file mode 100644 index 00000000000..6a96b92c588 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java @@ -0,0 +1,102 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StringShape; +import software.amazon.smithy.model.shapes.StructureShape; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class LongPollingTransformTest { + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + } + + private static boolean stamped(Model m, String requestShapeName) { + return m.expectShape(ShapeId.from("com.example#" + requestShapeName), StructureShape.class) + .hasTrait(LongPollingTrait.class); + } + + private static ServiceTrait serviceTrait(String sdkId) { + return ServiceTrait.builder().sdkId(sdkId).arnNamespace("ns") + .cloudFormationName("Cfn").cloudTrailEventSource("src").build(); + } + + /** Builds a service with the given sdkId containing one input+operation per op name. */ + private static Model model(String sdkId, String... opNames) { + StringShape str = StringShape.builder().id("com.example#String").build(); + List shapes = new ArrayList<>(); + shapes.add(str); + ServiceShape.Builder serviceB = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(serviceTrait(sdkId)); + for (String opName : opNames) { + StructureShape input = StructureShape.builder() + .id("com.example#" + opName + "Request").addMember("name", str.getId()).build(); + OperationShape op = OperationShape.builder() + .id("com.example#" + opName).input(input.getId()).build(); + shapes.add(input); + shapes.add(op); + serviceB.addOperation(op.getId()); + } + shapes.add(serviceB.build()); + return Model.assembler() + .addShapes(shapes.toArray(new software.amazon.smithy.model.shapes.Shape[0])) + .assemble().unwrap(); + } + + @Test + void sqsReceiveMessage_stampsOnlyReceiveMessageInput() { + Model m = model("SQS", "ReceiveMessage", "SendMessage"); + Model out = LongPollingTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "ReceiveMessageRequest"), + "SQS ReceiveMessage input must be stamped"); + assertFalse(stamped(out, "SendMessageRequest"), + "a non-long-polling SQS operation must not be stamped"); + } + + @Test + void swf_stampsBothPollOperations() { + Model m = model("SWF", "PollForActivityTask", "PollForDecisionTask", "StartWorkflowExecution"); + Model out = LongPollingTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "PollForActivityTaskRequest"), + "SWF PollForActivityTask input must be stamped"); + assertTrue(stamped(out, "PollForDecisionTaskRequest"), + "SWF PollForDecisionTask input must be stamped"); + assertFalse(stamped(out, "StartWorkflowExecutionRequest"), + "a non-long-polling SWF operation must not be stamped"); + } + + @Test + void sfnGetActivityTask_stampsInput() { + Model m = model("SFN", "GetActivityTask", "StartExecution"); + Model out = LongPollingTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "GetActivityTaskRequest"), + "SFN GetActivityTask input must be stamped"); + assertFalse(stamped(out, "StartExecutionRequest"), + "a non-long-polling SFN operation must not be stamped"); + } + + @Test + void unrelatedService_stampsNothing() { + Model m = model("DynamoDB", "GetItem", "ReceiveMessage"); + Model out = LongPollingTransform.asTransform().apply(m, service(m)); + assertSame(m, out, "an unrelated service must leave the model untouched"); + assertFalse(stamped(out, "ReceiveMessageRequest"), + "an operation on an unrelated service must not be stamped even if its name matches"); + } +} From 043b7d581754e79307d64bfe2dfb1648bf9fe447 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 13:26:45 -0400 Subject: [PATCH 41/53] Smithy: stamp SupportsPresigning on operation to keep DumpBodyToUrl decl/impl symmetric --- .../model/protocol/JsonProtocolTraits.java | 9 +-- .../protocol/QueryXmlProtocolTraits.java | 15 +++-- .../model/renderers/RequestRenderer.java | 4 +- .../SupportsPresigningTransform.java | 25 ++++----- .../ProtocolTraitsCharacterizationTest.java | 19 ++++--- .../generators/model/RequestRendererTest.java | 47 +++++++++++++--- .../protocol/JsonProtocolTraitsTest.java | 19 ++++--- .../model/protocol/XmlProtocolTraitsTest.java | 27 +++++++-- .../SupportsPresigningTransformTest.java | 56 ++++++++++++++----- 9 files changed, 157 insertions(+), 64 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index a8e2370b0c4..02cbe833222 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -213,10 +213,11 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className, shape, model); } - // A presignable request (e.g. Polly's SynthesizeSpeech) declares the protocol-agnostic - // DumpBodyToUrl override (emitted by RequestRenderer); the real body defers with serde, as - // SerializePayload does, so this is a stub. UnreferencedParam.h is in serdeIncludes(REQUEST_SOURCE). - if (shape.hasTrait(SupportsPresigningTrait.class)) { + // A presignable operation (e.g. Polly's SynthesizeSpeech) declares the protocol-agnostic + // DumpBodyToUrl override (emitted by RequestRenderer, gated on the same operation trait); the + // real body defers with serde, as SerializePayload does, so this is a stub. + // UnreferencedParam.h is in serdeIncludes(REQUEST_SOURCE). + if (operation.hasTrait(SupportsPresigningTrait.class)) { writer.write(""); writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }", className); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java index 84c9baf6906..19c923cb95b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java @@ -6,6 +6,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; import com.amazonaws.util.awsclientsmithygenerator.generators.model.ProtocolResolver.Protocol; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; @@ -217,8 +218,8 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, writeAddQueryStringParametersDecl(writer, exportMacro); } // The protected DumpBodyToUrl override declaration is emitted protocol-agnostically by - // RequestRenderer (gated on SupportsPresigningTrait), which all query/ec2 requests carry; - // only the impl below is protocol-specific. + // RequestRenderer (gated on the operation's SupportsPresigningTrait, stamped on every + // query/ec2 operation including Unit-input ops); only the impl below is protocol-specific. } @Override @@ -236,8 +237,12 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className, shape, model); } - writer.write(""); - writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { uri.SetQueryString(SerializePayload()); }", - className); + // Gate the DumpBodyToUrl impl on the same operation trait as the RequestRenderer decl so the + // two stay symmetric: a Unit-input op with the trait gets both, an op without it gets neither. + if (operation.hasTrait(SupportsPresigningTrait.class)) { + writer.write(""); + writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { uri.SetQueryString(SerializePayload()); }", + className); + } } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 0f37b41a3f5..f6c96708703 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -163,7 +163,9 @@ private void renderHeader(CppWriterDelegator writerDelegator, // DumpBodyToUrl is emitted protocol-agnostically (C2J RequestHeader.vm gates it only on // $shape.supportsPresigning). It is a protected virtual in AmazonWebServiceRequest, so the // override is bracketed under protected: and the section restored to public: afterwards. - if (shape.hasTrait(SupportsPresigningTrait.class)) { + // The trait is stamped on the OPERATION (SupportsPresigningTransform) so Unit-input ops + // are covered and the decl stays symmetric with the protocol-emitted impl. + if (operation.hasTrait(SupportsPresigningTrait.class)) { writer.write(""); writer.dedent(); writer.write("protected:"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java index 2b048b687cf..d61c53db417 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java @@ -13,16 +13,18 @@ import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.Shape; -import software.amazon.smithy.model.traits.UnitTypeTrait; import java.util.ArrayList; import java.util.List; /** - * Stamps the internal {@link SupportsPresigningTrait} onto the request structures that C2J flags - * with {@code shape.setSupportsPresigning(true)}, so the protocol-agnostic {@code DumpBodyToUrl} - * override is emitted by request rendering. C2J's {@code QueryCppClientGenerator} sets the flag on - * every query/ec2 request; Polly additionally sets it on {@code SynthesizeSpeech}. No-op for any + * Stamps the internal {@link SupportsPresigningTrait} onto the OPERATIONS that C2J flags with + * {@code shape.setSupportsPresigning(true)}, so the protocol-agnostic {@code DumpBodyToUrl} override + * (declaration and impl) is emitted by request rendering. In C2J {@code supportsPresigning} is + * conceptually per-operation; the trait is stamped on the operation (never shared, unlike the + * {@code smithy.api#Unit} input) so it also covers {@code Unit}-input operations and keeps the decl + * and impl symmetric and protocol-agnostic. C2J's {@code QueryCppClientGenerator} sets the flag for + * every query/ec2 operation; Polly additionally sets it on {@code SynthesizeSpeech}. No-op for any * other service, leaving the model instance untouched. */ public final class SupportsPresigningTransform { @@ -42,14 +44,11 @@ private static Model apply(Model model, ServiceShape service) { } List updated = new ArrayList<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { - boolean target = queryLike - ? !op.getInputShape().equals(UnitTypeTrait.UNIT) - : "SynthesizeSpeech".equals(op.getId().getName()); - if (target) { - model.getShape(op.getInputShape()).flatMap(Shape::asStructureShape) - .filter(s -> !s.hasTrait(SupportsPresigningTrait.class)) - .ifPresent(s -> updated.add( - s.toBuilder().addTrait(new SupportsPresigningTrait()).build())); + // Operations are never Unit, so query/ec2 stamps every operation (covering Unit-input + // ops). Idempotent: skip operations that already carry the trait. + boolean target = queryLike || "SynthesizeSpeech".equals(op.getId().getName()); + if (target && !op.hasTrait(SupportsPresigningTrait.class)) { + updated.add(op.toBuilder().addTrait(new SupportsPresigningTrait()).build()); } } return updated.isEmpty() ? model diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java index 921e61d5e2b..e4b8e298ba1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java @@ -84,12 +84,6 @@ private static Model modelFor(Protocol p) { .addMember(software.amazon.smithy.model.shapes.MemberShape.builder() .id("com.example#DoThingInput$q").target(str.getId()) .addTrait(new software.amazon.smithy.model.traits.HttpQueryTrait("q")).build()); - // SupportsPresigningTransform stamps every query/ec2 request; mirror it in the fixture so this - // end-to-end characterization pins the same post-transform output (protected DumpBodyToUrl decl). - if (p == Protocol.QUERY_XML || p == Protocol.EC2) { - inputBuilder.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model - .transforms.SupportsPresigningTrait()); - } StructureShape input = inputBuilder.build(); // Output carries a plain member and an httpResponseCode member. StructureShape output = StructureShape.builder() @@ -99,11 +93,18 @@ private static Model modelFor(Protocol p) { .id("com.example#DoThingOutput$status").target(intShape.getId()) .addTrait(new software.amazon.smithy.model.traits.HttpResponseCodeTrait()).build()) .build(); - OperationShape op = OperationShape.builder() + // SupportsPresigningTransform stamps every query/ec2 OPERATION; mirror it in the fixture so + // this end-to-end characterization pins the same post-transform output (protected + // DumpBodyToUrl decl + protocol-specific impl). + OperationShape.Builder opBuilder = OperationShape.builder() .id("com.example#DoThing") .input(input.getId()) - .output(output.getId()) - .build(); + .output(output.getId()); + if (p == Protocol.QUERY_XML || p == Protocol.EC2) { + opBuilder.addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model + .transforms.SupportsPresigningTrait()); + } + OperationShape op = opBuilder.build(); ServiceShape service = ServiceShape.builder() .id("com.example#Example") .version("2024-01-01") diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 30c5df9d600..10638077b1f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -145,25 +145,48 @@ void withoutOverrideStreamingTrait_omitsIsStreaming() { private static Model supportsPresigningModel(boolean marked) { StringShape str = StringShape.builder().id("com.example#String").build(); - StructureShape.Builder inB = StructureShape.builder() - .id("com.example#DoThingRequest").addMember("name", str.getId()); + StructureShape input = StructureShape.builder() + .id("com.example#DoThingRequest").addMember("name", str.getId()).build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); + // The trait is stamped on the OPERATION (SupportsPresigningTransform), so the decl keys off + // operation.hasTrait(...) — not the input shape. + OperationShape.Builder opB = OperationShape.builder().id("com.example#DoThing") + .input(input.getId()).output(output.getId()); if (marked) { - inB.addTrait(new SupportsPresigningTrait()); + opB.addTrait(new SupportsPresigningTrait()); } - StructureShape input = inB.build(); + OperationShape op = opB.build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2024-01-01").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + /** + * A presignable operation whose input is the shared {@code smithy.api#Unit} (no {@code input(...)} + * set) — the case that broke: the input shape cannot carry the trait, but the operation can, so + * the decl must still be emitted. Mirrors an IAM-style query op like {@code GetAccountSummary}. + */ + private static Model supportsPresigningUnitInputModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape output = StructureShape.builder() .id("com.example#DoThingOutput").addMember("result", str.getId()).build(); OperationShape op = OperationShape.builder().id("com.example#DoThing") - .input(input.getId()).output(output.getId()).build(); + .output(output.getId()) + .addTrait(new SupportsPresigningTrait()) + .build(); ServiceShape service = ServiceShape.builder().id("com.example#Example") .version("2024-01-01").addOperation(op.getId()).build(); - return Model.builder().addShapes(str, input, output, op, service).build(); + // Assemble (not Model.builder) so the smithy.api#Unit prelude shape exists: the operation has + // no input, so its input target defaults to Unit, which ShapeClassifier resolves to build the + // request. Unit must be present in the model for the request class to be emitted. + return Model.assembler().addShapes(str, output, op, service).assemble().unwrap(); } @Test void supportsPresigningTrait_emitsProtectedDumpBodyToUrlOverride() { // C2J's RequestHeader.vm emits DumpBodyToUrl protocol-agnostically under - // #if($shape.supportsPresigning()); the marker drives the same protected override here. + // #if($shape.supportsPresigning()); the operation trait drives the same protected override. String h = renderDoThingRequestHeader(supportsPresigningModel(true)); assertTrue(h.contains("protected:"), "presignable request must open a protected: section: " + h); assertTrue(h.contains( @@ -172,6 +195,16 @@ void supportsPresigningTrait_emitsProtectedDumpBodyToUrlOverride() { assertTrue(h.contains("public:"), "presignable request must restore public: afterwards: " + h); } + @Test + void supportsPresigningTrait_unitInputOperation_stillEmitsDumpBodyToUrl() { + // Regression: a Unit-input op stamps the operation (not the shared Unit input), and the decl + // must still be emitted so it stays symmetric with the protocol-emitted impl. + String h = renderDoThingRequestHeader(supportsPresigningUnitInputModel()); + assertTrue(h.contains( + "AWS_EXAMPLE_API void DumpBodyToUrl(Aws::Http::URI& uri) const override;"), + "Unit-input presignable operation must still declare DumpBodyToUrl: " + h); + } + @Test void withoutSupportsPresigningTrait_omitsDumpBodyToUrl() { String h = renderDoThingRequestHeader(supportsPresigningModel(false)); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index daad7f4a1f2..0a436e66646 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -41,6 +41,12 @@ private static software.amazon.smithy.model.shapes.StructureShape reqWith(boolea private static software.amazon.smithy.model.shapes.OperationShape opDoThing() { return software.amazon.smithy.model.shapes.OperationShape.builder().id("com.example#DoThing").build(); } + /** A presignable operation: carries the internal trait stamped by SupportsPresigningTransform. */ + private static software.amazon.smithy.model.shapes.OperationShape opDoThingPresigning() { + return software.amazon.smithy.model.shapes.OperationShape.builder().id("com.example#DoThing") + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait()) + .build(); + } private static software.amazon.smithy.model.shapes.ServiceShape svcAthena() { return software.amazon.smithy.model.shapes.ServiceShape.builder() .id("com.example#AmazonAthena").version("2017-05-18").build(); @@ -241,15 +247,12 @@ void restJson_queryMember_isWireSerialized() { @Test void supportsPresigning_emitsDumpBodyToUrlStubImpl() { - // A presignable request (Polly SynthesizeSpeech) carries SupportsPresigningTrait; the decl is - // emitted by RequestRenderer, and JsonProtocolTraits supplies a stub impl that defers serde. - var req = reqWith(false, false).toBuilder() - .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms - .SupportsPresigningTrait()) - .build(); - var model = modelWith(req); + // A presignable operation (Polly SynthesizeSpeech) carries SupportsPresigningTrait on the + // OPERATION; the decl is emitted by RequestRenderer, and JsonProtocolTraits supplies a stub + // impl (gated on the same operation trait) that defers serde. + var req = reqWith(false, false); var model = modelWith(req); String i = render(w -> restJson.writeRequestMethodImpls( - w, "SynthesizeSpeechRequest", req, opDoThing(), svcAthena(), model)); + w, "SynthesizeSpeechRequest", req, opDoThingPresigning(), svcAthena(), model)); assertTrue(i.contains( "void SynthesizeSpeechRequest::DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }"), i); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index ea9d11d1241..ee64dda0c18 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -58,6 +58,12 @@ private static software.amazon.smithy.model.shapes.StructureShape reqWith(boolea private static software.amazon.smithy.model.shapes.OperationShape opDoThing() { return software.amazon.smithy.model.shapes.OperationShape.builder().id("com.example#DoThing").build(); } + /** A presignable operation: carries the internal trait stamped by SupportsPresigningTransform. */ + private static software.amazon.smithy.model.shapes.OperationShape opDoThingPresigning() { + return software.amazon.smithy.model.shapes.OperationShape.builder().id("com.example#DoThing") + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait()) + .build(); + } private static software.amazon.smithy.model.shapes.ServiceShape svcAthena() { return software.amazon.smithy.model.shapes.ServiceShape.builder() .id("com.example#AmazonAthena").version("2017-05-18").build(); @@ -273,20 +279,33 @@ void restXml_withoutEmbeddedErrorsTrait_omitsHasEmbeddedError() { @Test void queryXml_serializePayloadAndDumpBodyToUrlImpl() { - // The DumpBodyToUrl DECL is now emitted protocol-agnostically by RequestRenderer (gated on - // SupportsPresigningTrait), so the query traits' decls no longer carry it; only the IMPL is here. + // The DumpBodyToUrl DECL is emitted protocol-agnostically by RequestRenderer (gated on the + // operation's SupportsPresigningTrait), so the query traits' decls no longer carry it; the + // IMPL is here and now gated on the SAME operation trait so decl+impl stay symmetric. var req = reqWith(false, false); var model = modelWith(req); ProtocolTraits q = new QueryXmlProtocolTraits(Protocol.QUERY_XML); - String d = renderInClassBody(w -> q.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThing(), model)); + String d = renderInClassBody(w -> q.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThingPresigning(), model)); assertTrue(d.contains("Aws::String SerializePayload() const override;"), d); assertFalse(d.contains("DumpBodyToUrl"), "DumpBodyToUrl decl moved to RequestRenderer; query traits must not emit it: " + d); assertFalse(d.contains("GetRequestSpecificHeaders"), d); - String i = render(w -> q.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + String i = render(w -> q.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThingPresigning(), svcAthena(), model)); assertTrue(i.contains("Aws::String DoThingRequest::SerializePayload() const { return {}; }"), i); assertTrue(i.contains("void DoThingRequest::DumpBodyToUrl(Aws::Http::URI& uri) const { uri.SetQueryString(SerializePayload()); }"), i); } + @Test + void queryXml_withoutPresigningOperation_omitsDumpBodyToUrlImpl() { + // Compile-break regression: the impl must be ABSENT when the operation lacks the trait, so a + // Unit-input op that never got the operation trait doesn't emit an impl with no declaration. + var req = reqWith(false, false); var model = modelWith(req); + ProtocolTraits q = new QueryXmlProtocolTraits(Protocol.QUERY_XML); + String i = render(w -> q.writeRequestMethodImpls(w, "DoThingRequest", req, opDoThing(), svcAthena(), model)); + assertTrue(i.contains("Aws::String DoThingRequest::SerializePayload() const { return {}; }"), i); + assertFalse(i.contains("DumpBodyToUrl"), + "operation without SupportsPresigningTrait must not emit the DumpBodyToUrl impl: " + i); + } + @Test void queryXml_withHeaderMember_alsoEmitsHeaders() { var req = reqWith(true, false); var model = modelWith(req); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java index 239b957d0ad..e138b7e54d5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java @@ -26,8 +26,9 @@ private static ServiceShape service(Model m) { return m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); } - private static boolean stamped(Model m, String requestShapeName) { - return m.expectShape(ShapeId.from("com.example#" + requestShapeName), StructureShape.class) + /** Whether the OPERATION (not its input) carries the internal trait after transformation. */ + private static boolean stamped(Model m, String operationName) { + return m.expectShape(ShapeId.from("com.example#" + operationName), OperationShape.class) .hasTrait(SupportsPresigningTrait.class); } @@ -50,34 +51,63 @@ private static Model twoOpModel(Trait protocolTrait, ServiceTrait serviceTrait, return Model.assembler().addShapes(inA, inB, opA, opB, svc.build()).assemble().unwrap(); } + /** + * One operation with a normal input and one operation with NO input (its input target defaults to + * {@code smithy.api#Unit}), under a service carrying {@code protocolTrait}. Mirrors an IAM-style + * {@code GetAccountSummary} where the request struct is the shared {@code Unit}. + */ + private static Model opPlusUnitInputModel(Trait protocolTrait, String normalOp, String unitOp) { + StructureShape in = StructureShape.builder().id("com.example#" + normalOp + "Request").build(); + OperationShape normal = OperationShape.builder() + .id("com.example#" + normalOp).input(in.getId()).build(); + OperationShape unit = OperationShape.builder() + .id("com.example#" + unitOp).build(); + ServiceShape svc = ServiceShape.builder() + .id("com.example#TestService").version("2024-01-01") + .addTrait(protocolTrait) + .addOperation(normal.getId()).addOperation(unit.getId()).build(); + return Model.assembler().addShapes(in, normal, unit, svc).assemble().unwrap(); + } + private static ServiceTrait pollyServiceTrait() { return ServiceTrait.builder().sdkId("polly").arnNamespace("polly") .cloudFormationName("Polly").cloudTrailEventSource("polly").build(); } @Test - void queryXmlService_stampsEveryOperationInput() { + void queryXmlService_stampsEveryOperation() { Model m = twoOpModel(new AwsQueryTrait(), null, "GetUser", "CreateUser"); Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); - assertTrue(stamped(out, "GetUserRequest"), "query input must be stamped"); - assertTrue(stamped(out, "CreateUserRequest"), "query input must be stamped"); + assertTrue(stamped(out, "GetUser"), "query operation must be stamped"); + assertTrue(stamped(out, "CreateUser"), "query operation must be stamped"); } @Test - void ec2Service_stampsEveryOperationInput() { + void ec2Service_stampsEveryOperation() { Model m = twoOpModel(new Ec2QueryTrait(), null, "DescribeThings", "RunThings"); Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); - assertTrue(stamped(out, "DescribeThingsRequest"), "ec2 input must be stamped"); - assertTrue(stamped(out, "RunThingsRequest"), "ec2 input must be stamped"); + assertTrue(stamped(out, "DescribeThings"), "ec2 operation must be stamped"); + assertTrue(stamped(out, "RunThings"), "ec2 operation must be stamped"); + } + + @Test + void queryXmlService_stampsUnitInputOperation() { + // The regression: a Unit-input query op (e.g. iam GetAccountSummary) cannot stamp the shared + // Unit input shape, but the operation itself carries the trait so decl+impl stay symmetric. + Model m = opPlusUnitInputModel(new AwsQueryTrait(), "ListUsers", "GetAccountSummary"); + Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + assertTrue(stamped(out, "ListUsers"), "normal-input query operation must be stamped"); + assertTrue(stamped(out, "GetAccountSummary"), + "Unit-input query operation must be stamped on the operation itself"); } @Test - void pollyService_stampsOnlySynthesizeSpeechInput() { + void pollyService_stampsOnlySynthesizeSpeechOperation() { Model m = twoOpModel(RestJson1Trait.builder().build(), pollyServiceTrait(), "SynthesizeSpeech", "DescribeVoices"); Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); - assertTrue(stamped(out, "SynthesizeSpeechRequest"), "Polly SynthesizeSpeech must be stamped"); - assertFalse(stamped(out, "DescribeVoicesRequest"), + assertTrue(stamped(out, "SynthesizeSpeech"), "Polly SynthesizeSpeech must be stamped"); + assertFalse(stamped(out, "DescribeVoices"), "Polly must stamp only SynthesizeSpeech, not other operations"); } @@ -86,7 +116,7 @@ void plainRestJsonService_stampsNothing() { Model m = twoOpModel(RestJson1Trait.builder().build(), null, "GetThing", "PutThing"); Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); assertSame(m, out, "a non-query, non-Polly rest-json service must be left untouched"); - assertFalse(stamped(out, "GetThingRequest")); - assertFalse(stamped(out, "PutThingRequest")); + assertFalse(stamped(out, "GetThing")); + assertFalse(stamped(out, "PutThing")); } } From b18ffe48e416cd1fdd4ffff5a4a902233d0783b0 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 14:27:12 -0400 Subject: [PATCH 42/53] Comment cleanup --- .../generators/model/CppTypeMapper.java | 52 +++---- .../generators/model/EnumRenderer.java | 5 - .../generators/model/MemberRenderer.java | 66 ++++----- .../generators/model/ModelCodegenPlugin.java | 5 - .../generators/model/ModelTransform.java | 8 +- .../generators/model/ProtocolResolver.java | 24 ++-- .../generators/model/RenderContext.java | 5 +- .../generators/model/ShapeClassifier.java | 64 ++++----- .../generators/model/ShapeRenderer.java | 11 +- .../model/protocol/CborProtocolTraits.java | 5 +- .../model/protocol/JsonProtocolTraits.java | 15 +- .../model/protocol/ProtocolTraits.java | 46 +++--- .../protocol/QueryXmlProtocolTraits.java | 16 +-- .../model/protocol/RestXmlProtocolTraits.java | 14 +- .../model/renderers/DynamoDbRenderer.java | 7 +- .../model/renderers/EventPayloadRenderer.java | 18 ++- .../model/renderers/EventStreamRenderer.java | 26 +--- .../model/renderers/IncludeSets.java | 23 ++- .../generators/model/renderers/ModelFile.java | 14 +- .../OutgoingEventStreamRenderer.java | 28 ++-- .../renderers/RequestHeaderSerializer.java | 45 +++--- .../renderers/RequestQuerySerializer.java | 61 ++++---- .../model/renderers/RequestRenderer.java | 136 ++++++++---------- .../model/renderers/ResultRenderer.java | 33 ++--- .../model/renderers/SubObjectRenderer.java | 36 ++--- .../SmithyEndpointsJmesPathVisitor.java | 15 +- .../transforms/AccessAnalyzerTransforms.java | 16 +-- .../AdditionalRequestHeadersTrait.java | 17 +-- .../model/transforms/ChecksumMemberTrait.java | 11 +- .../transforms/ChunkedEncodingTrait.java | 13 +- .../transforms/ChunkedEncodingTransform.java | 15 +- .../model/transforms/CustomRenderedTrait.java | 19 +-- .../CustomizedAccessLogTagTrait.java | 14 +- .../model/transforms/DynamoDbTransforms.java | 20 +-- .../model/transforms/Ec2Transforms.java | 41 ++---- .../model/transforms/EmbeddedErrorsTrait.java | 10 +- .../model/transforms/GlacierTransforms.java | 29 ++-- .../model/transforms/GlobalTransforms.java | 93 +++++------- .../model/transforms/LongPollingTrait.java | 15 +- .../transforms/LongPollingTransform.java | 14 +- .../transforms/OverrideStreamingTrait.java | 12 +- .../model/transforms/S3ControlTransforms.java | 14 +- .../model/transforms/S3Transforms.java | 85 +++++------ .../transforms/SourceRegionTransform.java | 8 +- .../transforms/SupportsPresigningTrait.java | 12 +- .../SupportsPresigningTransform.java | 16 +-- .../model/transforms/TopLevelHostIdTrait.java | 10 +- .../model/transforms/TransformSupport.java | 100 +++++-------- .../generators/model/CppTypeMapperTest.java | 27 ++-- .../generators/model/EnumRendererTest.java | 5 +- .../model/EventPayloadRendererTest.java | 4 +- .../model/EventStreamRendererTest.java | 13 +- .../model/GlobalTransformsTest.java | 31 ++-- .../model/MemberRendererOutputTest.java | 16 +-- .../generators/model/MemberRendererTest.java | 24 ++-- .../generators/model/ModelGeneratorTest.java | 51 +++---- .../OutgoingEventStreamRendererTest.java | 6 +- .../ProtocolTraitsCharacterizationTest.java | 27 ++-- .../generators/model/RequestRendererTest.java | 106 +++++--------- .../generators/model/ResultRendererTest.java | 8 +- .../generators/model/ServiceNameUtilTest.java | 6 +- .../generators/model/ShapeClassifierTest.java | 39 ++--- .../model/SubObjectRendererTest.java | 41 ++---- .../model/TransformPipelineTest.java | 1 - .../protocol/JsonProtocolTraitsTest.java | 10 +- .../ProtocolTraitsIncludeSetTest.java | 5 +- .../protocol/ProtocolTraitsSerdeTest.java | 5 +- .../ProtocolTraitsStreamingPayloadTest.java | 8 +- .../model/protocol/XmlProtocolTraitsTest.java | 11 +- .../SmithyEndpointsJmesPathVisitorTest.java | 5 +- .../transforms/DynamoDbTransformsTest.java | 10 +- .../model/transforms/Ec2TransformsTest.java | 1 - .../transforms/LambdaTransformsTest.java | 1 - .../model/transforms/S3TransformsTest.java | 30 ++-- .../transforms/SourceRegionTransformTest.java | 3 +- .../model/transforms/SqsTransformsTest.java | 2 +- .../SupportsPresigningTransformTest.java | 5 +- 77 files changed, 663 insertions(+), 1200 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java index d215e88d875..19259e26f51 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapper.java @@ -34,11 +34,9 @@ private CppTypeMapper() { } /** - * Returns the C++ type/file name for a shape, capitalizing the first character so that - * lowerCamel Smithy shape names (e.g. IAM's {@code statusType}) become UpperCamel C++ - * identifiers ({@code StatusType}). This matches the legacy C2J normalization, which - * upper-camel-cases every shape name at model load - * ({@code C2jModelToGeneratorModelTransformer}). + * Returns the C++ type/file name for a shape, upper-casing the first character so lowerCamel + * Smithy names (e.g. {@code statusType}) become UpperCamel C++ identifiers ({@code StatusType}). + * Matches C2J's model-load normalization. * * @param shape the shape whose C++ type/file name is needed * @return the shape's name with its first character upper-cased @@ -68,12 +66,8 @@ public static String getCppType(Shape shape, Model model) { * @param shape the shape to map * @param model the model (needed to resolve list/map member targets) * @param wideIntegers when {@code true}, {@code integer} maps to {@code int64_t} instead of - * {@code int}. C2J applies this only under the CBOR protocol - * ({@code CORAL_TYPE_TO_CBOR_CPP_TYPE_MAPPING}: {@code integer -> int64_t}), and only - * in the file kinds whose templates set {@code $protocol == "smithy-rpc-v2-cbor"} — - * the CBOR sub-object and result headers. Request headers use the shared - * {@code RequestHeader.vm}, which does not, so they keep {@code int}. {@code long} is - * {@code long long} in every mapping and is unaffected. + * {@code int}. C2J applies this only for CBOR sub-object and result headers; request + * headers keep {@code int}. {@code long} is {@code long long} everywhere, unaffected. */ public static String getCppType(Shape shape, Model model, boolean wideIntegers) { // Check enum BEFORE string — a Smithy 2.0 EnumShape extends StringShape, and a Smithy 1.0 @@ -266,23 +260,20 @@ public static List getIncludesForShape(Shape structureShape, Model model Shape target = model.expectShape(member.getTarget()); if (isRecursiveStructMember(structureShape, target, model)) { // A recursive member is stored as std::shared_ptr. A mutually-referenced T is - // forward-declared (see getForwardDeclarations), so the header needs the allocator - // header for the inline MakeShared setter rather than T's own header. A directly - // self-referential member (T == enclosing) needs neither: the class declares itself - // and MakeShared resolves transitively. Both match C2J. + // forward-declared, so the header needs the allocator header (for the inline + // MakeShared setter) not T's own. A directly self-referential member needs neither. + // Both match C2J. if (!target.getId().equals(selfId)) { includes.add(""); } } else { addMemberInclude(includes, target, selfId, model, projectName); // For list/map, recursively include every nested element/key/value type so leaf - // struct/enum headers reach the surface even through nested containers (e.g. - // apigateway Deployment.apiSummary: Map>). + // struct/enum headers surface even through nested containers. addContainerIncludes(includes, target, selfId, model, projectName); } - // @idempotencyToken members are brace-initialized with - // Aws::Utils::UUID::PseudoRandomUUID(), which requires UUID.h. Matches C2J - // (CppViewHelper.computeMemberIncludeName). + // @idempotencyToken members are brace-initialized with PseudoRandomUUID(), needing + // UUID.h. Matches C2J. if (member.hasTrait(IdempotencyTokenTrait.class)) { includes.add(""); } @@ -303,15 +294,11 @@ private static void addMemberInclude(Set includes, Shape shape, ShapeId } /** - * Recursively adds member-type includes for every nested element/key/value of a list or map - * shape. Recursion only descends through further list/map shapes and stops at - * structures/enums/scalars, so it is bounded by the container-nesting depth (no infinite - * recursion). {@code addMemberInclude} remains a no-op for container/scalar shapes without - * their own header. This lets a member typed, e.g., {@code Map>} - * reach {@code Leaf}'s header, matching C2J's recursive unwrap. + * Recursively adds member-type includes for every nested element/key/value of a list or map, + * descending only through further list/map shapes (bounded by nesting depth). Lets a member + * typed {@code Map>} reach {@code Leaf}'s header. C2J parity. * - *

The {@code @sparse}->{@code } handling fires at each nested - * container level that is sparse, matching C2J's generated headers. + *

{@code @sparse} adds {@code } at each sparse nesting level. */ private static void addContainerIncludes(Set includes, Shape target, ShapeId selfId, Model model, String projectName) { @@ -328,8 +315,8 @@ private static void addContainerIncludes(Set includes, Shape target, Sha addContainerIncludes(includes, key, selfId, model, projectName); addContainerIncludes(includes, value, selfId, model, projectName); } - // A @sparse list/map wraps its element/value in Aws::Crt::Optional, declared in - // . Matches C2J's generated SparseNullsOperationRequest.h. + // A @sparse list/map wraps its element/value in Aws::Crt::Optional (). + // C2J parity. if ((target.isListShape() || target.isMapShape()) && target.hasTrait(SparseTrait.class)) { includes.add(""); } @@ -337,9 +324,8 @@ private static void addContainerIncludes(Set includes, Shape target, Sha /** * Returns the sorted C++ class names of every direct member whose target forms a reference - * cycle with {@code structureShape} (see {@link #isRecursiveStructMember}). These are stored - * as {@code std::shared_ptr} and must be forward-declared (not included) in the header to - * break the otherwise-infinite by-value member. Matches C2J's {@code computeForwardDeclarations}. + * cycle with {@code structureShape}. Stored as {@code std::shared_ptr}, they are + * forward-declared (not included) to break the otherwise-infinite by-value member. C2J parity. * * @param structureShape the enclosing structure/union * @param model the model diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java index 043fb5585ab..9a2d06e0d1f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRenderer.java @@ -69,7 +69,6 @@ public static void renderHeader(CppWriter writer, Shape enumShape, String servic writer.write("namespace $L {", serviceName); writer.write("namespace Model {"); - // Enum class declaration // Use single-line format if it fits within ~140 chars, multi-line otherwise String singleLine = "enum class " + enumName + " { NOT_SET, " + String.join(", ", values) + " };"; @@ -89,7 +88,6 @@ public static void renderHeader(CppWriter writer, Shape enumShape, String servic } writer.write(""); - // Mapper namespace writer.write("namespace $LMapper {", enumName); writer.write("$1L $2L Get$2LForName(const Aws::String& name);", exportMacro, enumName); writer.write(""); @@ -130,14 +128,12 @@ public static void renderSource(CppWriter writer, Shape enumShape, String servic writer.write("namespace $LMapper {", enumName); writer.write(""); - // Hash constants for (int i = 0; i < values.size(); i++) { writer.write(" static const int $1L_HASH = HashingUtils::HashString(\"$2L\");", values.get(i), wireValues.get(i)); } writer.write(""); - // GetForName writer.write(" $1L Get$1LForName(const Aws::String& name) {", enumName); writer.write(" int hashCode = HashingUtils::HashString(name.c_str());"); for (int i = 0; i < values.size(); i++) { @@ -155,7 +151,6 @@ public static void renderSource(CppWriter writer, Shape enumShape, String servic writer.write(" }"); writer.write(""); - // GetNameFor writer.write(" Aws::String GetNameFor$1L($1L enumValue) {", enumName); writer.write(" switch (enumValue) {"); writer.write(" case $1L::NOT_SET:", enumName); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java index d12bfbe576f..918a5fbfcc2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRenderer.java @@ -107,11 +107,10 @@ public void renderPublicAccessors(CppWriter writer) { writer.write("inline const $L& Get$L() const { return $L; }", cppType, methodName, fieldName); } - // The framework-injected ResponseMetadata envelope is always present, so — like C2J — - // it gets no HasBeenSet getter (and its flag is initialized true, below). Every other - // member, including modeled @required ones, tracks presence via HasBeenSet, matching - // C2J's mass-clear of required-ness. `emitHasBeenSet` is the useRequiredField context - // (true for sub-objects/requests, false for results). + // The injected ResponseMetadata envelope is always present, so (like C2J) gets no + // HasBeenSet getter (flag initialized true below). Every other member — including + // @required ones — tracks presence via HasBeenSet. emitHasBeenSet is the + // useRequiredField context (true for sub-objects/requests, false for results). if (emitHasBeenSet && !isInjectedResponseMetadata(member)) { writer.write("inline bool $LHasBeenSet() const { return $LHasBeenSet; }", methodName, fieldName); } @@ -133,9 +132,9 @@ public void renderPublicAccessors(CppWriter writer) { writer.openBlock("void Set$L($L&& value) {", "}", methodName, templateParam, () -> { writer.write("$LHasBeenSet = true;", fieldName); if (recursive) { - // Wrap the value in a shared_ptr, tagged with the enclosing class name for - // the allocator. The template setter is only instantiated at call sites, - // where T is complete, so the header can forward-declare T. Matches C2J. + // Wrap in a shared_ptr tagged with the enclosing class name for the + // allocator. The template setter instantiates only at call sites (where T + // is complete), so the header can forward-declare T. Matches C2J. writer.write("$L = Aws::MakeShared<$L>(\"$L\", std::forward<$L>(value));", fieldName, cppType, className, templateParam); } else { @@ -281,10 +280,8 @@ public static void renderRequestIdAccessors(CppWriter writer, String className) /** * Renders the top-level {@code RequestId} accessor group. When {@code withHasBeenSetGetter} is - * {@code true}, the {@code inline bool RequestIdHasBeenSet() const} getter is emitted after the - * {@code GetRequestId} getter — the MODEL-class variant C2J stamps onto an operation-output - * shape that is also referenced as a member (dual-role sub-object). Result classes pass - * {@code false} (no {@code HasBeenSet} getter), matching {@link #forResult}. + * true, also emits {@code RequestIdHasBeenSet()} — the model-class variant C2J stamps onto a + * dual-role output shape (also referenced as a member). Result classes pass false. */ public static void renderRequestIdAccessors(CppWriter writer, String className, boolean withHasBeenSetGetter) { @@ -309,12 +306,10 @@ public static void renderRequestIdAccessors(CppWriter writer, String className, } /** - * Renders the top-level {@code HostId} (x-amz-id-2) accessor group emitted by S3 Control result - * headers immediately after the {@code RequestId} group: {@code GetHostId} / templated - * {@code SetHostId} / templated {@code WithHostId}. Callers gate emission on - * {@code TopLevelHostIdTrait} and separately emit the {@code m_hostId} field and its - * {@code HasBeenSet} flag in the private section. Matches C2J's {@code addToAllResultsShape} - * HostId member, including the doc string. + * Renders the top-level {@code HostId} (x-amz-id-2) accessor group emitted by S3 Control + * result headers after the {@code RequestId} group. Callers gate on {@code TopLevelHostIdTrait} + * and separately emit the {@code m_hostId} field and its {@code HasBeenSet} flag. Matches C2J's + * {@code addToAllResultsShape} HostId member. */ public static void renderHostIdAccessors(CppWriter writer, String className) { writer.write(""); @@ -336,9 +331,8 @@ public static void renderHostIdAccessors(CppWriter writer, String className) { /** * Writes a single private data member declaration. {@code @idempotencyToken} members are - * brace-initialized with {@code Aws::Utils::UUID::PseudoRandomUUID()} so a caller who omits - * the token still gets idempotent behavior; other members fall back to their type's default - * initializer (or none). Matches C2J's ServiceClientModelHeaderMemberDeclaration.vm. + * brace-initialized with {@code Aws::Utils::UUID::PseudoRandomUUID()} (idempotent even when the + * caller omits the token); others use their type's default initializer or none. C2J parity. */ private static void writeDataMember(CppWriter writer, MemberShape member, String memberName, Model model, boolean wideIntegers, boolean recursive) { @@ -361,11 +355,9 @@ private static void writeDataMember(CppWriter writer, MemberShape member, String } /** - * Writes a single HasBeenSet flag. Matches C2J's ModelClassMembersAndInlines.vm: the flag is - * initialized to {@code true} for an {@code @idempotencyToken} member (auto-populated at - * construction) or a {@code @required} member in a useRequiredField context ({@code emitHasBeenSet} - * — sub-objects/requests, but not results), except when the member is an event stream or a raw - * streaming payload. All other members default to {@code false}. + * Writes a single HasBeenSet flag. Matches C2J: initialized true for an + * {@code @idempotencyToken} member or a {@code @required} member in a useRequiredField context + * ({@code emitHasBeenSet}), unless it is an event stream or raw streaming payload; else false. */ private void writeHasBeenSetFlag(CppWriter writer, MemberShape member, String memberName) { String fieldName = CppNames.fieldName(memberName); @@ -382,13 +374,11 @@ private boolean initialHasBeenSet(MemberShape member) { } /** - * True if this member is the framework-injected {@code ResponseMetadata} envelope - * ({@code GlobalTransforms.injectResponseMetadata}): a member named {@code ResponseMetadata} - * whose target is the injected {@code ResponseMetadata} structure. It is the only member - * rendered as always-present (no {@code HasBeenSet} getter; flag initialized true in a - * HasBeenSet context), matching C2J, which likewise identifies ResponseMetadata by name. - * {@code injectResponseMetadata} fails fast on any modeled ResponseMetadata collision, so this - * name-based check is unambiguous. + * True if this member is the framework-injected {@code ResponseMetadata} envelope: a member + * named {@code ResponseMetadata} whose target is the injected {@code ResponseMetadata} struct. + * It is the only always-present member (no {@code HasBeenSet} getter; flag true in a HasBeenSet + * context). C2J also identifies it by name; {@code injectResponseMetadata} fails fast on any + * modeled collision, so this check is unambiguous. */ private boolean isInjectedResponseMetadata(MemberShape member) { return GlobalTransforms.RESPONSE_METADATA.equals(member.getMemberName()) @@ -416,8 +406,7 @@ private boolean isRawStreamingPayloadMember(MemberShape member) { /** * True if a container element / map key or value is passed to {@code Add*} by value rather - * than by perfect-forwarding reference. Matches C2J: primitive and enum types are by-value - * (they are cheap and trivially copyable), everything else is forwarded. + * than perfect-forwarded. Matches C2J: primitives and enums are by-value, everything else forwarded. */ private static boolean isByValueType(Shape shape) { return CppTypeMapper.isPrimitive(shape) || CppTypeMapper.isEnum(shape); @@ -441,10 +430,9 @@ public static void writeDocComment(CppWriter writer, String doc) { } /** - * Renders the class-level documentation comment for a shape: its {@code @documentation} - * text followed by a "See Also" link to the AWS API reference. Emits an empty doc comment - * ({@code /** *}{@code /}) when the shape carries no documentation. Shared by the - * request, result, sub-object, and event-stream union renderers. + * Renders a shape's class-level doc comment: its {@code @documentation} text plus a "See Also" + * link to the AWS API reference (empty doc comment when undocumented). Shared by the request, + * result, sub-object, and event-stream union renderers. * * @param writer the CppWriter to write to * @param shape the shape whose class doc to render (structure or union) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 1bf8ecf3831..65905d5e67c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -44,17 +44,14 @@ public String getName() { public void execute(PluginContext context) { Model model = context.getModel(); - // Skip legacy mock projections (no model files to generate) if (context.getProjectionName().endsWith(".mock")) { return; } - // Parse settings ObjectNode settings = context.getSettings(); Map serviceMap = parseMapSetting(settings, "c2jMap"); Map namespaceMap = parseNamespaceMap(settings); - // Build transform pipeline (service-level transforms will be registered here) TransformPipeline pipeline = new TransformPipeline(List.of( GlobalTransforms.asTransform(), SourceRegionTransform.asTransform(), @@ -79,14 +76,12 @@ public void execute(PluginContext context) { ServiceShape processedService = ServiceNameUtil.processS3CrtProjection( service, context.getProjectionName()); - // Apply transforms for this service Model transformedModel = pipeline.apply(model, processedService); String serviceName = ServiceNameUtil.getServiceName(processedService); String smithyServiceName = ServiceNameUtil.getSmithyServiceName(processedService, serviceMap); String exportMacro = ServiceNameUtil.getExportMacro(processedService, serviceMap); - // Resolve namespace override String namespace = namespaceMap.getOrDefault(smithyServiceName, serviceName); ModelGenerator generator = new ModelGenerator( diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java index 396fb3be6bf..843e59563d7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java @@ -8,12 +8,8 @@ import software.amazon.smithy.model.shapes.ServiceShape; /** - * A model-to-model transform applied before code generation. - * - *

Transforms run in sequence. Each receives the model produced by the previous - * transform (or the original model for the first in the chain). Service-level - * transforms (e.g., S3-specific shape mutations) implement this interface and are - * registered in the pipeline. + * A model-to-model transform applied before code generation. Transforms run in sequence, + * each receiving the previous transform's output (or the original model for the first). */ @FunctionalInterface public interface ModelTransform { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolResolver.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolResolver.java index 83b86a5c854..9e33439f476 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolResolver.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolResolver.java @@ -20,21 +20,17 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.protocol.RestXmlProtocolTraits; /** - * Resolves the wire protocol for a Smithy service shape, and maps a resolved - * protocol to the {@link ProtocolTraits} strategy that owns its rendering. - * - *

{@link #traitsFor} is the single protocol-to-behavior switch in the generator; - * downstream generators hold a {@code ProtocolTraits} and never branch on - * {@link Protocol} themselves. + * Resolves the wire protocol for a Smithy service shape and maps it to the {@link ProtocolTraits} + * strategy that owns its rendering. {@link #traitsFor} is the generator's single + * protocol-to-behavior switch; downstream generators hold a {@code ProtocolTraits} and never + * branch on {@link Protocol}. */ public final class ProtocolResolver { /** - * Wire protocol variants supported by the C++ SDK code generator. - * - *

Each variant encapsulates the C++ serde namespace, the type used for - * deserialization (view), the type used for serialization (value), and the - * method name emitted on request shapes. + * Wire protocol variants supported by the C++ SDK code generator. Each carries its C++ serde + * namespace, view (deserialize) type, value (serialize) type, and the serialize method name + * emitted on request shapes. */ public enum Protocol { JSON("Aws::Utils::Json", "Aws::Utils::Json::JsonView", "Aws::Utils::Json::JsonValue", "Jsonize"), @@ -130,10 +126,8 @@ public static Protocol resolve(ServiceShape service, Model model) { /** * Returns the rendering strategy for a resolved protocol. * - *

This is the only place in the generator that switches on - * {@link Protocol}. Every other class receives a {@link ProtocolTraits} and calls - * it, so adding a protocol means adding a case here plus (if its C++ surface is - * genuinely new) one implementation class. + *

The only place in the generator that switches on {@link Protocol}; adding a protocol + * means a case here plus (if its C++ surface is genuinely new) one implementation class. * * @param protocol the protocol returned by {@link #resolve} * @return the strategy that owns this protocol's serde rendering diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RenderContext.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RenderContext.java index 0486fdfd94a..3ad5a649f0d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RenderContext.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RenderContext.java @@ -9,9 +9,8 @@ import software.amazon.smithy.model.shapes.ServiceShape; /** - * Immutable bundle of the per-service inputs every {@link ShapeRenderer} needs. - * Replaces the repeated 6-7 positional constructor arguments so adding a shared - * input is a single-field change rather than an edit to every renderer. + * Immutable bundle of the per-service inputs every {@link ShapeRenderer} needs, so adding a + * shared input is a single-field change rather than an edit to every renderer. * * @param model the transformed Smithy model * @param service the service shape being generated diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index ecbba4994d8..34812a68b20 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -73,13 +73,12 @@ public record EventStreamInfo(String operationName, StructureShape requestShape, * @param enums EnumShape or StringShape with @enum trait * @param eventStreamHandlers operation + request/result shape tuples for event stream handlers * @param outgoingEventStreams outgoing event stream shapes (header only) - * @param blobPayloadEvents event structs (members of a {@code @streaming} union) whose sole - * payload is a single {@code @eventPayload} blob member; rendered - * header-only as a blob-carrier event (C2J {@code eventPayloadType == - * "blob"}), never as a JSON sub-object - * @param resultOutputIds shape ids of every operation output; a sub-object whose id is in - * this set is "dual-role" (an output that is also a member) and, for - * JSON-family protocols, receives the C2J {@code requestId} stamp + * @param blobPayloadEvents event structs whose sole payload is a single {@code @eventPayload} + * blob member; rendered header-only as a blob-carrier event (C2J + * {@code eventPayloadType == "blob"}), never a JSON sub-object + * @param resultOutputIds shape ids of every operation output; a sub-object in this set is + * "dual-role" (output also used as a member) and, for JSON-family + * protocols, receives the C2J {@code requestId} stamp */ public record ClassifiedShapes( List requests, @@ -123,9 +122,8 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto // Collect operation inputs/outputs and identify event stream handlers. Deprecated operations // are excluded (matching legacy C2J), so their orphaned request/result structs never emit. for (OperationShape op : GlobalTransforms.nonDeprecatedOperations(model, service)) { - // Use getInputShape() (not getInput()) so no-input operations, whose input - // target is smithy.api#Unit, still produce a RequestInfo. C2J emits a Request - // class for every operation; the generated client method references it. + // Use getInputShape() (not getInput()) so no-input operations (input == smithy.api#Unit) + // still produce a RequestInfo. C2J emits a Request class for every operation. ShapeId inputId = op.getInputShape(); inputShapeIds.add(inputId); model.getShape(inputId).flatMap(Shape::asStructureShape).ifPresent(s -> { @@ -169,9 +167,8 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } // Structs that are members of a reachable @streaming union — i.e. events. A blob-payload - // event is only recognised among these (analogous to memberTargetIds but restricted to - // event unions), so a plain data struct that merely happens to carry an @eventPayload blob - // is never mis-claimed. + // event is recognised only among these, so a plain data struct carrying an @eventPayload + // blob is never mis-claimed. Set eventStructIds = new HashSet<>(); for (ShapeId id : reachable) { Shape shape = model.expectShape(id); @@ -180,10 +177,9 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } } - // Incoming event-stream union shape ids: the @streaming union member of every operation - // output collected as an event-stream handler. These unions are realized via the handler - // (EventStreamRenderer.renderHandler{Header,Source}) and never referenced as a data type, - // so their standalone .h is dead public API that we omit. + // Incoming event-stream union shape ids: the @streaming union member of every event-stream + // handler output. Realized via the handler and never referenced as a data type, so their + // standalone .h is dead public API we omit. Set incomingEventStreamUnionIds = new HashSet<>(); for (EventStreamInfo info : eventStreamHandlers) { streamingUnionMember(info.resultShape(), model) @@ -201,8 +197,8 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto // Already collected as an outgoing event stream; do not also render as a data union. } else if (isBlobPayloadEvent(shape, model, eventStructIds)) { // A @streaming-union event whose payload is a single @eventPayload blob member is a - // header-only blob-carrier event (C2J eventPayloadType == "blob"), not a JSON - // sub-object. Routed here before the generic structure branch below. + // header-only blob-carrier event (C2J eventPayloadType == "blob"), routed here + // before the generic structure branch. blobPayloadEvents.add(shape); } else if (shape.hasTrait(ErrorTrait.class)) { if (isModeledException(shape.asStructureShape().get(), protocol)) { @@ -211,11 +207,9 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } else if (shape.isStructureShape() || shape.isUnionShape()) { // Skip: // - @customRendered shapes (emitted by a dedicated renderer, e.g. DynamoDbRenderer - // for AttributeValue) so the two do not both write — and append into — the same - // model file. - // - empty-member event structs — after EventStreamRenderer's void() callback fix, - // these have no other references and shipping their .h/.cpp adds dead public API - // to the SDK. + // for AttributeValue) so both do not write into the same model file. + // - empty-member event structs — no other references, so their .h/.cpp is dead + // public API. boolean customRendered = shape.hasTrait(CustomRenderedTrait.class); boolean emptyEventStruct = eventStructIds.contains(id) && shape.isStructureShape() @@ -232,14 +226,10 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } /** - * Determines if an exception shape has members beyond the trivial ones. - * - *

For JSON/CBOR protocols, trivial members are: Message, message. - * For XML protocols, trivial members are: Message, message, Code, code. - * If the exception has any member not in the trivial set, it is "modeled" - * and should generate as a sub-object. Also used by {@code EventStreamRenderer} to decide - * whether an event-stream union's exception member is typed as its concrete shape (modeled) - * or the generic {@code Error} wrapper (non-modeled). + * True if an exception shape has members beyond the trivial ones (Message/message for + * JSON/CBOR; plus Code/code for XML), making it "modeled" and generated as a sub-object. + * Also used by {@code EventStreamRenderer} to type a union's exception member as its concrete + * shape (modeled) or the generic {@code Error} wrapper (non-modeled). */ public static boolean isModeledException(StructureShape shape, Protocol protocol) { Set members = shape.getAllMembers().keySet(); @@ -271,13 +261,9 @@ private static boolean hasRawStreamingPayload(StructureShape shape, Model model) } /** - * True if {@code shape} is a blob-payload event: a structure that is a member of a reachable - * {@code @streaming} union (i.e. an event) and carries a member whose trait set includes - * {@code smithy.api#eventPayload} and whose target is a blob. This mirrors C2J's - * {@code eventPayloadType == "blob"} case (C2jModelToGeneratorModelTransformer): a blob member - * is a raw blob payload only when explicitly {@code @eventPayload}. Non-blob eventPayload - * events (e.g. a CompleteEvent with only string members) are NOT claimed — they remain - * sub-objects. + * True if {@code shape} is a blob-payload event: a member of a reachable {@code @streaming} + * union carrying an {@code @eventPayload} blob member. Mirrors C2J's {@code eventPayloadType == + * "blob"} case; non-blob eventPayload events remain sub-objects. */ private static boolean isBlobPayloadEvent(Shape shape, Model model, Set eventStructIds) { if (!shape.isStructureShape() || !eventStructIds.contains(shape.getId())) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeRenderer.java index 47ae2d878c9..a5cdb1c8718 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeRenderer.java @@ -7,14 +7,9 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriterDelegator; /** - * Strategy interface for rendering C++ code for a specific shape classification. - * - *

Each implementation handles one classification bucket (enum, sub-object, request, - * result, event stream, etc.). The {@link ModelGenerator} dispatches classified shapes - * to the appropriate renderer. - * - *

To add a new classification (e.g., event stream), implement this interface and - * register the renderer in {@link ModelGenerator}. + * Strategy for rendering C++ code for one shape classification bucket (enum, sub-object, request, + * result, event stream, etc.). {@link ModelGenerator} dispatches classified shapes to the matching + * renderer; add a classification by implementing this and registering it there. */ public interface ShapeRenderer { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java index 1a292aa8706..a406574efaf 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java @@ -92,9 +92,8 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of("aws/crt/cbor/Cbor.h"); - // All source kinds share one include set. RPC CBOR is an RPC protocol: request sources - // never run the shared @httpQuery / @httpHeader serializers, so they need no URI / - // StringUtils includes — REQUEST_SOURCE carries the same set as every other source kind. + // All source kinds share one include set. RPC CBOR request sources never run the shared + // @httpQuery/@httpHeader serializers, so REQUEST_SOURCE carries the same set as the rest. case REQUEST_SOURCE: case SUBOBJECT_SOURCE: case RESULT_SOURCE: diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index 02cbe833222..ce9f625a145 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -89,10 +89,9 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of(); - // Request sources additionally serialize @httpHeader/@httpQuery members via the shared - // serializers, which need URI (AddQueryStringParameter), StringUtils, and - // (std::accumulate for comma-joined list @httpHeader members). These are added only - // here to avoid widening the other source kinds. + // Request sources also serialize @httpHeader/@httpQuery members, needing URI, + // StringUtils, and (std::accumulate for comma-joined list headers). Added + // only here to avoid widening other source kinds. case REQUEST_SOURCE: return List.of( "aws/core/utils/json/JsonSerializer.h", @@ -103,8 +102,7 @@ public List serdeIncludes(FileKind kind) { "aws/core/http/URI.h", "numeric", "utility"); - // All source kinds share one union (supersets allowed: a .cpp may carry an - // include it doesn't strictly use). Usings are unchanged; only #includes widen. + // All source kinds share one union (supersets allowed). Only #includes widen; usings unchanged. case SUBOBJECT_SOURCE: case RESULT_SOURCE: case STREAMING_RESULT_SOURCE: @@ -213,10 +211,7 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className, shape, model); } - // A presignable operation (e.g. Polly's SynthesizeSpeech) declares the protocol-agnostic - // DumpBodyToUrl override (emitted by RequestRenderer, gated on the same operation trait); the - // real body defers with serde, as SerializePayload does, so this is a stub. - // UnreferencedParam.h is in serdeIncludes(REQUEST_SOURCE). + // DumpBodyToUrl stub for presigning-capable operations; body serialization pending schema serde. if (operation.hasTrait(SupportsPresigningTrait.class)) { writer.write(""); writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }", diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index f144e81d2e1..c3c375ce9e5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -21,10 +21,9 @@ /** * Owns every protocol-specific rendering decision for generated model code. * - *

Renderers receive a {@code ProtocolTraits} and call these methods; they never - * branch on {@link Protocol} themselves. One implementation exists per serde - * family (JSON-like, REST-XML, query-XML), not per protocol, so the - * conditional arms that used to be repeated across renderers are now classes. + *

Renderers receive a {@code ProtocolTraits} and call these methods; they never branch on + * {@link Protocol}. One implementation exists per serde family (JSON-like, REST-XML, + * query-XML), not per protocol. * *

Obtain an instance from * {@code ProtocolResolver.traitsFor(ProtocolResolver.resolve(service, model))}. @@ -153,36 +152,28 @@ default boolean hasTargetHeader() { /** * Whether this protocol honors HTTP binding traits ({@code @httpHeader} / * {@code @httpPrefixHeaders} / {@code @httpQuery} / {@code @httpQueryParams}) by serializing - * those members onto the wire (request headers / query string). + * those members onto the wire. * - *

REST protocols (rest-json, rest-xml, query/ec2) return {@code true}. RPC protocols - * (awsJson1_0/1_1, rpcv2Cbor) route these members into the request body instead, so - * they return {@code false}: their {@code GetRequestSpecificHeaders} still emits the fixed - * protocol headers ({@code X-Amz-Target} for awsJson; {@code Content-Type}/{@code smithy-protocol}/ - * {@code Accept} for CBOR), but no member header/query serialization is emitted, and no - * {@code AddQueryStringParameters} method is generated. Matches the legacy C2J per-protocol - * behavior (byte-parity reference). + *

REST protocols return {@code true}. RPC protocols (awsJson, rpcv2Cbor) route these members + * into the body and return {@code false}: they still emit fixed protocol headers but no member + * header/query serialization and no {@code AddQueryStringParameters}. C2J parity. */ default boolean serializesHttpBindingMembers() { return true; } /** - * Whether {@code integer} members widen to {@code int64_t} (rather than {@code int}) in this - * protocol's sub-object and result headers. C2J does this only for CBOR - * ({@code CORAL_TYPE_TO_CBOR_CPP_TYPE_MAPPING}: {@code integer -> int64_t}, applied where the - * template sets {@code $protocol == "smithy-rpc-v2-cbor"}). Request headers use the shared - * {@code RequestHeader.vm}, which does not widen, so this never affects request members. + * Whether {@code integer} members widen to {@code int64_t} in this protocol's sub-object and + * result headers. C2J does this only for CBOR; request headers never widen. */ default boolean widensIntegers() { return false; } /** - * Whether result classes for this protocol expose a top-level {@code GetRequestId()} / - * {@code m_requestId} accessor. C2J emits it for every protocol except Query/EC2, - * whose results instead carry the request id inside the injected {@code ResponseMetadata} - * member. Query/EC2 override this to {@code false}. + * Whether result classes expose a top-level {@code GetRequestId()} / {@code m_requestId} + * accessor. C2J emits it for every protocol except Query/EC2 (which carry the request id inside + * the injected {@code ResponseMetadata}); Query/EC2 override to {@code false}. */ default boolean resultHasTopLevelRequestId() { return true; @@ -207,17 +198,14 @@ default void writeGetRequestSpecificHeadersImpl(CppWriter writer, String classNa service.getId().getName(), operation.getId().getName()); } // Per-service constant request headers (C2J metadata.additionalHeaders, e.g. Glacier's - // x-amz-glacier-version). Streaming requests derive from AmazonStreamingWebServiceRequest - // and bypass Request::GetHeaders, so these are emitted here — matching - // StreamRequestSource.vm, which inserts them after X-Amz-Target and before the - // member-driven headers. The trait is stamped only on request shapes that need it. + // x-amz-glacier-version). Streaming requests bypass Request::GetHeaders, so + // these are emitted here (after X-Amz-Target, before member-driven headers). Trait-gated. shape.getTrait(AdditionalRequestHeadersTrait.class).ifPresent(trait -> trait.getHeaders().forEach((name, value) -> writer.write("headers.insert(Aws::Http::HeaderValuePair(\"$L\", \"$L\"));", name, value))); - // C2J declares the stringstream once, immediately after `headers`, whenever the request - // has ≥1 header member (even all-enum/timestamp members, which never use it). RPC - // protocols route HTTP-binding members to the body, so neither the stringstream nor the - // member serialization is emitted for them. + // C2J declares the stringstream once after `headers` whenever the request has >=1 + // header member. RPC protocols route HTTP-binding members to the body, so they emit + // neither the stringstream nor member serialization. if (serializesHttpBindingMembers() && RequestBindings.hasHeaderMembers(shape, model)) { writer.write("Aws::StringStream ss;"); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java index 19c923cb95b..7d9cd84642e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/QueryXmlProtocolTraits.java @@ -96,10 +96,9 @@ public List serdeIncludes(FileKind kind) { case RESULT_HEADER: // Query/EC2 result headers forward-declare XmlDocument; no serde include. return List.of(); - // Request sources additionally serialize @httpHeader/@httpQuery members via the shared - // serializers, which need URI (AddQueryStringParameter), StringUtils, the stringstream, - // and (std::accumulate for comma-joined list @httpHeader members). URI.h is - // added only here to avoid widening the other source kinds. + // Request sources also serialize @httpHeader/@httpQuery members, needing URI, + // StringUtils, the stringstream, and (std::accumulate for comma-joined list + // headers). URI.h added only here to avoid widening other source kinds. case REQUEST_SOURCE: return List.of( "aws/core/utils/xml/XmlSerializer.h", @@ -217,9 +216,8 @@ public void writeRequestMethodDecls(CppWriter writer, String exportMacro, writer.write(""); writeAddQueryStringParametersDecl(writer, exportMacro); } - // The protected DumpBodyToUrl override declaration is emitted protocol-agnostically by - // RequestRenderer (gated on the operation's SupportsPresigningTrait, stamped on every - // query/ec2 operation including Unit-input ops); only the impl below is protocol-specific. + // The DumpBodyToUrl override decl is emitted protocol-agnostically by RequestRenderer + // (gated on SupportsPresigningTrait); only the impl below is protocol-specific. } @Override @@ -237,8 +235,8 @@ public void writeRequestMethodImpls(CppWriter writer, String className, writer.write(""); writeAddQueryStringParametersImpl(writer, className, shape, model); } - // Gate the DumpBodyToUrl impl on the same operation trait as the RequestRenderer decl so the - // two stay symmetric: a Unit-input op with the trait gets both, an op without it gets neither. + // Gate the DumpBodyToUrl impl on the same trait as the RequestRenderer decl so the two stay + // symmetric. if (operation.hasTrait(SupportsPresigningTrait.class)) { writer.write(""); writer.write("void $L::DumpBodyToUrl(Aws::Http::URI& uri) const { uri.SetQueryString(SerializePayload()); }", diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index db5838d18e9..9522dce53d1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -75,10 +75,9 @@ public List serdeIncludes(FileKind kind) { case SUBOBJECT_HEADER: case RESULT_HEADER: return List.of(); - // Request sources additionally serialize @httpHeader/@httpQuery members, which need - // StringUtils (to_string), URI (URLEncodePath for x-amz-copy-source), and - // (std::accumulate for comma-joined list headers). C2J pulls these per-shape; the - // data-driven set carries them for every request source (superset). + // Request sources also serialize @httpHeader/@httpQuery members, needing StringUtils, + // URI (URLEncodePath), and (std::accumulate for comma-joined list headers). + // Carried for every request source (superset). case REQUEST_SOURCE: return List.of( "aws/core/utils/xml/XmlSerializer.h", @@ -199,11 +198,8 @@ private void writeHasEmbeddedErrorDecl(CppWriter writer, String exportMacro) { + "const Http::HeaderValueCollection &header) const override;", exportMacro); } - // Constant XML error-sniff body, identical across C2J's S3 request-source templates - // (XmlRequestSource / StreamRequestSource / PutBucketNotificationConfigurationRequest): parse the - // response body as XML and report an embedded error when the root element is . It is not - // shape-dependent, so there is nothing to defer. XmlSerializer.h + UnreferencedParam.h and the - // Aws::Utils::Xml / Aws::Utils usings are already in the REQUEST_SOURCE serde includes/usings. + // Constant XML error-sniff body, identical across C2J's S3 request-source templates: parse the + // body as XML and report an embedded error when the root element is . Not shape-dependent. private void writeHasEmbeddedErrorImpl(CppWriter writer, String className) { writer.openBlock("bool $L::HasEmbeddedError(Aws::IOStream& body, " + "const Aws::Http::HeaderValueCollection& header) const {", "}", className, () -> { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java index dd89c780818..d7aecfaaf27 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/DynamoDbRenderer.java @@ -14,10 +14,9 @@ /** * Emits DynamoDB's bespoke document-type {@code AttributeValue} / {@code AttributeValueValue} - * classes, matching the legacy C2J {@code DynamoDBJsonCppClientGenerator}. The four files are - * static hand-written C++ (no model-driven content); their bodies live as classpath resources and - * are written verbatim. No-op for every non-DynamoDB service. The default union rendering of the - * {@code AttributeValue} shape is suppressed in {@code ModelGenerator}. + * classes (C2J {@code DynamoDBJsonCppClientGenerator}). The four files are static hand-written C++ + * written verbatim from classpath resources; no-op for non-DynamoDB services. Default union + * rendering of {@code AttributeValue} is suppressed in {@code ModelGenerator}. */ public final class DynamoDbRenderer implements ShapeRenderer { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java index 820f6644f81..8f5fa136b1b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventPayloadRenderer.java @@ -21,14 +21,13 @@ /** * Renders header-only blob-carrier events: an event struct (member of a {@code @streaming} union) - * whose sole payload is a single {@code @eventPayload} blob member (C2J {@code eventPayloadType == - * "blob"}). C2J renders these via {@code EventHeader.vm} as a plain value type carrying an - * {@code Aws::Vector} payload — a bytes constructor, non-template const-ref / rvalue - * accessors, and a {@code GetWithOwnership()} move-out — with NO {@code Jsonize} / - * {@code JsonView} serde and NO {@code .cpp}. + * whose sole payload is one {@code @eventPayload} blob member (C2J {@code eventPayloadType == "blob"}). + * C2J renders these via {@code EventHeader.vm} as a plain value type over an + * {@code Aws::Vector} (bytes ctor, const-ref/rvalue accessors, a + * {@code GetWithOwnership()} move-out), with no serde and no {@code .cpp}. * - *

These shapes are routed here by {@link ShapeClassifier} instead of {@code subObjects}, so the - * generic {@code SubObjectRenderer} JSON path never sees them. + *

{@link ShapeClassifier} routes these here instead of {@code subObjects}, so the generic + * {@code SubObjectRenderer} JSON path never sees them. */ public final class EventPayloadRenderer implements ShapeRenderer { @@ -103,9 +102,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, StructureShape sha } /** - * Emits the payload member's doc comment. Matches C2J's {@code EventHeader.vm}, which always - * renders a {@code /** ... *}{@code /} block from the member's {@code @documentation} - * (whitespace-collapsed). + * Emits the payload member's doc comment (whitespace-collapsed {@code @documentation}), matching + * C2J {@code EventHeader.vm}. */ private void writeMemberDoc(CppWriter writer, MemberShape payload) { String doc = payload.getTrait(DocumentationTrait.class) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java index 0ffab02d1c0..805134b4a40 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java @@ -24,15 +24,11 @@ import java.util.Optional; /** - * Renders C++ event stream artifacts for response-side (simplex) streaming operations: - * the handler and initial response. Driven by the classifier's {@link EventStreamInfo} - * list. Event structure shapes themselves are generated elsewhere (as reachable - * sub-objects) and only referenced here. The {@code @streaming} union data type is not - * emitted: it is realized entirely through the handler and referenced by nothing, so the - * classifier drops it from sub-objects (dead public API). - * - *

No protocol-specific serialization is emitted; payload (de)serialization points - * are protocol-agnostic TODO stubs via {@link ProtocolTraits}. + * Renders C++ event stream artifacts for response-side (simplex) streaming operations: the handler + * and initial response, driven by the classifier's {@link EventStreamInfo} list. Event structures + * are generated elsewhere (as reachable sub-objects) and only referenced here; the {@code @streaming} + * union data type is not emitted (realized through the handler, referenced by nothing). Payload + * (de)serialization points are protocol-agnostic TODO stubs via {@link ProtocolTraits}. */ public final class EventStreamRenderer implements ShapeRenderer { @@ -123,7 +119,6 @@ private void renderHandlerHeader(CppWriterDelegator writerDelegator, String opNa writer.write(""); ModelFile.modelNamespace(writer, ctx.namespace(), () -> { - // EventType enum StringBuilder enumBody = new StringBuilder("enum class ") .append(opName).append("EventType { INITIAL_RESPONSE, "); for (MemberShape event : events) { @@ -134,7 +129,6 @@ private void renderHandlerHeader(CppWriterDelegator writerDelegator, String opNa writer.write(""); writer.openBlock("class $1L : public Aws::Utils::Event::EventStreamHandler {", "};", className, () -> { - // Callback typedefs writer.write("typedef std::function $1LInitialResponseCallback;", opName); writer.write("typedef std::function $1LInitialResponseCallbackEx;", opName); for (MemberShape event : events) { @@ -236,7 +230,6 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa writer.write("static const char $1L[] = \"$2LHandler\";", tag, opName); writer.write(""); - // Constructor writer.openBlock("$1L::$1L() : EventStreamHandler() {", "}", className, () -> { writer.openBlock("m_onInitialResponse = [&](const $1LInitialResponse&, const Utils::Event::InitialResponseType eventType) {", "};", opName, () -> { writer.write("AWS_LOGSTREAM_TRACE($1L, \"$2L initial response received from \" << (eventType == Utils::Event::InitialResponseType::ON_EVENT ? \"event\" : \"http headers\"));", tag, opName); @@ -260,7 +253,6 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.write(""); - // OnEvent writer.openBlock("void $1L::OnEvent() {", "}", className, () -> { writer.openBlock("if (!*this) {", "}", () -> { writer.write("AWSError error = EventStreamErrorsMapper::GetAwsErrorForEventStreamError(GetInternalError());"); @@ -290,7 +282,6 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.write(""); - // HandleEventInMessage writer.openBlock("void $1L::HandleEventInMessage() {", "}", className, () -> { writer.write("const auto& headers = GetEventHeaders();"); writer.write("auto eventTypeHeaderIter = headers.find(EVENT_TYPE_HEADER);"); @@ -323,7 +314,6 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.write(""); - // HandleErrorInMessage writer.openBlock("void $1L::HandleErrorInMessage() {", "}", className, () -> { writer.write("const auto& headers = GetEventHeaders();"); writer.write("Aws::String errorCode;"); @@ -372,7 +362,6 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.write(""); - // EventMapper writer.writeNamespaceOpen(opName + "EventMapper"); writer.write("static const int INITIAL_RESPONSE_HASH = Aws::Utils::HashingUtils::HashString(\"initial-response\");"); for (MemberShape event : events) { @@ -413,9 +402,8 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa // ---- Initial response --------------------------------------------------- /** - * Builds a synthetic {@code InitialResponse} structure from the result's non-event-stream - * members, mirroring C2J's {@code addEventStreamInitialResponse} (CppClientGenerator). The - * {@code @streaming} union member (the event stream) is excluded. + * Builds a synthetic {@code InitialResponse} from the result's non-event-stream members + * (the {@code @streaming} union member excluded), mirroring C2J {@code addEventStreamInitialResponse}. */ private StructureShape initialResponseShape(String opName, StructureShape resultShape) { StructureShape.Builder builder = StructureShape.builder() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/IncludeSets.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/IncludeSets.java index 4b9e8f41032..94b46af1789 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/IncludeSets.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/IncludeSets.java @@ -15,9 +15,8 @@ * Universal (non-serde, non-member) {@code #include} paths for each generated file kind. * Paths are returned without angle brackets; callers add {@code #include <...>}. * - *

These are the boilerplate includes that were previously hand-written as string literals - * in each renderer. Serde includes come from {@code ProtocolTraits.serdeIncludes}; member - * includes come from {@code CppTypeMapper.getIncludesForShape}. + *

Serde includes come from {@code ProtocolTraits.serdeIncludes}; member includes come + * from {@code CppTypeMapper.getIncludesForShape}. */ final class IncludeSets { @@ -65,9 +64,7 @@ static List streamingResultSourceBase(String smithyServiceName, String c static List requestSourceBase(String smithyServiceName, String className) { List inc = new ArrayList<>(); inc.add("aws/" + smithyServiceName + "/model/" + className + ".h"); - // NOTE: is NOT added here. Query/EC2 request sources must not include it, - // and the non-Query protocols' serdeIncludes(REQUEST_SOURCE) already carry . - // Adding it here would force it onto Query. + // NOT added: Query/EC2 must omit it, and non-Query serdeIncludes(REQUEST_SOURCE) already carry it. return inc; } @@ -79,11 +76,9 @@ static List subObjectSourceBase(String smithyServiceName, String classNa } /** - * Assembles and emits a source file's {@code #include} block: the per-site {@code base} - * (self-header, {@code AmazonWebServiceResult.h}, etc.) plus the protocol's source-include - * union for {@code kind}. The two lists are concatenated then emitted via {@link #emit}, - * which dedups, sorts (CaseSensitive) and brackets. Usings are emitted separately by the - * caller via {@link #emitUsings} — this method never touches usings. + * Emits a source file's {@code #include} block: {@code base} plus the protocol's source + * includes for {@code kind}, via {@link #emit} (dedup/sort/bracket). Usings are the caller's + * job ({@link #emitUsings}); this method never touches them. */ static void emitSourceIncludes(CppWriter writer, List base, ProtocolTraits traits, FileKind kind) { @@ -102,9 +97,9 @@ static void emit(com.amazonaws.util.awsclientsmithygenerator.generators.CppWrite } /** - * Emits {@code #include } for each path, normalizing brackets so a caller may - * pass either {@code } or {@code aws/x/X.h}. Deduped and sorted CaseSensitive, - * matching {@link #emit}. This is the single place bracket policy for header includes lives. + * Emits {@code #include } per path, normalizing brackets so callers may pass + * {@code } or {@code aws/x/X.h}. Deduped/sorted like {@link #emit}; the single + * place header bracket policy lives. */ static void emitAngleIncludes(com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter writer, java.util.Collection includePaths) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ModelFile.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ModelFile.java index 8e21fe78903..a8f0d67989d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ModelFile.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ModelFile.java @@ -7,10 +7,9 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.CppWriter; /** - * Emits the {@code Aws::::Model} nesting shared by every generated model - * file. Callers supply the class body; the triple open/close is owned here so it can - * never drift out of sync. Files that must interleave forward declarations between - * {@code Aws} and {@code } use {@link CppWriter#withNamespace} directly. + * Emits the {@code Aws::::Model} nesting shared by every generated model file. Callers + * supply the class body; the triple open/close is owned here so it can't drift. Files interleaving + * forward declarations between {@code Aws} and {@code } use {@link CppWriter#withNamespace}. */ final class ModelFile { @@ -23,10 +22,9 @@ static void modelNamespace(CppWriter writer, String namespace, Runnable body) { } /** - * Like {@link #modelNamespace(CppWriter, String, Runnable)} but emits {@code awsProlog} - * directly inside {@code Aws} — before opening {@code namespace} — for headers that must - * place forward declarations (e.g. {@code AmazonWebServiceResult}, serde value types) at - * {@code Aws} scope. The body still renders inside {@code Aws::::Model}. + * Like {@link #modelNamespace(CppWriter, String, Runnable)} but emits {@code awsProlog} at + * {@code Aws} scope (before {@code namespace}) for headers needing forward declarations there + * (e.g. {@code AmazonWebServiceResult}). The body still renders in {@code Aws::::Model}. */ static void modelNamespace(CppWriter writer, String namespace, Runnable awsProlog, Runnable body) { writer.withNamespace("Aws", () -> { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/OutgoingEventStreamRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/OutgoingEventStreamRenderer.java index df03be05ff9..d7e7679c2b2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/OutgoingEventStreamRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/OutgoingEventStreamRenderer.java @@ -23,14 +23,11 @@ import java.util.Map; /** - * Renders outgoing (request-side / bidirectional) event streams: a {@code @streaming} union - * bound to an operation input. C2J emits these header-only as an - * {@code Aws::Utils::Event::EventEncoderStream} subclass with one {@code Write(...)} - * method per union member (EventStreamHeader.vm), rather than as a tagged-union data type. - * - *

Only the structure/list payload serialization is protocol-specific; that arm is delegated - * to {@link ProtocolTraits#writeStructureEventPayload}. Blob and string payloads write the same - * way for every protocol. + * Renders outgoing (request-side / bidirectional) event streams: a {@code @streaming} union bound + * to an operation input. C2J emits these header-only (EventStreamHeader.vm) as an + * {@code EventEncoderStream} subclass with one {@code Write(...)} per union member, not a + * tagged-union data type. Only structure/list payloads are protocol-specific (delegated to + * {@link ProtocolTraits#writeStructureEventPayload}); blob/string payloads write uniformly. */ public final class OutgoingEventStreamRenderer implements ShapeRenderer { @@ -132,10 +129,9 @@ private void writeEventHeaders(CppWriter writer, String wireKey) { } /** - * Determines how an event shape's payload is encoded, mirroring C2J's eventPayloadType logic - * (C2jModelToGeneratorModelTransformer). A single blob/string non-header member serializes as - * that member; a member explicitly marked {@code @eventPayload} likewise; otherwise the event - * structure itself is the payload (structure encoding). + * How an event's payload is encoded, mirroring C2J eventPayloadType: a single blob/string + * non-header member (or an explicit {@code @eventPayload} member) serializes as that member; + * otherwise the event structure itself is the payload. */ private PayloadKind payloadKind(StructureShape event) { List> nonHeader = event.getAllMembers().entrySet().stream() @@ -150,8 +146,7 @@ private PayloadKind payloadKind(StructureShape event) { if (target.isStringShape()) { return PayloadKind.STRING; } - // A blob member is written as a raw blob only when explicitly @eventPayload; an - // implicit single blob member makes the parent structure the payload (matches C2J). + // Implicit single blob member => parent is the payload (C2J); raw blob only when explicitly @eventPayload if (target.isBlobShape() && member.hasTrait(EventPayloadTrait.class)) { return PayloadKind.BLOB; } @@ -160,9 +155,8 @@ private PayloadKind payloadKind(StructureShape event) { } /** - * The single non-header payload member name for the blob/string arms. These arms are only - * reached when {@link #payloadKind} found exactly one such member, so absence is a codegen - * bug rather than a modeled state — fail fast. + * The single non-header payload member name for the blob/string arms; reached only when + * {@link #payloadKind} found exactly one, so absence is a codegen bug — fail fast. */ private String requirePayloadMember(StructureShape event, PayloadKind kind) { return event.getAllMembers().entrySet().stream() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java index 82cd84eed55..12bcdd43ef1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestHeaderSerializer.java @@ -19,36 +19,29 @@ import java.util.Locale; /** - * Emits the {@code @httpHeader} member-serialization loop body for a request (operation-input) - * structure's {@code GetRequestSpecificHeaders()}, byte-matching the legacy C2J - * {@code ModelClassHeaderMembersSource.vm}. + * Emits the {@code @httpHeader} member-serialization loop body for a request's + * {@code GetRequestSpecificHeaders()}, byte-matching C2J {@code ModelClassHeaderMembersSource.vm}. * - *

Protocol-agnostic: the member serialization is byte-identical across REST-XML, JSON, - * REST-JSON, Query-XML, EC2, and CBOR, so this renderer never branches on protocol. The - * caller ({@code ProtocolTraits.writeGetRequestSpecificHeadersImpl}) owns the surrounding - * {@code Aws::Http::HeaderValueCollection headers;} / {@code Aws::StringStream ss;} declarations, - * the protocol prologue (e.g. {@code X-Amz-Target}), and {@code return headers;}. + *

Protocol-agnostic (byte-identical across REST-XML, JSON, REST-JSON, Query-XML, EC2, CBOR). + * The caller owns the surrounding {@code headers}/{@code ss} declarations, protocol prologue, and + * {@code return headers;}. Every member is {@code HasBeenSet}-gated; enums also guard {@code ::NOT_SET}. * - *

Every member is {@code HasBeenSet}-gated (C2J clears {@code required} on all members), and - * enum members additionally guard against {@code ::NOT_SET}. - * - *

Scope: {@code @httpHeader} members (string / {@code x-amz-copy-source} / enum / boolean / - * blob / timestamp scalars, plus lists joined via {@code std::accumulate}) and - * {@code @httpPrefixHeaders} maps (looped, with sparse-value {@code has_value()} unwrapping). + *

Scope: {@code @httpHeader} scalars (string / {@code x-amz-copy-source} / enum / boolean / blob / + * timestamp) and lists (joined via {@code std::accumulate}), plus {@code @httpPrefixHeaders} maps + * (looped, sparse values unwrapped via {@code has_value()}). */ public final class RequestHeaderSerializer { private RequestHeaderSerializer() {} /** - * Emits the header-member serialization for every header-bound member of {@code shape}, in - * model order: {@code @httpHeader} scalars/lists, and {@code @httpPrefixHeaders} maps. Members - * carrying neither trait are skipped. + * Emits header serialization for every header-bound member of {@code shape} in model order: + * {@code @httpHeader} scalars/lists and {@code @httpPrefixHeaders} maps; others skipped. */ public static void render(CppWriter writer, StructureShape shape, Model model) { for (MemberShape member : shape.getAllMembers().values()) { - // C2J lowercases HTTP header location names (and @httpPrefixHeaders prefixes); query - // names stay case-sensitive. Locale.ROOT avoids locale-dependent casing surprises. + // C2J lowercases header location names (and @httpPrefixHeaders prefixes); Locale.ROOT + // avoids locale-dependent casing. member.getTrait(HttpHeaderTrait.class).ifPresent(trait -> renderHeaderMember(writer, member, trait.getValue().toLowerCase(Locale.ROOT), model)); member.getTrait(HttpPrefixHeadersTrait.class).ifPresent(trait -> @@ -80,9 +73,8 @@ private static void renderHeaderMember(CppWriter writer, MemberShape member, Str renderScalarBody(writer, field, location, target, model)); } - // @httpPrefixHeaders map: each entry becomes a header whose name is the trait prefix - // concatenated with the entry key. A @sparse map's value is Aws::Crt::Optional, so the emplace - // is guarded on has_value() and unwrapped via value(). + // @httpPrefixHeaders map: each entry becomes a header named prefix+key. A @sparse value is + // Aws::Crt::Optional, so the emplace is guarded on has_value() and unwrapped via value(). private static void renderPrefixHeadersMap(CppWriter writer, MemberShape member, String prefix, Model model) { Shape target = model.expectShape(member.getTarget()); @@ -113,11 +105,10 @@ private static void renderListBody(CppWriter writer, String field, String locati writer.write(" }));"); } - // Shared per-type header value expression, keyed on the target shape: enum → Mapper lookup, - // timestamp → the header timestamp mapping (epoch-seconds→Seconds(), date-time→ISO_8601, - // else→RFC822), primitive → to_string, any other (string) value used directly. The value - // expression (the field for a scalar member, the loop var for a list element) is the parameter, - // so the scalar and list paths share one copy of the enum-Mapper and timestamp-format mappings. + // Shared per-type header value expression, keyed on target shape: enum → Mapper lookup, + // timestamp → header mapping (epoch-seconds→Seconds(), date-time→ISO_8601, else→RFC822), + // primitive → to_string, else (string) used directly. The value expr (scalar field or list + // loop var) is the parameter, so scalar and list paths share this mapping. private static String headerValueExpression(Shape shape, String valueExpr, Model model) { if (CppTypeMapper.isEnum(shape)) { String enumType = CppTypeMapper.getCppType(shape, model, false); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java index ce686fa91be..9ff723772d9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestQuerySerializer.java @@ -17,39 +17,32 @@ import software.amazon.smithy.model.traits.TimestampFormatTrait; /** - * Emits the {@code @httpQuery} member-serialization loop body for a request (operation-input) - * structure's {@code AddQueryStringParameters(Aws::Http::URI&)}, byte-matching the legacy C2J + * Emits the {@code @httpQuery} member-serialization loop body for a request's + * {@code AddQueryStringParameters(Aws::Http::URI&)}, byte-matching C2J * {@code AddQueryStringParametersToRequest.vm}. * - *

Protocol-agnostic: the query member serialization is byte-identical across REST-XML, - * Query-XML, EC2, JSON, and CBOR, so this renderer never branches on protocol. The caller - * ({@code ProtocolTraits.writeAddQueryStringParametersImpl}) owns the surrounding - * {@code Aws::StringStream ss;} declaration and the method scaffold; {@code uri} is the - * {@code Aws::Http::URI&} method parameter. + *

Protocol-agnostic (byte-identical across REST-XML, Query-XML, EC2, JSON, CBOR). The caller owns + * the surrounding {@code ss} declaration and method scaffold; {@code uri} is the method parameter. + * Every member is {@code HasBeenSet}-gated; unlike headers, query enums are NOT guarded against + * {@code ::NOT_SET} (C2J's query template gates on {@code HasBeenSet} only). * - *

Every member is {@code HasBeenSet}-gated (C2J clears {@code required} on all members). Unlike - * headers, query enum members are NOT additionally guarded against {@code ::NOT_SET} — C2J's query - * template ({@code AddQueryStringParameter.vm}) gates on {@code HasBeenSet} only. + *

Scope: scalar / string / enum / timestamp {@code @httpQuery} members, {@code @httpQuery} lists + * (one query parameter per element under the fixed location), and {@code @httpQueryParams} maps + * (each entry keyed by its own key — scalar value, enum key via {@code Mapper}, or list value via an + * inner loop). Every query case routes through the shared {@code ss}. Query timestamps default to + * {@code date-time} (ISO_8601), unlike the header default (RFC822). * - *

Scope: scalar / string / enum / timestamp {@code @httpQuery} members, {@code @httpQuery} - * lists (looped, one query parameter per element under the fixed location), and - * {@code @httpQueryParams} maps (looped, each entry keyed by the map's own key — scalar value, - * enum key via {@code Mapper}, or list value via an inner loop). Unlike headers, every query - * case routes its value through the shared {@code ss} stringstream. The query timestamp default - * is {@code date-time} (ISO_8601), differing from the header default (RFC822). - * - *

The S3 {@code customizedAccessLogTag} member (stamped with {@link CustomizedAccessLogTagTrait} - * by {@code S3Transforms}) is a special case: C2J models it with a {@code customizedQuery} flag, so - * it is skipped in the normal {@code @httpQueryParams} loop and instead emits an {@code x-}-prefix - * filter block once after the loop, byte-matching {@code AddQueryStringParametersToRequest.vm}. + *

The S3 {@code customizedAccessLogTag} member ({@link CustomizedAccessLogTagTrait}, C2J's + * {@code customizedQuery} flag) is special: skipped in the normal {@code @httpQueryParams} loop, it + * instead emits an {@code x-}-prefix filter block once after the loop. */ public final class RequestQuerySerializer { private RequestQuerySerializer() {} /** - * Emits the query-member serialization for every {@code @httpQuery} scalar/string/enum/timestamp - * member of {@code shape}, in model order. Members carrying no {@code @httpQuery} trait are skipped. + * Emits query serialization for every {@code @httpQuery} member of {@code shape} in model order; + * members without the trait are skipped. */ public static void render(CppWriter writer, StructureShape shape, Model model) { for (MemberShape member : shape.getAllMembers().values()) { @@ -57,8 +50,8 @@ public static void render(CppWriter writer, StructureShape shape, Model model) { renderQueryMember(writer, member, trait.getValue(), model)); member.getTrait(HttpQueryParamsTrait.class).ifPresent(trait -> { // The S3 customizedAccessLogTag member carries @httpQueryParams (to keep the request - // emitting AddQueryStringParameters) but is not serialized as a normal map — it emits - // the x- filter block after this loop instead. + // emitting AddQueryStringParameters) but emits the x- filter block after this loop + // instead of serializing as a normal map. if (!member.hasTrait(CustomizedAccessLogTagTrait.class)) { renderQueryParamsMap(writer, member, model); } @@ -125,9 +118,9 @@ private static void emitStreamed(CppWriter writer, String location, String strea writer.write("ss.str(\"\");"); } - // @httpQueryParams map: each entry becomes a query parameter keyed by the map's own key - // (there is no fixed location). A scalar value streams directly; a list value fans out to one - // query parameter per element via an inner loop; an enum key is mapped through its Mapper. + // @httpQueryParams map: each entry becomes a query parameter keyed by its own key (no fixed + // location). Scalar value streams directly; list value fans out one parameter per element; enum + // key is mapped through its Mapper. private static void renderQueryParamsMap(CppWriter writer, MemberShape member, Model model) { Shape target = model.expectShape(member.getTarget()); String field = CppNames.fieldName(member.getMemberName()); @@ -152,9 +145,8 @@ private static void renderQueryParamsMap(CppWriter writer, MemberShape member, M })); } - // Query parameter key for an @httpQueryParams entry: an enum key routes through its Mapper, - // any other (string) key uses the raw entry key. Both terminate in .c_str() since - // AddQueryStringParameter takes a const char* key. + // Query parameter key for an @httpQueryParams entry: enum key via its Mapper, else the raw entry + // key. Both end in .c_str() since AddQueryStringParameter takes a const char* key. private static String queryParamKeyExpression(Shape key, Model model) { if (CppTypeMapper.isEnum(key)) { String enumType = CppTypeMapper.getCppType(key, model, false); @@ -163,10 +155,9 @@ private static String queryParamKeyExpression(Shape key, Model model) { return "item.first.c_str()"; } - // Shared stream expression for a scalar member, list element, or map value: enum → Mapper - // lookup, timestamp → the query timestamp mapping (date-time→ISO_8601, http-date→RFC822, - // epoch-seconds→SecondsWithMSPrecision()), any other value streamed directly. The non-enum - // scalar path reuses this too (enum scalars are handled inline before reaching here). + // Shared stream expression for a scalar member, list element, or map value: enum → Mapper lookup, + // timestamp → query mapping (date-time→ISO_8601, http-date→RFC822, epoch-seconds→ + // SecondsWithMSPrecision()), else streamed directly. (Enum scalars are handled inline earlier.) private static String elementStreamExpression(String var, Shape target, Model model) { if (CppTypeMapper.isEnum(target)) { String enumType = CppTypeMapper.getCppType(target, model, false); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index f6c96708703..37ef5369a2b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -70,15 +70,14 @@ public void render(CppWriterDelegator writerDelegator) { private void renderHeader(CppWriterDelegator writerDelegator, StructureShape rawShape, OperationShape operation) { String className = operation.getId().getName() + "Request"; - // A request with a raw streaming @httpPayload member derives from StreamingRequest, - // whose base (AmazonStreamingWebServiceRequest) supplies GetBody/SetBody and - // GetContentType/SetContentType, and emits no SerializePayload. Matching C2J: contentType - // is stripped from the model entirely (affects includes AND rendering), while the payload - // member stays for include computation but is skipped in accessor/private rendering. + // A raw streaming @httpPayload request derives from StreamingRequest, whose base + // (AmazonStreamingWebServiceRequest) supplies GetBody/SetBody, GetContentType/SetContentType, + // and no SerializePayload. Matching C2J: contentType is stripped entirely (includes and + // rendering); the payload member stays for includes but is skipped in accessor/private rendering. boolean rawStreamingPayload = ShapeClassifier.isRawStreamingPayloadRequest(operation, ctx.model()); - // An event-stream (input) member targets a @streaming union: C2J renders it as a - // std::shared_ptr with a collision-renamed getter and an inline empty - // SerializePayload + GetBody() override, so it is excluded from the generic member path. + // An event-stream (input) member targets a @streaming union: rendered as a + // std::shared_ptr (collision-renamed getter, inline empty SerializePayload + + // GetBody() override), so excluded from the generic member path. Matches C2J. Optional eventStreamMember = ShapeClassifier.eventStreamMemberName(rawShape, ctx.model()); StructureShape includeShape = rawStreamingPayload ? shapeExcluding(rawShape, Set.of("contentType", "ContentType")) : rawShape; @@ -90,10 +89,9 @@ private void renderHeader(CppWriterDelegator writerDelegator, Set includes = new TreeSet<>(); includes.add(""); includes.add(""); - // NOTE: request headers do NOT include even when they - // declare URI-taking methods (DumpBodyToUrl / AddQueryStringParameters). The - // base AmazonWebServiceRequest.h forward-declares Aws::Http::URI, which is - // sufficient for a reference parameter, and C2J relies on that forward decl. + // Request headers do NOT include even with URI-taking methods + // (DumpBodyToUrl / AddQueryStringParameters): AmazonWebServiceRequest.h forward-declares + // Aws::Http::URI, sufficient for a reference param. Matches C2J. List memberIncludes = CppTypeMapper.getIncludesForShape(includeShape, ctx.model(), ctx.smithyServiceName()); includes.addAll(memberIncludes); IncludeSets.emitAngleIncludes(writer, includes); @@ -142,9 +140,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, if (streamingRequest) { writer.write("inline virtual bool IsEventStreamRequest() const override { return true; }"); } - // Long-polling requests emit IsLongPollingOperation() -> true with the top identity - // methods (C2J RequestHeader.vm order: after IsEventStreamRequest, before - // HasEventStreamResponse); the marker is stamped by LongPollingTransform. + // Long-polling requests emit IsLongPollingOperation() -> true (C2J order: after + // IsEventStreamRequest, before HasEventStreamResponse); marker stamped by LongPollingTransform. if (shape.hasTrait(LongPollingTrait.class)) { writer.write("inline virtual bool IsLongPollingOperation() const override { return true; }"); } @@ -152,19 +149,18 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.write("inline virtual bool HasEventStreamResponse() const override { return true; }"); } if (eventStreamMember.isPresent()) { - // The request body is sent as an encoded event stream via GetBody(), so - // SerializePayload is an inline no-op (matches C2J RequestHeader.vm). + // Body is sent as an encoded event stream via GetBody(), so SerializePayload is an + // inline no-op. Matches C2J RequestHeader.vm. writer.write("// SerializePayload will not be invoked."); writer.write("// This request is sent by encoding its data in event-streams which is sent as IOStream via GetBody()"); writer.write("$L Aws::String SerializePayload() const override { return {}; }", ctx.exportMacro()); writer.write("$L std::shared_ptr GetBody() const override;", ctx.exportMacro()); } ctx.protocolTraits().writeRequestMethodDecls(writer, ctx.exportMacro(), shape, operation, ctx.model()); - // DumpBodyToUrl is emitted protocol-agnostically (C2J RequestHeader.vm gates it only on - // $shape.supportsPresigning). It is a protected virtual in AmazonWebServiceRequest, so the - // override is bracketed under protected: and the section restored to public: afterwards. - // The trait is stamped on the OPERATION (SupportsPresigningTransform) so Unit-input ops - // are covered and the decl stays symmetric with the protocol-emitted impl. + // DumpBodyToUrl is emitted protocol-agnostically (C2J gates only on + // $shape.supportsPresigning). A protected virtual, so bracketed under protected: then + // restored to public:. The trait is on the OPERATION (SupportsPresigningTransform) to + // cover Unit-input ops and stay symmetric with the protocol-emitted impl. if (operation.hasTrait(SupportsPresigningTrait.class)) { writer.write(""); writer.dedent(); @@ -182,9 +178,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, renderContentMd5Decl(writer, operation); renderSignBodyDecl(writer, shape, operation); - // Chunked-encoding requests emit IsChunked() -> true right after SignBody and before - // IsStreaming (C2J RequestHeader.vm order); the marker is stamped by - // ChunkedEncodingTransform. + // Chunked-encoding requests emit IsChunked() -> true after SignBody, before IsStreaming + // (C2J order); marker stamped by ChunkedEncodingTransform. if (shape.hasTrait(ChunkedEncodingTrait.class)) { writer.write("$L bool IsChunked() const override { return true; }", ctx.exportMacro()); } @@ -278,18 +273,16 @@ private void renderSource(CppWriterDelegator writerDelegator, String className = operation.getId().getName() + "Request"; Optional eventStreamMember = ShapeClassifier.eventStreamMemberName(rawShape, ctx.model()); // Render request-method impls from the same member-stripped shape as the header (see - // renderedShape): the declaration and definition gate GetRequestSpecificHeaders / - // AddQueryStringParameters on this shape, so they must agree or the source emits an - // out-of-line definition of a method the class never declares. + // renderedShape): decl and def gate GetRequestSpecificHeaders / AddQueryStringParameters on + // this shape, so they must agree or the source defines a method the class never declares. StructureShape shape = renderedShape(rawShape, operation); String fileName = "source/model/" + className + ".cpp"; writerDelegator.useFileWriter(fileName, writer -> { - // A request with stream members (a raw @httpPayload blob/string body, or an event-stream - // input) is sent via the request body stream, not a serialized JSON payload. C2J routes - // it through StreamRequestSource.vm: AmazonWebServiceResult.h + the Stream/Utils/Aws - // usings (not the JSON serde header/usings). The event-stream sub-case also defines - // GetBody() returning its encoder member. + // A request with stream members (raw @httpPayload body or event-stream input) is sent via + // the body stream, not a serialized payload. C2J routes it through StreamRequestSource.vm: + // AmazonWebServiceResult.h + Stream/Utils/Aws usings (not the JSON serde header/usings). + // The event-stream sub-case also defines GetBody() returning its encoder member. boolean streaming = ShapeClassifier.isRawStreamingPayloadRequest(operation, ctx.model()) || eventStreamMember.isPresent(); if (streaming) { @@ -297,10 +290,10 @@ private void renderSource(CppWriterDelegator writerDelegator, IncludeSets.requestSourceBase(ctx.smithyServiceName(), className)); includes.add("aws/core/AmazonWebServiceResult.h"); includes.add("utility"); - // A raw-streaming-payload request sends its body via the streaming base class (no - // protocol serde), but its header/query members still serialize, so the source - // needs HashingUtils.h (blob Base64) and AWSStringStream.h unconditionally. It must - // NOT pull the protocol serde header (e.g. JsonSerializer.h), matching C2J. + // A raw-streaming-payload request sends its body via the streaming base (no protocol + // serde), but header/query members still serialize, so the source needs HashingUtils.h + // (blob Base64) and AWSStringStream.h unconditionally, and must NOT pull the protocol + // serde header (e.g. JsonSerializer.h). Matches C2J. includes.add("aws/core/utils/HashingUtils.h"); includes.add("aws/core/utils/memory/stl/AWSStringStream.h"); IncludeSets.emit(writer, includes); @@ -356,11 +349,9 @@ private void renderSource(CppWriterDelegator writerDelegator, /** * The shape whose members drive request-method rendering. Raw-streaming-payload requests strip - * {@code contentType} (supplied by the streaming base's GetContentType/SetContentType) and the - * {@code @httpPayload} member (sent via the body stream); an event-stream input member is - * rendered separately, not through the generic member path. Both the header (declarations) and - * the source (definitions) MUST render from this same shape so their emitted method sets stay - * in sync. + * {@code contentType} (from the streaming base) and the {@code @httpPayload} member (sent via + * the body stream); an event-stream input member is rendered separately. Header and source MUST + * render from this same shape so their emitted method sets stay in sync. */ private StructureShape renderedShape(StructureShape rawShape, OperationShape operation) { Set excluded = new HashSet<>(); @@ -399,8 +390,8 @@ private String eventStreamUnionType(StructureShape shape, String memberName) { /** * Renders the accessor block for an event-stream (input) member: a {@code std::shared_ptr} - * getter/setter/wither. The getter is renamed to {@code GetMember} because {@code GetBody} - * is reserved by the streaming request base (matches C2J's collision handling). + * getter/setter/wither. The getter is renamed to {@code GetMember} since {@code GetBody} is + * reserved by the streaming request base (C2J collision handling). */ private void renderEventStreamMemberAccessor(CppWriter writer, String className, StructureShape shape, String memberName) { @@ -429,15 +420,14 @@ private void renderEventStreamMemberAccessor(CppWriter writer, String className, } /** - * Declares the request methods for an operation carrying {@code @httpChecksum}, gated per - * sub-field, matching C2J's RequestHeader.vm:89-104: + * Declares the {@code @httpChecksum} request methods, gated per sub-field (C2J RequestHeader.vm): *

    *
  • {@code requestAlgorithmMember} → {@code GetChecksumAlgorithmName} / {@code ChecksumAlgorithmIsSet}
  • *
  • {@code requestValidationModeMember} → {@code ShouldValidateResponseChecksum}
  • *
  • {@code requestChecksumRequired} → inline {@code RequestChecksumRequired}
  • *
  • {@code responseAlgorithms} → {@code GetResponseChecksumAlgorithmNames}
  • *
- * All override base {@code AmazonWebServiceRequest} virtuals; no extra includes are needed. + * All override base {@code AmazonWebServiceRequest} virtuals; no extra includes. */ private void renderChecksumDecls(CppWriter writer, StructureShape shape, OperationShape operation) { Optional maybeTrait = operation.getTrait(HttpChecksumTrait.class); @@ -461,10 +451,10 @@ private void renderChecksumDecls(CppWriter writer, StructureShape shape, Operati } /** - * Defines the {@code @httpChecksum} request methods, matching C2J's ModelClassChecksumMembers.vm. + * Defines the {@code @httpChecksum} request methods (C2J ModelClassChecksumMembers.vm). * {@code GetChecksumAlgorithmName} defaults to {@code "crc64nvme"} when the algorithm member is - * unset, else maps the enum via its generated Mapper. The bodies read only the request's own - * enum members, so they are independent of the (stubbed) payload serde. + * unset, else maps the enum via its Mapper. Bodies read only the request's enum members, so they + * are independent of the (stubbed) payload serde. */ private void renderChecksumImpls(CppWriter writer, String className, StructureShape shape, OperationShape operation) { @@ -508,11 +498,10 @@ private void renderChecksumImpls(CppWriter writer, String className, StructureSh } /** - * Declares the inline {@code ShouldComputeContentMd5} override for an operation carrying the - * legacy {@code @httpChecksumRequired} trait ({@code smithy.api#httpChecksumRequired}), which - * requests a {@code Content-MD5} header. Distinct from the flexible {@code @httpChecksum} trait. - * C2J derives an internal {@code Shape.computeContentMd5} flag from it; here it reads the trait - * directly. Matches RequestHeader.vm:105-108 (no {@code .cpp} body). + * Declares the inline {@code ShouldComputeContentMd5} override for the legacy + * {@code @httpChecksumRequired} trait (requests a {@code Content-MD5} header; distinct from the + * flexible {@code @httpChecksum}). Read directly here rather than via C2J's derived + * {@code computeContentMd5} flag. Matches RequestHeader.vm (no {@code .cpp} body). */ private void renderContentMd5Decl(CppWriter writer, OperationShape operation) { if (operation.hasTrait(HttpChecksumRequiredTrait.class)) { @@ -522,12 +511,10 @@ private void renderContentMd5Decl(CppWriter writer, OperationShape operation) { } /** - * Declares the inline {@code SignBody} override for an operation carrying - * {@code aws.auth#unsignedPayload} whose request has at least one member. C2J's - * RequestHeader.vm emits this for a {@code v4-unsigned-body} request - * ({@code #if(!$shape.signBody && $shape.members.size() > 0)}); the Smithy equivalent is the - * {@code @unsignedPayload} operation trait. This closes {@code Model::}-namespace parity only: - * the Smithy runtime does not consume {@code SignBody()} (it hardcodes signing). + * Declares the inline {@code SignBody} override for an {@code @unsignedPayload} operation whose + * request has at least one member (C2J's {@code v4-unsigned-body} case). Closes + * {@code Model::}-namespace parity only: the Smithy runtime hardcodes signing and never consumes + * {@code SignBody()}. */ private void renderSignBodyDecl(CppWriter writer, StructureShape shape, OperationShape operation) { if (operation.hasTrait(UnsignedPayloadTrait.class) && !shape.getAllMembers().isEmpty()) { @@ -546,11 +533,9 @@ private String checksumMemberEnumType(StructureShape shape, OperationShape opera } /** - * Declares {@code GetSelectedCompressionAlgorithm} for an operation carrying - * {@code @requestCompression}. The method overrides a base {@code AmazonWebServiceRequest} - * virtual, so no extra include is needed. Only gzip is supported (validated), so the - * declaration is always guarded by {@code ENABLED_ZLIB_REQUEST_COMPRESSION}. Matches C2J's - * {@code RequestHeader.vm}. + * Declares {@code GetSelectedCompressionAlgorithm} for a {@code @requestCompression} operation. + * Overrides a base virtual (no extra include). Only gzip is supported (validated), so the decl + * is guarded by {@code ENABLED_ZLIB_REQUEST_COMPRESSION}. Matches C2J {@code RequestHeader.vm}. */ private void renderRequestCompressionDecl(CppWriter writer, OperationShape operation) { if (!operation.hasTrait(RequestCompressionTrait.class)) { @@ -564,11 +549,10 @@ private void renderRequestCompressionDecl(CppWriter writer, OperationShape opera } /** - * Defines {@code GetSelectedCompressionAlgorithm}. Streaming requests can't size their body up - * front, so they compress whenever enabled; non-streaming requests skip compression below the - * configured minimum body size. Matches C2J's ModelClassRequiredCompression[Stream].vm. This - * body only reads the already-serialized body via the base {@code GetBody()}, so it is - * independent of the (currently stubbed) payload serde. + * Defines {@code GetSelectedCompressionAlgorithm}: streaming requests can't size their body up + * front so they compress whenever enabled; non-streaming requests skip below the configured + * minimum body size. Matches C2J ModelClassRequiredCompression[Stream].vm. Reads only the + * already-serialized body via the base {@code GetBody()}, so it is independent of payload serde. */ private void renderRequestCompressionImpl(CppWriter writer, String className, OperationShape operation, boolean streaming) { @@ -599,9 +583,8 @@ private void renderRequestCompressionImpl(CppWriter writer, String className, } /** - * Enforces the C2J contract that {@code @requestCompression} declares exactly the gzip encoding - * (the only algorithm the SDK supports). Fails fast on an empty or unsupported encoding list, - * mirroring the legacy C2J transformer. + * Enforces the C2J contract that {@code @requestCompression} declares exactly gzip (the only + * algorithm the SDK supports). Fails fast on an empty or unsupported encoding list. */ private static void validateGzipEncoding(OperationShape operation) { List encodings = operation.expectTrait(RequestCompressionTrait.class).getEncodings(); @@ -689,9 +672,8 @@ private void renderOperationContextParamsAccessor(CppWriter writer, String class writer.openBlock("Aws::Vector $L::GetOperationContextParams() const {", "}", className, () -> { writer.write("Aws::Vector result;"); - // Visitor output is a single newline-separated string of flat (un-indented) statements; - // CppWriter applies the block indentation and clang-format normalizes the rest. Each line - // is passed as a $L argument so any $L or {n} tokens in the output are not reinterpreted. + // Visitor output is a newline-separated string of flat statements; CppWriter indents and + // clang-format normalizes. Each line is passed as a $L arg so $L/{n} tokens aren't reinterpreted. String raw = emit.statements(); if (!raw.isEmpty()) { // Trim the single trailing newline the visitor always emits so we don't double-blank. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java index af8b44a3006..930582bcb95 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/ResultRenderer.java @@ -50,9 +50,7 @@ public void render(CppWriterDelegator writerDelegator) { } /** - * The name of the {@code @httpPayload} streaming member. Only called for results the - * classifier already flagged as streaming, so a missing payload member is a codegen bug - * rather than a modeled state — fail fast instead of returning null. + * Name of the {@code @httpPayload} streaming member; a missing member is a codegen bug, so fail fast. */ private String streamingPayloadMemberName(StructureShape shape) { for (Map.Entry entry : shape.getAllMembers().entrySet()) { @@ -71,15 +69,13 @@ private void renderHeader(CppWriterDelegator writerDelegator, writerDelegator.useFileWriter(fileName, writer -> { writer.write("#pragma once"); - // AWSString.h is only needed for the top-level m_requestId; string-typed members - // bring their own include via getIncludesForShape. Matches C2J include hygiene. + // AWSString.h only for top-level m_requestId; string members self-include. Matches C2J. List includes = new java.util.ArrayList<>(IncludeSets.resultHeaderBase( ctx.smithyServiceName(), ctx.namespace(), ctx.protocolTraits().resultHasTopLevelRequestId())); for (String memberInc : CppTypeMapper.getIncludesForShape(shape, ctx.model(), ctx.smithyServiceName())) { includes.add(memberInc); } - // Protocols whose result-header serde types are named in the class signature (CBOR: - // CborValue) add their own header here; JSON/XML forward-declare and add nothing. + // Protocols naming serde types in the class signature (CBOR: CborValue) add their header; JSON/XML forward-declare. includes.addAll(ctx.protocolTraits().serdeIncludes(FileKind.RESULT_HEADER)); IncludeSets.emitAngleIncludes(writer, includes); @@ -115,8 +111,7 @@ private void renderHeader(CppWriterDelegator writerDelegator, MemberRenderer.renderRequestIdAccessors(writer, className); } - // The top-level HostId (x-amz-id-2) group is per-service (S3 Control only), driven - // by the internal marker rather than a protocol flag, and always follows RequestId. + // Top-level HostId (x-amz-id-2), S3 Control only, driven by the internal marker (not a protocol flag); always follows RequestId. boolean topLevelHostId = shape.hasTrait(TopLevelHostIdTrait.class); if (topLevelHostId) { MemberRenderer.renderHostIdAccessors(writer, className); @@ -130,8 +125,7 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.indent(); members.renderDataMembers(writer); if (topLevelRequestId) { - // The blank line separates the modeled members from the m_requestId group; - // C2J omits it (and m_requestId) for Query/EC2 results. + // Blank line separates modeled members from the m_requestId group; C2J omits both for Query/EC2. writer.write(""); writer.write("Aws::String m_requestId;"); } @@ -175,9 +169,8 @@ private void renderSource(CppWriterDelegator writerDelegator, } /** - * Renders a streaming result header: a move-only class whose payload is an - * {@code Aws::Utils::Stream::ResponseStream} exposed via {@code GetBody()} / - * {@code ReplaceBody}, matching the legacy C2J {@code StreamResultHeader.vm} output. + * Renders a streaming result header: a move-only class whose ResponseStream payload is exposed + * via {@code GetBody()} / {@code ReplaceBody}. Matches C2J {@code StreamResultHeader.vm}. */ private void renderStreamingHeader(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { @@ -226,9 +219,8 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, ctx.exportMacro(), className); writer.write(""); - // Streaming payload accessors (no Set/With/HasBeenSet for the stream member). - // The getter is named after the member (GetBody, GetAudioStream, GetResponse); - // ReplaceBody stays literal, matching C2J StreamResultHeader.vm. + // Streaming payload accessors (no Set/With/HasBeenSet). Getter named after the member; + // ReplaceBody stays literal. Matches C2J StreamResultHeader.vm. String streamField = CppNames.fieldName(streamMember); writer.write("///@{"); shape.getMember(streamMember) @@ -248,8 +240,7 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, MemberRenderer.renderRequestIdAccessors(writer, className); - // S3 Control has no streaming results today; the marker is only stamped on its - // outputs, so this block is a defensive no-op for every current streaming result. + // Defensive no-op: no streaming result is S3 Control today, so the marker is never stamped here. boolean topLevelHostId = shape.hasTrait(TopLevelHostIdTrait.class); if (topLevelHostId) { MemberRenderer.renderHostIdAccessors(writer, className); @@ -283,8 +274,8 @@ private void renderStreamingHeader(CppWriterDelegator writerDelegator, } /** - * Renders a streaming result source: the move ctor/assign take ownership of the - * response payload stream ({@code TakeOwnershipOfPayload}) rather than parsing a body. + * Renders a streaming result source: move ctor/assign take ownership of the payload stream + * ({@code TakeOwnershipOfPayload}) instead of parsing a body. */ private void renderStreamingSource(CppWriterDelegator writerDelegator, StructureShape shape, OperationShape operation) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java index 7a6dfdbf970..477a253f680 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java @@ -41,10 +41,9 @@ public SubObjectRenderer(List subObjects, RenderContext ctx) { @Override public void render(CppWriterDelegator writerDelegator) { for (Shape shape : subObjects) { - // C2J models a union as a structure with "union": true and emits it through the same - // ModelClass templates, so structures and (non-streaming) unions render identically. - // @streaming unions are the event-stream shapes rendered by EventStreamRenderer / - // the outgoing-event-stream path; skip them here to avoid a double-write. + // C2J renders a (non-streaming) union like a structure via the same ModelClass + // templates, so they render identically here. @streaming unions are event-stream shapes + // handled elsewhere; skip them to avoid a double-write. boolean isStruct = shape.isStructureShape(); boolean isDataUnion = shape.isUnionShape() && !shape.hasTrait(StreamingTrait.class); if (isStruct || isDataUnion) { @@ -57,20 +56,17 @@ public void render(CppWriterDelegator writerDelegator) { private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { String className = CppTypeMapper.cppShapeName(shape); String fileName = "include/aws/" + ctx.smithyServiceName() + "/model/" + className + ".h"; - // A shape that is BOTH an operation output AND referenced as a member ("dual-role") is - // stamped with the top-level requestId by C2J — but only for JSON-family protocols. Query/EC2 - // instead inject a ResponseMetadata member (GlobalTransforms.injectResponseMetadata), so they - // are gated out here via resultHasTopLevelRequestId(). + // A "dual-role" shape (both an operation output and a referenced member) gets the top-level + // requestId from C2J, but only for JSON-family protocols. Query/EC2 inject ResponseMetadata + // instead, so they are gated out via resultHasTopLevelRequestId(). boolean stampRequestId = resultOutputIds.contains(shape.getId()) && ctx.protocolTraits().resultHasTopLevelRequestId(); writerDelegator.useFileWriter(fileName, writer -> { writer.write("#pragma once"); - // Includes List includes = new java.util.ArrayList<>(); includes.add("aws/" + ctx.smithyServiceName() + "/" + ctx.namespace() + "_EXPORTS.h"); if (stampRequestId) { - // The stamped m_requestId is an Aws::String; mirror the result-header include hygiene. includes.add("aws/core/utils/memory/stl/AWSString.h"); } for (String memberInc : CppTypeMapper.getIncludesForShape(shape, ctx.model(), ctx.smithyServiceName())) { @@ -91,8 +87,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { ModelFile.modelNamespace(writer, ctx.namespace(), () -> ctx.protocolTraits().writeShapeForwardDeclarations(writer), () -> { - // Recursive member targets are forward-declared here (at Model scope) instead of - // included, breaking the reference cycle. Matches C2J's computeForwardDeclarations. + // Recursive member targets are forward-declared at Model scope (not included) to break + // the cycle. Matches C2J computeForwardDeclarations. for (String fwd : CppTypeMapper.getForwardDeclarations(shape, ctx.model())) { writer.write("class $L;", fwd); } @@ -103,10 +99,9 @@ private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { writer.openBlock("class $L {", "};", className, () -> { writer.write("public:"); ctx.protocolTraits().writeSerdeMethodDecls(writer, ctx.exportMacro(), className, null); - // A memberless shape ends right after its serde decls: C2J emits no accessors - // and no private: section (ModelClassMembersAndInlines.vm gates both on - // $shape.members.size() > 0) — unless it is a dual-role output, in which case the - // stamped requestId group still needs a private: section. + // A memberless shape ends right after its serde decls (no accessors, no private:), + // matching C2J — unless it is a dual-role output, whose stamped requestId group + // still needs a private: section. boolean hasMembers = !shape.getAllMembers().isEmpty(); if (hasMembers || stampRequestId) { MemberRenderer members = MemberRenderer.forStructure(ctx.model(), shape, className) @@ -116,9 +111,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { members.renderPublicAccessors(writer); } if (stampRequestId) { - // MODEL-class requestId group (includes the RequestIdHasBeenSet() getter), - // emitted after the modeled-member accessors. The helper writes its own - // leading blank-line separator. + // MODEL-class requestId group (with RequestIdHasBeenSet() getter), after the + // modeled accessors. The helper writes its own leading blank-line separator. MemberRenderer.renderRequestIdAccessors(writer, className, true); } writer.dedent(); @@ -128,8 +122,8 @@ private void renderHeader(CppWriterDelegator writerDelegator, Shape shape) { members.renderDataMembers(writer); } if (stampRequestId) { - // m_requestId trails the modeled data members (blank-line separated, matching - // MemberRenderer's data-member spacing); its flag trails the modeled flags. + // m_requestId trails the modeled data members (blank-line separated like + // MemberRenderer's spacing); its flag trails the modeled flags. if (hasMembers) { writer.write(""); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java index bc141d2142b..8889498c04c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitor.java @@ -22,12 +22,10 @@ import software.amazon.smithy.model.shapes.StructureShape; /** - * Translates the JMESPath expression carried by {@code smithy.rules#operationContextParams} - * into C++ that walks the request struct and pushes leaf values into a {@code result} - * {@code Aws::Vector}. Immutable and value-returning: each visit returns an - * {@link Emit}; parents compose children's results. Produces the same C++ structure as the - * legacy C2J generator (identifiers and statements), modulo whitespace (normalized downstream - * by clang-format). + * Translates the JMESPath expression from {@code smithy.rules#operationContextParams} into C++ that + * walks the request struct and pushes leaf values into a {@code result} {@code Aws::Vector}. + * Immutable and value-returning: each visit returns an {@link Emit}, parents compose children's + * results. Produces the same C++ as legacy C2J (identifiers/statements), modulo whitespace. */ public final class SmithyEndpointsJmesPathVisitor extends UnsupportedExpressionVisitor { @@ -87,9 +85,8 @@ public Emit visitSubexpression(Subexpression expression) { public Emit visitProjection(ProjectionExpression expression) { Emit left = expression.getLeft().accept(this); if (!(left.shape() instanceof ListShape)) { - // No list to iterate at this node (e.g. the trailing flatten-projection of a - // multi-select pattern, whose left subtree already emitted every statement). - // Propagate the left subtree's statements rather than discarding them. + // No list to iterate here (e.g. the trailing flatten-projection of a multi-select, whose + // left subtree already emitted every statement); propagate them rather than discarding. return left; } String alias = left.rootName() + "Elems"; diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java index 94f8150efb7..d29a00c398c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java @@ -19,17 +19,11 @@ import java.util.Optional; /** - * Access Analyzer model parity with the legacy C2J transformer, which resolves the collision - * between the {@code GetGeneratedPolicy} result wrapper and the domain shape - * {@code GeneratedPolicyResult} by renaming the domain shape (and its referencing member) to - * {@code GeneratedPolicyResults}. C2J preserves the wire key ({@code generatedPolicyResult}) via - * {@code locationName}; {@link TransformSupport#renameMember} mirrors that by pinning the original - * wire name through the service's protocol-appropriate trait, so the model stays serde-correct even - * though serde is currently stubbed. - * - *

Self-guards on the raw smithy service name {@code accessanalyzer} (transforms never remap). - * No-op when the domain shape is absent (upstream already clean). Throws if the target name - * {@code GeneratedPolicyResults} is already occupied by a distinct shape — a genuine collision. + * Access Analyzer C2J parity: resolves the collision between the GetGeneratedPolicy result wrapper + * and the domain shape GeneratedPolicyResult by renaming the domain shape (and its referencing + * member) to GeneratedPolicyResults, pinning the original wire key via the protocol-appropriate + * trait so serde stays correct. Self-guards on service name accessanalyzer; no-op when the domain + * shape is absent; throws if GeneratedPolicyResults is already occupied by a distinct shape. */ public final class AccessAnalyzerTransforms { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java index 5abe1607c67..bce200d44b5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AdditionalRequestHeadersTrait.java @@ -15,18 +15,10 @@ import java.util.Map; /** - * Internal marker (never declared in any model file) placed by {@link GlacierTransforms} on each - * request structure that C2J attaches constant request headers to via - * {@code metadata.setAdditionalHeaders(...)}. It carries the ordered header name → value pairs - * (for Glacier, {@code x-amz-glacier-version} → the service API version). - * - *

C2J emits these headers from the {@code Request} base class ({@code GetHeaders}) for - * ordinary requests, but a streaming request derives from {@code AmazonStreamingWebServiceRequest} - * and bypasses that base, so {@code StreamRequestSource.vm} instead emits them inside the request's - * own {@code GetRequestSpecificHeaders}. The base class stays C2J-generated, so only the streaming - * requests carry this marker; request rendering turns it into the matching {@code headers.insert(...)} - * lines. Kept as a data-carrying marker + generic renderer rule so the renderer stays - * service-agnostic. + * Internal marker placed by GlacierTransforms on request structures C2J attaches constant headers to + * via metadata.setAdditionalHeaders(...). Carries the ordered header name-value pairs (for Glacier, + * x-amz-glacier-version -> the API version). Only streaming requests carry it: they bypass the + * C2J-generated base GetHeaders, so request rendering emits the matching headers.insert(...) lines. */ public final class AdditionalRequestHeadersTrait extends AbstractTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#additionalRequestHeaders"); @@ -38,7 +30,6 @@ public AdditionalRequestHeadersTrait(Map headers) { this.headers = Collections.unmodifiableMap(new LinkedHashMap<>(headers)); } - /** Ordered header name → value pairs, emitted verbatim into {@code GetRequestSpecificHeaders}. */ public Map getHeaders() { return headers; } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java index a0bd440e336..d791d924120 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChecksumMemberTrait.java @@ -9,14 +9,9 @@ import software.amazon.smithy.model.traits.StringTrait; /** - * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 request - * member that C2J's {@code S3RestXmlCppClientGenerator} flags via {@code member.setChecksumMember(true)} - * + {@code member.setChecksumEnumMember(...)} — the {@code ChecksumCRC32}/{@code ChecksumSHA256}/etc. - * members of any request that also carries a {@code ChecksumAlgorithm} member. The stored value is the - * matching {@code ChecksumAlgorithm} enum constant (e.g. {@code CRC32}). Member rendering turns the - * marker into the C2J {@code ModelClassMembersAndInlines.vm} behavior: each setter also calls - * {@code SetChecksumAlgorithm(ChecksumAlgorithm::)}, plus a {@code const char*} overload that does - * the same. Kept as a marker + generic renderer rule so the member renderer stays service-agnostic. + * Internal marker on S3 request checksum members (C2J setChecksumMember/setChecksumEnumMember). Stores + * the matching ChecksumAlgorithm enum constant; member rendering makes each setter also call + * SetChecksumAlgorithm(ChecksumAlgorithm::) (plus a const char* overload). */ public final class ChecksumMemberTrait extends StringTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#checksumMember"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java index db7744e5e2b..2f587d666db 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTrait.java @@ -9,15 +9,10 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link ChunkedEncodingTransform} on - * each request structure for which C2J's {@code RequestHeader.vm} emits - * {@code bool IsChunked() const override { return true; }}. C2J gates that override on - * {@code ($metadata.serviceId=="MediaStore Data" || $operation.supportsChunkedEncoding)} together - * with {@code $shape.hasStreamMembers() && !$shape.signBody && $shape.members.size() > 0}; S3 sets - * {@code supportsChunkedEncoding} on {@code WriteGetObjectResponse} only. The transform collapses - * that emit-time condition into a single stamping decision so request rendering only has to turn the - * marker into the override. Kept as a marker + generic renderer rule (not a service-name {@code if}) - * so the renderer stays service-agnostic. + * Internal marker placed by ChunkedEncodingTransform on request structures for which C2J emits + * {@code bool IsChunked() const override { return true; }}. Collapses C2J's emit-time gate + * (MediaStore Data or supportsChunkedEncoding, plus streaming members and !signBody) into a single + * stamping decision; request rendering turns the marker into the override. */ public final class ChunkedEncodingTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#chunkedEncoding"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java index 2529fcc6dff..9f8683c447c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java @@ -18,16 +18,11 @@ import java.util.List; /** - * Stamps the internal {@link ChunkedEncodingTrait} onto the request structures for which C2J's - * {@code RequestHeader.vm} emits {@code bool IsChunked() const override { return true; }}. C2J gates - * that override on {@code ($metadata.serviceId=="MediaStore Data" || $operation.supportsChunkedEncoding)} - * (S3 sets {@code supportsChunkedEncoding} on {@code WriteGetObjectResponse} only) combined with - * {@code $shape.hasStreamMembers() && !$shape.signBody && $shape.members.size() > 0}. This transform - * collapses that emit-time condition into a single stamping decision: an operation qualifies when it - * carries {@code aws.auth#unsignedPayload} (the {@code !signBody} proxy), its input is a raw - * streaming payload request (the {@code hasStreamMembers} proxy, which also guarantees members > 0), - * and either the service is MediaStore Data or the operation is S3's {@code WriteGetObjectResponse}. - * No-op for any other service/operation, leaving the model instance untouched. + * Stamps {@link ChunkedEncodingTrait} onto request structures for which C2J emits + * {@code bool IsChunked() const override { return true; }}. An operation qualifies when it carries + * aws.auth#unsignedPayload (the !signBody proxy), its input is a raw streaming payload request (the + * hasStreamMembers proxy, also guaranteeing members > 0), and either the service is MediaStore Data + * or the operation is S3's WriteGetObjectResponse. No-op otherwise. */ public final class ChunkedEncodingTransform { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java index 34e6187d997..1cbcf123c46 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomRenderedTrait.java @@ -9,23 +9,14 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal, synthetic marker trait stamped onto a shape by a service-level transform to signal that - * the shape is emitted by a dedicated {@code ShapeRenderer} (e.g. {@code DynamoDbRenderer}) rather - * than by the generic {@code SubObjectRenderer}. {@code ShapeClassifier} skips any structure/union - * bearing this trait, so the default sub-object body is never emitted for it — preventing the - * double-emit that {@code CppWriterDelegator}'s append-on-existing-writer behaviour would otherwise - * silently produce. - * - *

This trait is never declared in a Smithy model file; it exists only as an in-memory trait - * instance added inside a {@code ModelTransformer}. Smithy does not require a model-level trait - * definition for an in-memory instance because trait-definition validation runs only through the - * {@code ModelAssembler}, not through {@code Model.toBuilder().build()} / {@code ModelTransformer}. - * The synthetic {@code aws.cpp.internal} namespace keeps its id from ever colliding with a real - * modeled trait. + * Internal synthetic marker signaling that a shape is emitted by a dedicated ShapeRenderer (e.g. + * DynamoDbRenderer) rather than the generic SubObjectRenderer. ShapeClassifier skips any + * structure/union bearing it, preventing the double-emit that CppWriterDelegator's append-on-existing + * behaviour would otherwise produce. Exists only as an in-memory trait added inside a + * ModelTransformer; the aws.cpp.internal namespace keeps its id from colliding with a modeled trait. */ public final class CustomRenderedTrait extends AnnotationTrait { - /** The synthetic, internal-only id for this marker trait. */ public static final ShapeId ID = ShapeId.from("aws.cpp.internal#customRendered"); public CustomRenderedTrait() { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java index cb40c23c71e..923fcdd3d52 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CustomizedAccessLogTagTrait.java @@ -9,15 +9,11 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link S3Transforms} on the - * {@code customizedAccessLogTag} map member it injects onto every S3 request. C2J models that - * member with a distinct {@code customizedQuery} flag rather than an ordinary query-string map: - * its {@code AddQueryStringParametersToRequest.vm} skips the normal {@code @httpQueryParams} loop - * for it and instead emits the {@code x-}-prefix filter block ({@code collectedLogTags}). This - * marker preserves that distinction — {@code RequestQuerySerializer} skips the marked member in - * the normal map loop and emits the {@code x-} filter block for it after the loop. The member - * keeps its {@code @httpQueryParams} trait so the request still declares - * {@code AddQueryStringParameters} ({@code RequestBindings.hasQueryStringMembers}). + * Internal marker placed by S3Transforms on the customizedAccessLogTag map member injected onto every + * S3 request. C2J models it with a distinct customizedQuery flag rather than an ordinary query-string + * map; the marker makes RequestQuerySerializer skip it in the normal map loop and instead emit the + * x--prefix filter block after the loop. The member keeps @httpQueryParams so the request still + * declares AddQueryStringParameters. */ public final class CustomizedAccessLogTagTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#customizedAccessLogTag"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java index e4be2f81216..6b7c56ffc45 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java @@ -14,20 +14,12 @@ import java.util.Optional; /** - * DynamoDB model transform: marks the {@code AttributeValue} shape with {@link CustomRenderedTrait} - * so {@code ShapeClassifier} drops it from the default sub-object set. DynamoDB's {@code - * AttributeValue} is a bespoke document type emitted verbatim by {@code DynamoDbRenderer} (matching - * the legacy C2J {@code DynamoDBJsonCppClientGenerator}); if the generic {@code SubObjectRenderer} - * also emitted it, both writers would resolve the same {@code AttributeValue.h} path and append, - * silently concatenating the generic tagged-union struct onto the hand-written document type. - * - *

Keeping the suppression here — rather than as a service-name {@code if} in the generic - * {@code ModelGenerator} — keeps the orchestrator service-agnostic: the marker drives a generic - * classifier rule that applies to any shape a dedicated renderer owns. The shape itself stays in - * the model so member references (e.g. {@code PutItemInput.Item}) still resolve. - * - *

Self-guards on the raw smithy service name {@code dynamodb} (no-op for every other service). - * No-op when the {@code AttributeValue} shape is absent (upstream model changed). + * DynamoDB C2J parity: marks the AttributeValue shape with {@link CustomRenderedTrait} so + * ShapeClassifier drops it from the default sub-object set. AttributeValue is a bespoke document type + * emitted verbatim by DynamoDbRenderer; without this the generic SubObjectRenderer would resolve the + * same AttributeValue.h path and append, concatenating a generic tagged-union struct onto it. The + * shape stays in the model so member references still resolve. Self-guards on service name dynamodb; + * no-op when AttributeValue is absent. */ public final class DynamoDbTransforms { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java index c15df915a39..dc43824d1cf 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java @@ -21,25 +21,12 @@ import java.util.Optional; /** - * EC2 model parity with the legacy C2J {@code Ec2CppClientGenerator}: adds the unmodeled - * {@code disabled} value to {@code SpotInstanceState}, renames every {@code *Result} - * structure shape to {@code *Response} so nested domain structs (e.g. {@code MetricDataResult}) - * match C2J, and models {@code ModifyInstanceAttributeRequest.UserData} as the sensitive - * {@code SecureBlobAttributeValue} to match the C2J model. Operation-OUTPUT result files are - * handled centrally by {@code ShapeUtil.getResultSuffix}, but nested domain structs are rendered - * from the shape name by {@code SubObjectRenderer}, so those require a model-shape rename. Out of - * scope (client/endpoint path, left to C2J): the legacy error-code injection, CopySnapshot - * pre-signing, and endpoint template. - * - *

UserData / SecureBlobAttributeValue: the upstream {@code aws/aws-models} C2J model - * ({@code ec2//service-2.json}) marks {@code UserData} sensitive via - * {@code SecureBlobAttributeValue -> SecureBlob (@sensitive)}, but the upstream Smithy model - * ({@code ec2/smithy/model.json}) still targets the non-sensitive {@code BlobAttributeValue}. This - * transform mirrors the C2J modeling in the Smithy model so generated code matches. It is a - * temporary compensation for that upstream data lag; once the upstream Smithy model catches up and - * already defines {@code SecureBlobAttributeValue}, this transform throws {@code IllegalStateException} - * so a human removes it rather than letting it silently self-retire — see - * docs/superpowers/plans/parity-deltas.md. + * EC2 C2J parity: adds the unmodeled {@code disabled} value to SpotInstanceState; renames every + * {@code *Result} structure to {@code *Response} so nested domain structs (rendered from shape name + * via SubObjectRenderer) match C2J; and retargets ModifyInstanceAttributeRequest.UserData to the + * sensitive SecureBlobAttributeValue (upstream Smithy still targets the non-sensitive + * BlobAttributeValue). Out of scope (left to C2J): legacy error-code injection, CopySnapshot + * pre-signing, and the endpoint template. */ public final class Ec2Transforms { @@ -58,17 +45,11 @@ private static Model apply(Model model, ServiceShape service) { } /** - * Models {@code ModifyInstanceAttributeRequest.UserData} as {@code SecureBlobAttributeValue} - * (whose {@code Value} member targets a {@code @sensitive} {@code SecureBlob} blob), matching - * the C2J model. The upstream Smithy model still targets the non-sensitive - * {@code BlobAttributeValue}; after repointing, {@code BlobAttributeValue} is no longer - * referenced and drops out of the reachable (emitted) set, exactly as it does in C2J. - * - *

Throws {@code IllegalStateException} when {@code SecureBlobAttributeValue} already exists - * (upstream Smithy caught up), signalling this compensating transform is obsolete and must be - * removed. No-op — leaving the model untouched — when {@code ModifyInstanceAttributeRequest} or - * its {@code UserData} member is absent, or {@code UserData} no longer targets - * {@code BlobAttributeValue} (source-absent, not a collision). + * Models ModifyInstanceAttributeRequest.UserData as SecureBlobAttributeValue (whose Value member + * targets a @sensitive SecureBlob blob), matching C2J; the now-unreferenced BlobAttributeValue + * drops out of the emitted set. Throws when SecureBlobAttributeValue already exists (upstream + * Smithy caught up, so this transform is obsolete). No-op when ModifyInstanceAttributeRequest or + * its UserData member is absent, or UserData no longer targets BlobAttributeValue. */ private static Model addSecureBlobUserData(Model model) { Optional requestOpt = model.shapes(StructureShape.class) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java index 51fba711240..1165452bf05 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/EmbeddedErrorsTrait.java @@ -9,13 +9,9 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 - * request structure that C2J's {@code S3RestXmlCppClientGenerator} lists in its hardcoded - * {@code functionsWithEmbeddedErrors} set ({@code shape.setEmbeddedErrors(true)}). REST-XML request - * rendering turns the marker into the {@code HasEmbeddedError(IOStream&, HeaderValueCollection&)} - * override that {@code RequestHeader.vm} emits under {@code #if($shape.hasEmbeddedErrors())}, so - * these S3 requests match C2J. Kept as a marker + generic renderer rule (not a service-name - * {@code if}) so the renderer stays service-agnostic; only S3 requests ever carry it. + * Internal marker placed by S3Transforms on S3 request structures in C2J's hardcoded + * functionsWithEmbeddedErrors set (shape.setEmbeddedErrors(true)). REST-XML request rendering turns + * the marker into the HasEmbeddedError(IOStream&, HeaderValueCollection&) override, matching C2J. */ public final class EmbeddedErrorsTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#embeddedErrors"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java index bab9d7fe54f..58aa21d8987 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java @@ -27,16 +27,11 @@ import java.util.stream.Collectors; /** - * Glacier parity with the legacy C2J {@code GlacierRestJsonCppClientGenerator} for the - * {@code Model::} namespace. C2J sets {@code metadata.additionalHeaders} to - * {@code {x-amz-glacier-version: }}, which the {@code Request} base class emits - * for ordinary requests. That base stays C2J-generated, so the only gap in the Smithy-generated - * model is the streaming requests ({@code UploadArchive}, {@code UploadMultipartPart}): they derive - * from {@code AmazonStreamingWebServiceRequest} and bypass the base {@code GetHeaders}, so C2J's - * {@code StreamRequestSource.vm} emits the constant header inside their own - * {@code GetRequestSpecificHeaders}. This stamps {@link AdditionalRequestHeadersTrait} on those - * streaming request inputs; request rendering turns it into the matching {@code headers.insert(...)}. - * Self-guards on the raw smithy service name and no-ops when the model has no streaming request. + * Glacier C2J parity. C2J sets metadata.additionalHeaders to {x-amz-glacier-version: }, + * emitted by the C2J-generated base request for ordinary requests. The gap is the streaming requests + * (UploadArchive, UploadMultipartPart), which bypass the base GetHeaders: this stamps + * {@link AdditionalRequestHeadersTrait} on their inputs so request rendering emits the matching + * headers.insert(...). Self-guards on service name; no-op when the model has no streaming request. */ public final class GlacierTransforms { @@ -75,15 +70,11 @@ private static Model addAdditionalHeaders(Model model, ServiceShape service) { return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); } - // Upstream Coral2Smithy's GlacierTransformer retypes every header/query `limit` (page-size) member - // from string to smithy.api#Integer, arguing the wire form (a query param) is unchanged. But the - // C++ SDK historically shipped these as Aws::String, so consuming the integer would break the - // public API (Aws::String GetLimit() -> int GetLimit()). This inverts the upstream retype for the - // header/query `limit` members, retargeting them back to the service string shape — matching C2J - // and the sibling string members (e.g. marker). Only these page-size members are query/header - // bound; body `limit` members (whose type change would alter serialization) are never retyped by - // Coral2Smithy and so are already string. Pagination is unaffected: the paginators continue via - // the `Marker` continuation token and never read or write `limit`. + // Upstream Coral2Smithy retypes header/query `limit` members from string to Integer, but the C++ + // SDK historically shipped these as Aws::String, so consuming the integer would break the public + // API. This inverts that retype, retargeting them back to the service string shape to match C2J. + // Body `limit` members are never retyped upstream and stay string; pagination is unaffected (it + // uses the `Marker` continuation token, never `limit`). private static Model retypeLimitQueryMembersToString(Model model, ServiceShape service) { ShapeId stringTarget = ShapeId.fromParts(service.getId().getNamespace(), "string"); if (!model.getShape(stringTarget).isPresent()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index a37787ebd3a..1823039213f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -39,41 +39,36 @@ public final class GlobalTransforms { /** - * Services that skip the "body" -> "requestBody" member rename (raw smithy service names). - * These use "body" as a meaningful domain/payload member. API Gateway (api-gateway) and - * API Gateway V2 (apigatewayv2) are skipped here because their dedicated transforms own the - * rename; the rest use "body" as an HTTP payload. + * Services (raw smithy names) that skip the "body" -> "requestBody" rename. api-gateway/apigatewayv2 + * own the rename in their dedicated transforms; the rest use "body" as a meaningful HTTP payload. */ private static final Set BODY_RENAME_SKIP_SERVICES = Set.of( "amplifyuibuilder", "api-gateway", "apigatewayv2", "bedrock-runtime", "glacier", "repostspace" ); /** - * Services that skip the "headers" -> "headerValues" member rename (raw smithy service name). - * api-gateway renames headers to "requestHeaders" in its dedicated transform instead. + * Services (raw smithy names) that skip the "headers" -> "headerValues" rename. api-gateway + * renames headers to "requestHeaders" in its dedicated transform instead. */ private static final Set HEADERS_RENAME_SKIP_SERVICES = Set.of( "api-gateway" ); /** - * The framework-injected response-envelope member and shape name. It is reserved: no AWS model - * defines its own {@code ResponseMetadata}. {@link #injectResponseMetadata} adds it (and fails - * fast on any pre-existing collision), and {@code MemberRenderer} keys the "always-present" - * rendering (no {@code HasBeenSet} getter, flag initialized true) on this exact name. + * The reserved framework-injected response-envelope member/shape name. {@link #injectResponseMetadata} + * adds it (failing fast on collision), and MemberRenderer keys the "always-present" rendering + * (no HasBeenSet getter, flag initialized true) on this exact name. */ public static final String RESPONSE_METADATA = "ResponseMetadata"; private GlobalTransforms() {} /** - * Renames reserved request members on every operation-input structure: {@code body -> - * requestBody}, {@code headers -> headerValues}, {@code Headers -> headerValues}, honoring the - * per-service skip-lists. Mirrors the legacy C2J {@code RESERVED_REQUEST_MEMBER_MAPPING}. Only - * operation-input shapes are touched (never arbitrary domain shapes that happen to end in - * "Request"). {@link TransformSupport#renameMember} preserves each renamed member's wire name - * via the service's protocol-appropriate trait (matching C2J's {@code setLocationName}), and - * throws on a collision (the target member name already present). + * Renames reserved request members on every operation-input structure ({@code body -> requestBody}, + * {@code headers/Headers -> headerValues}), honoring the per-service skip-lists. Mirrors C2J's + * {@code RESERVED_REQUEST_MEMBER_MAPPING}. Only operation-input shapes are touched. + * {@link TransformSupport#renameMember} preserves each renamed member's wire name via the + * protocol-appropriate trait and throws on a target-name collision. * * @param model the current model * @param service the service being generated (its raw smithy name drives the skip-lists) @@ -128,10 +123,9 @@ private static List> reservedRenames(StructureShape st } /** - * Computes the set of shape IDs reachable from the service's operations; only these shapes - * generate model files. Roots are each operation's input (including {@code smithy.api#Unit} - * for input-less operations), output, and error shapes, from which {@link Walker} walks the - * shape graph transitively. Each root id is included even when its shape is absent from the model. + * Computes the shape IDs reachable from the service's operations; only these generate model files. + * Roots are each operation's input (including {@code smithy.api#Unit}), output, and error shapes, + * walked transitively via {@link Walker}. Each root id is included even if its shape is absent. * * @param model the Smithy model * @param service the service shape whose operations define the root set @@ -154,13 +148,12 @@ private static void addReachableFrom(ShapeId root, Walker walker, Model model, S } /** - * Returns the service's operations excluding any marked {@code @deprecated}. Legacy C2J drops - * deprecated operations entirely (they never appear in the generated client), so their input and - * output structures — orphaned once the operation is gone — are not emitted either. This is the - * single filter used by every emission-driving iteration over the service's operations - * ({@link #computeReachableShapes} and {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier#classify}) - * so reachability and classification stay in agreement. A structure still referenced by a live - * operation remains reachable through that operation, so shared structures are unaffected. + * Returns the service's non-{@code @deprecated} operations. C2J drops deprecated operations + * entirely, so their orphaned input/output structures aren't emitted either. Used by every + * emission-driving iteration ({@link #computeReachableShapes} and + * {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.ShapeClassifier#classify}) + * so reachability and classification agree; structures still referenced by a live operation + * stay reachable. * * @param model the Smithy model * @param service the service whose operations are being generated @@ -173,11 +166,9 @@ public static List nonDeprecatedOperations(Model model, ServiceS } /** - * Returns this class as a ModelTransform. - * - *

Runs {@link #dropDeprecatedMembers} first (so reachability filtering sees the pruned - * model and orphaned targets drop out), then {@link #renameReservedRequestMembers} to apply the - * C2J-parity request-member renames, then {@link #injectResponseMetadata}. + * Returns this class as a ModelTransform: {@link #dropDeprecatedMembers} first (so reachability + * sees the pruned model), then {@link #renameReservedRequestMembers}, then + * {@link #injectResponseMetadata}. */ public static ModelTransform asTransform() { return (model, service) -> injectResponseMetadata( @@ -185,16 +176,11 @@ public static ModelTransform asTransform() { } /** - * Removes {@code @deprecated} members from the shapes this service actually generates. This - * mirrors the legacy C2J transformer, which drops {@code "deprecated": true} member references - * ({@code C2jModelToGeneratorModelTransformer}), so deprecated members never appear in - * generated model classes. A target shape referenced only through dropped members becomes - * unreachable and is likewise omitted, matching C2J. - * - *

Removal is scoped to members whose container is reachable from the service's operations. - * This is the "only touch what we emit" rule: it leaves framework trait definitions untouched - * (the {@code smithy.api} prelude, {@code smithy.rules}, {@code aws.*}, etc.), some of which - * declare their own {@code @deprecated} members that we must not mutate. + * Removes {@code @deprecated} members from the shapes this service generates, mirroring C2J's + * {@code C2jModelToGeneratorModelTransformer} (which drops {@code "deprecated": true} member refs). + * A target reachable only through dropped members becomes unreachable and is likewise omitted. + * Scoped to members whose container is reachable from the service's operations, so framework + * trait definitions ({@code smithy.api} prelude, {@code smithy.rules}, {@code aws.*}) stay untouched. * * @param model the current model * @param service the service being generated (defines the reachable, emitted shapes) @@ -213,15 +199,11 @@ public static Model dropDeprecatedMembers(Model model, ServiceShape service) { } /** - * For awsQuery / ec2Query services, and for any service carrying the - * {@code aws.protocols#awsQueryCompatible} trait (e.g. SQS = {@code awsJson1_0} + - * {@code @awsQueryCompatible}), injects a {@code ResponseMetadata} structure (carrying - * a {@code RequestId} string member) and adds it as a {@code @required} member on every - * result (operation output) shape. This mirrors the legacy C2J - * {@code CppClientGenerator.addRequestIdToResults} injection (which fires for query/ec2 - * protocols and, via its {@code awsQueryCompatible} branch, for awsQueryCompatible JSON - * services), so that those result classes expose {@code GetResponseMetadata()}. Other - * protocols are unchanged. + * For awsQuery/ec2Query services and any {@code @awsQueryCompatible} service (e.g. SQS = + * {@code awsJson1_0} + {@code @awsQueryCompatible}), injects a {@code ResponseMetadata} structure + * (with a {@code RequestId} member) and adds it as a {@code @required} member on every result shape, + * so those results expose {@code GetResponseMetadata()}. Mirrors C2J's + * {@code CppClientGenerator.addRequestIdToResults}. Other protocols are unchanged. * * @param model the current model * @param service the service being generated @@ -237,16 +219,14 @@ public static Model injectResponseMetadata(Model model, ServiceShape service) { String namespace = service.getId().getNamespace(); ShapeId responseMetadataId = ShapeId.fromParts(namespace, RESPONSE_METADATA); - // ResponseMetadata is reserved. If the model already defines a shape of that name, injecting - // ours would clobber it and MemberRenderer's name-based recognition could not tell them - // apart — fail fast rather than silently mis-generate. + // ResponseMetadata is reserved: a pre-existing shape of that name would be clobbered and + // MemberRenderer's name-based recognition could not tell them apart, so fail fast. if (model.getShape(responseMetadataId).isPresent()) { throw new IllegalStateException("Service " + service.getId() + " already defines a shape '" + responseMetadataId + "'; cannot inject the framework " + RESPONSE_METADATA + " envelope"); } - // ResponseMetadata { RequestId: String } StructureShape responseMetadata = StructureShape.builder() .id(responseMetadataId) .addMember(MemberShape.builder() @@ -255,7 +235,6 @@ public static Model injectResponseMetadata(Model model, ServiceShape service) { .build()) .build(); - // The @required ResponseMetadata member added to each result shape. List replacements = new ArrayList<>(); replacements.add(responseMetadata); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java index d213ad92c68..c89ba423ff8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTrait.java @@ -9,16 +9,11 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link LongPollingTransform} on the - * request structure of each operation for which C2J's {@code RequestHeader.vm} emits - * {@code bool IsLongPollingOperation() const override { return true; }} (gated on - * {@code $operation.longPolling}). C2J sets that flag from - * {@code C2jModelToGeneratorModelTransformer.LONG_POLLING_OPERATIONS}, a hardcoded per-serviceId set - * ({@code SQS: [ReceiveMessage]}, {@code SFN: [GetActivityTask]}, - * {@code SWF: [PollForActivityTask, PollForDecisionTask]}). The transform collapses that lookup into a - * single stamping decision so request rendering only has to turn the marker into the override. Kept as - * a marker + generic renderer rule (not a service-name {@code if}) so the renderer stays - * service-agnostic. + * Internal marker placed by {@link LongPollingTransform} on the request structure of each operation + * C2J flags via {@code LONG_POLLING_OPERATIONS} (SQS ReceiveMessage, SFN GetActivityTask, SWF + * PollForActivityTask/PollForDecisionTask). Request rendering turns the marker into + * {@code IsLongPollingOperation() const override { return true; }} (C2J's {@code RequestHeader.vm} + * gated on {@code $operation.longPolling}). */ public final class LongPollingTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#longPolling"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java index 6ad636277bc..de10d889b75 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java @@ -18,15 +18,11 @@ import java.util.Set; /** - * Stamps the internal {@link LongPollingTrait} onto the request structures of the long-polling - * operations that C2J flags with {@code operation.setLongPolling(true)}, so the - * {@code IsLongPollingOperation() -> true} override is emitted by request rendering. C2J's - * {@code C2jModelToGeneratorModelTransformer.LONG_POLLING_OPERATIONS} keys the set on the C2J - * {@code serviceId} ({@code SQS}, {@code SFN}, {@code SWF}); the Smithy equivalent is the RAW smithy - * service name (the lowercased/hyphenated sdkId from - * {@link ServiceNameUtil#getSmithyServiceName(ServiceShape, Map)} with a {@code null} service map, so - * no c2jMap remap such as {@code sfn->states} is applied). No-op for any other service, leaving the - * model instance untouched. + * Stamps {@link LongPollingTrait} onto the request structures of the long-polling operations C2J flags + * with {@code operation.setLongPolling(true)}, so the {@code IsLongPollingOperation() -> true} override + * is emitted. C2J keys {@code LONG_POLLING_OPERATIONS} on serviceId; the Smithy equivalent is the raw + * smithy service name (from {@link ServiceNameUtil#getSmithyServiceName(ServiceShape, Map)} with a + * {@code null} map, so no c2jMap remap like {@code sfn->states}). No-op for other services. */ public final class LongPollingTransform { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java index dee0eebb12b..518da95e340 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/OverrideStreamingTrait.java @@ -9,14 +9,10 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link S3Transforms} on each S3 - * request structure that C2J's {@code S3RestXmlCppClientGenerator} lists in its - * {@code REQUESTS_TO_OVERRIDE_STREAMING} set ({@code shape.setOverrideStreaming(true)}). These - * requests derive from {@code StreamingS3Request} (a typedef for {@code AmazonStreamingWebServiceRequest}, - * whose {@code IsStreaming()} returns {@code true}) yet must report non-streaming, so request rendering - * turns the marker into the {@code bool IsStreaming() const override { return false; }} override that - * {@code RequestHeader.vm} emits under {@code #if($shape.isOverrideStreaming())}. Kept as a marker + - * generic renderer rule (not a service-name {@code if}) so the renderer stays service-agnostic. + * Internal marker placed by {@link S3Transforms} on each S3 request in C2J's + * {@code REQUESTS_TO_OVERRIDE_STREAMING} set. These derive from {@code StreamingS3Request} + * (whose {@code IsStreaming()} returns {@code true}) yet must report non-streaming, so request + * rendering turns the marker into {@code bool IsStreaming() const override { return false; }}. */ public final class OverrideStreamingTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#overrideStreaming"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java index 38c61eba96f..d510bc260f9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java @@ -16,15 +16,11 @@ import java.util.List; /** - * S3 Control model parity with the legacy C2J {@code S3ControlRestXmlCppClientGenerator}, whose - * {@code addRequestIdToResults} adds BOTH a top-level {@code RequestId} and a top-level - * {@code HostId} (x-amz-id-2) to every result. RequestId is already emitted generically - * ({@code ProtocolTraits.resultHasTopLevelRequestId()}); this transform closes the HostId gap by - * marking each operation-output structure with {@link TopLevelHostIdTrait}, which - * {@code ResultRenderer} turns into the top-level HostId accessor group. Self-guards on the raw - * smithy service name {@code s3-control} ({@code ServiceNameUtil.getSmithyServiceName} lowercases - * the {@code S3 Control} sdkId and replaces the space with a hyphen; the {@code s3-control -> - * s3control} c2jMap remap is applied later by the plugin, not here). + * S3 Control parity with C2J's {@code S3ControlRestXmlCppClientGenerator}, whose + * {@code addRequestIdToResults} adds both a top-level {@code RequestId} and {@code HostId} (x-amz-id-2) + * to every result. RequestId is already emitted generically; this closes the HostId gap by marking + * each operation-output with {@link TopLevelHostIdTrait}, which {@code ResultRenderer} turns into the + * top-level HostId accessor group. Self-guards on the raw smithy service name {@code s3-control}. */ public final class S3ControlTransforms { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 4abbb61b85e..1fa5e3dad1e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -36,12 +36,11 @@ import java.util.stream.Collectors; /** - * S3 (and S3-CRT, which shares the S3 model) parity with the legacy C2J - * {@code S3RestXmlCppClientGenerator} for the {@code Model::} namespace. Composes the S3 model - * mutations that C2J applies in {@code generateSourceFiles}. Self-guards on the raw smithy service - * name; every sub-transform no-ops when its target shapes are absent and fast-fails on genuine - * collisions. Client/endpoint/ARN/S3Express/CRT customizations are out of scope (separate - * generators), as is serde-body emission (still stubbed plugin-wide). + * S3 (and S3-CRT, which shares the model) parity with C2J's {@code S3RestXmlCppClientGenerator} for + * the {@code Model::} namespace, composing the model mutations C2J applies in + * {@code generateSourceFiles}. Self-guards on the raw smithy service name; each sub-transform no-ops + * when its shapes are absent and fast-fails on genuine collisions. Client/endpoint/ARN/S3Express/CRT + * customizations and serde-body emission are out of scope. */ public final class S3Transforms { @@ -64,9 +63,8 @@ private static Model apply(Model model, ServiceShape service) { return markChecksumMembers(result, service); } - // C2J's S3RestXmlCppClientGenerator flips these two requests' isOverrideStreaming on. Both derive - // from StreamingS3Request (== AmazonStreamingWebServiceRequest, whose IsStreaming() returns true), - // so they must override IsStreaming() back to false; RequestRenderer emits that for marked shapes. + // C2J flips isOverrideStreaming on for these two requests. Both derive from StreamingS3Request + // (whose IsStreaming() returns true), so they must override it back to false for marked shapes. private static final Set REQUESTS_TO_OVERRIDE_STREAMING = Set.of( "PutBucketPolicyRequest", "PutObjectAnnotationRequest"); @@ -84,10 +82,9 @@ private static Model markOverrideStreaming(Model model) { return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); } - // C2J's S3RestXmlCppClientGenerator maps each checksum member shape name to its ChecksumAlgorithm - // enum constant; every request that also carries a ChecksumAlgorithm member gets these members - // flagged so their setters also call SetChecksumAlgorithm(...). ChecksumCRC64NVME is intentionally - // absent (C2J never listed it), so it keeps a plain setter. + // C2J maps each checksum member shape name to its ChecksumAlgorithm enum constant; every request + // that also carries a ChecksumAlgorithm member gets these flagged so their setters also call + // SetChecksumAlgorithm(...). ChecksumCRC64NVME is intentionally absent (C2J never listed it). private static final Map CHECKSUM_MEMBERS_ENUMS = Map.ofEntries( Map.entry("ChecksumCRC32", "CRC32"), Map.entry("ChecksumCRC32C", "CRC32C"), @@ -106,8 +103,8 @@ private static Model markChecksumMembers(Model model, ServiceShape service) { .collect(Collectors.toSet()); List replacements = new ArrayList<>(); for (StructureShape req : model.shapes(StructureShape.class).toList()) { - // Only request shapes that already carry a ChecksumAlgorithm member (so SetChecksumAlgorithm - // exists), and only when they hold at least one not-yet-marked checksum member. + // Only requests already carrying a ChecksumAlgorithm member with at least one + // not-yet-marked checksum member. boolean isChecksumRequest = inputShapes.contains(req.getId()) && req.getMember("ChecksumAlgorithm").isPresent(); boolean needsStamp = isChecksumRequest && req.getAllMembers().values().stream().anyMatch(m -> @@ -115,7 +112,7 @@ private static Model markChecksumMembers(Model model, ServiceShape service) { && !m.hasTrait(ChecksumMemberTrait.class)); if (needsStamp) { // Re-add only the checksum members with the marker; addMember replaces in place, so - // the other members (and the shape's traits/source) carry over untouched via toBuilder. + // other members and the shape's traits/source carry over via toBuilder. StructureShape.Builder b = req.toBuilder(); for (MemberShape m : req.getAllMembers().values()) { String enumValue = CHECKSUM_MEMBERS_ENUMS.get(m.getTarget().getName()); @@ -135,12 +132,10 @@ private static Model markChecksumMembers(Model model, ServiceShape service) { return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } - // C2J's S3RestXmlCppClientGenerator carries a hardcoded functionsWithEmbeddedErrors set; each - // listed request shape gets shape.setEmbeddedErrors(true), which RequestHeader.vm turns into the - // HasEmbeddedError(...) override. Mirror that by stamping EmbeddedErrorsTrait on every request - // structure whose simple name is in the set; REST-XML request rendering emits the method for - // marker-bearing shapes. The lone C2J typo entry (DeleteBucketAnaxlyticsConfigurationRequest) - // is kept verbatim so the set matches C2J exactly; it simply never matches a real shape. + // C2J's hardcoded functionsWithEmbeddedErrors set; each listed request gets setEmbeddedErrors(true), + // rendered as the HasEmbeddedError(...) override. Mirrored by stamping EmbeddedErrorsTrait on every + // request whose simple name is in the set. The C2J typo entry (DeleteBucketAnaxlytics...) is kept + // verbatim to match C2J exactly; it never matches a real shape. private static final Set EMBEDDED_ERROR_REQUESTS = Set.of( "AbortMultipartUploadRequest", "CompleteMultipartUploadRequest", "CopyObjectRequest", "CreateBucketRequest", "CreateMultipartUploadRequest", "CreateSessionRequest", @@ -193,19 +188,18 @@ private static Model markEmbeddedErrors(Model model) { return model.toBuilder().addShapes(marked.toArray(new Shape[0])).build(); } - // C2J's S3RestXmlCppClientGenerator appends a `customizedAccessLogTag` map member - // to every operation request shape, modeled with a distinct `customizedQuery` flag. It binds to - // the query string via @httpQueryParams (so every request emits AddQueryStringParameters), and - // additionally carries the CustomizedAccessLogTagTrait marker so RequestQuerySerializer skips the - // normal map loop for it and instead emits C2J's x--prefix filter block. + // C2J appends a `customizedAccessLogTag` map member to every request. It binds to + // the query string via @httpQueryParams (so every request emits AddQueryStringParameters) and + // carries the CustomizedAccessLogTagTrait marker so RequestQuerySerializer skips the normal map + // loop and emits C2J's x--prefix filter block instead. private static Model injectAccessLogTagQuery(Model model, ServiceShape service) { ShapeId mapId = ShapeId.fromParts("com.amazonaws.s3", "CustomizedAccessLogTag"); ShapeId stringId = ShapeId.from("smithy.api#String"); Set inputShapes = TopDownIndex.of(model).getContainedOperations(service).stream() .map(OperationShape::getInputShape) - // smithy.api#Unit is a shared prelude StructureShape; mutating it would corrupt every - // Unit-input operation across the model, so never treat it as a request shape. + // smithy.api#Unit is a shared prelude shape; mutating it would corrupt every Unit-input + // operation, so never treat it as a request shape. .filter(id -> !id.equals(UnitTypeTrait.UNIT)) .collect(Collectors.toSet()); List updated = model.shapes(StructureShape.class) @@ -225,9 +219,8 @@ private static Model injectAccessLogTagQuery(Model model, ServiceShape service) .addMember(MemberShape.builder() .id(req.getId().withMember("customizedAccessLogTag")) .target(mapId) - // @httpQueryParams binds this map to the query string. C2J models it as a - // querystring member on every request, which is what makes every request emit - // AddQueryStringParameters; the trait drives RequestBindings.hasQueryStringMembers. + // @httpQueryParams binds this map to the query string, driving + // RequestBindings.hasQueryStringMembers so every request emits AddQueryStringParameters. .addTrait(new HttpQueryParamsTrait()) // Marker for C2J's customizedQuery flag: RequestQuerySerializer skips the normal // map loop for this member and emits the x--prefix filter block instead. @@ -238,9 +231,9 @@ private static Model injectAccessLogTagQuery(Model model, ServiceShape service) return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } - // C2J collapses the model's split COMPLETE/COMPLETED ReplicationStatus values into a single - // COMPLETED constant. Drop the extra COMPLETED and rewrite COMPLETE to COMPLETED, preserving - // the remaining member order. Both remove and rewrite means we rebuild the enum explicitly. + // C2J collapses the split COMPLETE/COMPLETED ReplicationStatus values into a single COMPLETED. + // Drop the extra COMPLETED and rewrite COMPLETE to COMPLETED, preserving member order; the + // remove-and-rewrite means the enum is rebuilt explicitly. private static Model normalizeReplicationStatus(Model model) { Optional shapeOpt = model.shapes() .filter(s -> s.getId().getMember().isEmpty()) @@ -288,9 +281,8 @@ private static Map regionNameValueMap() { } // C2J's GetObjectResult carries an x-amz-id-2 header member (Id2) plus the standard RequestId. - // The RequestId is supplied by ResultRenderer's top-level RequestId group for rest-xml results - // (resultHasTopLevelRequestId() == true), which byte-matches C2J; injecting a modeled RequestId - // member here would duplicate it. So inject only Id2. + // RequestId is already supplied by ResultRenderer's top-level group for rest-xml results, so + // injecting a modeled RequestId here would duplicate it; inject only Id2. private static Model hackGetObjectResult(Model model) { String ns = "com.amazonaws.s3"; ShapeId outputId = ShapeId.fromParts(ns, "GetObjectOutput"); @@ -312,10 +304,9 @@ private static Model hackGetObjectResult(Model model) { return model.toBuilder().addShapes(id2Shape, withId2).build(); } - // C2J renames both the CopyObjectResult domain shape (to CopyObjectResultDetails) and the - // CopyObjectOutput member that references it, so the member renders as GetCopyObjectResultDetails - // while keeping its CopyObjectResult wire name. renameMember pins @xmlName("CopyObjectResult") - // for rest-xml so the wire key survives the member-name change. + // C2J renames the CopyObjectResult domain shape (to CopyObjectResultDetails) and the referencing + // CopyObjectOutput member, so it renders as GetCopyObjectResultDetails while keeping its wire name. + // renameMember pins @xmlName("CopyObjectResult") for rest-xml so the wire key survives. private static Model renameCopyObjectResult(Model model, ServiceShape service) { String ns = "com.amazonaws.s3"; ShapeId oldId = ShapeId.fromParts(ns, "CopyObjectResult"); @@ -391,12 +382,10 @@ private static Model addExpiresCustomization(Model model, ServiceShape service) return model.toBuilder().addShapes(replacements.toArray(new Shape[0])).build(); } - // Both request and result on ListParts / GetObjectAttributes reference these two shapes. C2J models - // them as integers, so the shipped SDK exposes int accessors. Coral2Smithy's S3ShapeMutatorTransformer - // instead treats them as opaque pagination tokens: it leaves PartNumberMarker as Coral's string and - // retypes NextPartNumberMarker to string. Retype both back to integer here to preserve the C2J public - // API (int, not Aws::String). The paginator generator is a separate plugin that never sees this - // mutation; it keeps its own NUMERIC_TOKEN_OVERRIDES entry so its `!= 0` check matches the int result. + // C2J models these two shapes (used by ListParts / GetObjectAttributes) as integers, so the shipped + // SDK exposes int accessors; Coral2Smithy retypes them to string pagination tokens. Retype both back + // to integer to preserve the C2J public API. The paginator generator is a separate plugin that never + // sees this and keeps its own NUMERIC_TOKEN_OVERRIDES entry so its `!= 0` check matches the int result. private static final List PART_NUMBER_MARKER_SHAPES = List.of("PartNumberMarker", "NextPartNumberMarker"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java index c844dc49107..b8ec549a219 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java @@ -20,11 +20,9 @@ import java.util.Set; /** - * Injects a synthetic {@code SourceRegion} string member into the request shapes of the - * cross-region copy operations for RDS-family services. Mirrors the legacy C2J - * {@code RDSCppClientGenerator}/{@code DocDBCppClientGenerator}/{@code NeptuneCppClientGenerator} - * injection that backs presigned-URL generation. Model-shape scope only: the presigned-URL - * client logic remains in the C2J path, which references this member. + * Injects a synthetic {@code SourceRegion} string member into the cross-region copy request shapes of + * RDS-family services (RDS/DocDB/Neptune), mirroring the C2J injection that backs presigned-URL + * generation. Model-shape scope only; the presigned-URL client logic remains in the C2J path. */ public final class SourceRegionTransform { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java index 8dd4b6eaa04..76e2ba8a735 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTrait.java @@ -9,14 +9,10 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link SupportsPresigningTransform} - * on each request structure that C2J's generators flag with {@code shape.setSupportsPresigning(true)} - * (every query/ec2 request via {@code QueryCppClientGenerator}, plus Polly's {@code SynthesizeSpeech}). - * C2J's shared {@code RequestHeader.vm} emits the protected {@code DumpBodyToUrl(Aws::Http::URI&)} - * override under {@code #if($shape.supportsPresigning())}, independent of protocol; request rendering - * turns this marker into that same protected override so the declaration stays protocol-agnostic - * while each protocol supplies only the method body. Kept as a marker + generic renderer rule (not a - * service-name {@code if}) so the renderer stays service-agnostic. + * Internal marker placed by {@link SupportsPresigningTransform} on each request C2J flags with + * {@code setSupportsPresigning(true)} (every query/ec2 request, plus Polly's {@code SynthesizeSpeech}). + * Request rendering turns the marker into the protected, protocol-agnostic + * {@code DumpBodyToUrl(Aws::Http::URI&)} override, with each protocol supplying only the method body. */ public final class SupportsPresigningTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#supportsPresigning"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java index d61c53db417..3eb51cfce34 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java @@ -18,14 +18,11 @@ import java.util.List; /** - * Stamps the internal {@link SupportsPresigningTrait} onto the OPERATIONS that C2J flags with - * {@code shape.setSupportsPresigning(true)}, so the protocol-agnostic {@code DumpBodyToUrl} override - * (declaration and impl) is emitted by request rendering. In C2J {@code supportsPresigning} is - * conceptually per-operation; the trait is stamped on the operation (never shared, unlike the - * {@code smithy.api#Unit} input) so it also covers {@code Unit}-input operations and keeps the decl - * and impl symmetric and protocol-agnostic. C2J's {@code QueryCppClientGenerator} sets the flag for - * every query/ec2 operation; Polly additionally sets it on {@code SynthesizeSpeech}. No-op for any - * other service, leaving the model instance untouched. + * Stamps {@link SupportsPresigningTrait} onto the operations C2J flags with + * {@code setSupportsPresigning(true)}, so the protocol-agnostic {@code DumpBodyToUrl} override is + * emitted. Stamped on the operation (never shared, unlike the {@code smithy.api#Unit} input) so it + * also covers Unit-input operations. C2J sets the flag for every query/ec2 operation, plus Polly's + * {@code SynthesizeSpeech}. No-op for other services. */ public final class SupportsPresigningTransform { @@ -44,8 +41,7 @@ private static Model apply(Model model, ServiceShape service) { } List updated = new ArrayList<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { - // Operations are never Unit, so query/ec2 stamps every operation (covering Unit-input - // ops). Idempotent: skip operations that already carry the trait. + // Operations are never Unit, so query/ec2 stamps every operation. Idempotent. boolean target = queryLike || "SynthesizeSpeech".equals(op.getId().getName()); if (target && !op.hasTrait(SupportsPresigningTrait.class)) { updated.add(op.toBuilder().addTrait(new SupportsPresigningTrait()).build()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java index 70f0eab371c..0ff68d7beb3 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TopLevelHostIdTrait.java @@ -9,12 +9,10 @@ import software.amazon.smithy.model.traits.AnnotationTrait; /** - * Internal marker (never declared in any model file) placed by {@link S3ControlTransforms} on each - * S3 Control operation-output structure. {@code ResultRenderer} emits the top-level {@code HostId} - * (x-amz-id-2) accessor group for marker-bearing result shapes — mirroring how the sibling - * top-level {@code RequestId} is emitted — so S3 Control results match C2J - * ({@code addToAllResultsShape("hostId", ...)}). Kept as a marker + generic renderer rule (not a - * service-name {@code if}) so the renderer stays service-agnostic. + * Internal marker placed by {@link S3ControlTransforms} on each S3 Control operation-output. For + * marker-bearing results, {@code ResultRenderer} emits the top-level {@code HostId} (x-amz-id-2) + * accessor group (mirroring the sibling top-level {@code RequestId}), matching C2J's + * {@code addToAllResultsShape("hostId", ...)}. */ public final class TopLevelHostIdTrait extends AnnotationTrait { public static final ShapeId ID = ShapeId.from("aws.cpp.internal#topLevelHostId"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java index 3d6df1ca2cf..5a60a828ca5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/TransformSupport.java @@ -39,19 +39,12 @@ final class TransformSupport { private TransformSupport() {} /** - * Appends the given wire {@code values} to an enum shape. + * Appends the given wire {@code values} to an enum shape. Each value must be identifier-safe + * ({@code [A-Za-z_][A-Za-z0-9_]*}) since it doubles as the Smithy member name and is compared + * against existing values for dedup; non-identifier values are rejected up front. * - *

Precondition: each value MUST be an identifier-safe wire value, i.e. a - * valid Smithy enum member name matching {@code [A-Za-z_][A-Za-z0-9_]*}. Values containing - * characters such as {@code '-'}, {@code '.'}, or spaces are rejected. This precondition matters - * for two reasons: the idempotency dedup compares the incoming values against the shape's - * existing values (obtained via {@link EnumRenderer#getEnumValues(Shape)}), and the - * {@code EnumShape} branch uses each value directly as the Smithy member name via - * {@code builder.addMember(value, value)}. A non-identifier value would silently break dedup - * and fail deep inside Smithy, so it is rejected up front. - * - * @param enumShape the enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code StringShape} - * with an {@code @enum} trait) to append to + * @param enumShape the enum shape (Smithy 2.0 {@code EnumShape} or legacy {@code @enum} + * {@code StringShape}) to append to * @param values identifier-safe wire values to append * @return the updated shape, or {@link Optional#empty()} if all values are already present * @throws IllegalArgumentException if any value is not an identifier-safe enum member name @@ -90,19 +83,11 @@ static Optional appendValues(Shape enumShape, List values) { /** * Appends {@code name -> value} enum entries, allowing wire values that are not - * identifier-safe (e.g. region strings containing {@code '-'} such as {@code us-east-1}). This is - * the name/value counterpart of {@link #appendValues(Shape, List)}, which requires the wire value - * to double as the member name. - * - *

Each map key is the Smithy member name and MUST be identifier-safe (matching - * {@code [A-Za-z_][A-Za-z0-9_]*}); each map value is the wire value and may be arbitrary. For a - * Smithy 2.0 {@code EnumShape} the name becomes the member name and the value the - * {@code @enumValue} via {@code builder.addMember(name, value)}; for a legacy {@code @enum} - * {@code StringShape} only the wire value is recorded (matching C2J, which keys the enum off the - * wire value and derives the constant name by sanitizing it). - * - *

Idempotent: entries whose wire value already exists are skipped; if every value is already - * present the shape is returned unchanged as {@link Optional#empty()}. + * identifier-safe (e.g. region strings like {@code us-east-1}); the name/value counterpart of + * {@link #appendValues(Shape, List)}. Each map key is the member name and must be identifier-safe; + * the value is the arbitrary wire value. For a Smithy 2.0 {@code EnumShape} both are recorded via + * {@code addMember(name, value)}; for a legacy {@code @enum} {@code StringShape} only the wire + * value is recorded (matching C2J). Idempotent: entries whose wire value already exists are skipped. * * @param enumShape the enum shape to append to * @param nameToValue ordered member-name to wire-value entries to append @@ -144,14 +129,10 @@ static Optional appendEnumValues(Shape enumShape, Map nam } /** - * Locates an enum shape by its simple (relative) name and appends the given identifier-safe wire - * {@code values}, returning the model with the updated shape — or unchanged when the shape is - * absent or every value is already present. Wraps the per-service pattern of adding unmodeled - * enum values; see {@link #appendValues} for the identifier-safe precondition on {@code values}. - * - *

The lookup matches the first shape whose relative name equals {@code simpleName} and which - * is an enum (Smithy 2.0 {@code EnumShape} or a legacy {@code StringShape} with an {@code @enum} - * trait). Callers are expected to have already scoped generation to a single service. + * Locates an enum shape by simple (relative) name and appends the identifier-safe wire + * {@code values}, returning the model with the updated shape — or unchanged if the shape is absent + * or every value is already present. See {@link #appendValues} for the value precondition. Matches + * the first enum shape whose relative name equals {@code simpleName}; callers scope to one service. */ static Model appendEnumValuesByName(Model model, String simpleName, List values) { return findEnumByName(model, simpleName) @@ -161,11 +142,9 @@ static Model appendEnumValuesByName(Model model, String simpleName, List } /** - * Locates an enum shape by its simple (relative) name and appends the given {@code member-name -> - * wire-value} entries (allowing non-identifier-safe wire values, e.g. region strings), returning - * the model with the updated shape — or unchanged when the shape is absent or every value is - * already present. Wraps the per-service pattern; see {@link #appendEnumValues} for the - * member-name precondition and value semantics. + * Locates an enum shape by simple (relative) name and appends the {@code member-name -> wire-value} + * entries (allowing non-identifier-safe wire values), returning the model with the updated shape — + * or unchanged if absent or all present. See {@link #appendEnumValues} for the semantics. */ static Model appendEnumEntriesByName(Model model, String simpleName, Map nameToValue) { return findEnumByName(model, simpleName) @@ -194,20 +173,13 @@ private static List existingWireValues(Shape enumShape) { /** * Returns a copy of {@code struct} with member {@code oldName} renamed to {@code newName}, - * preserving member declaration order and copying all traits onto the renamed member. Returns - * {@link Optional#empty()} if {@code oldName} is absent (nothing to rename). - * - *

The renamed member keeps its original wire name. A member with no explicit wire-name trait - * serializes under its member name, so renaming it would silently change the wire key; to - * prevent that this method pins the original name via the protocol-appropriate trait(s) - * ({@link #wireNamePreservingTraits}). This mirrors the legacy C2J rename primitive, which - * couples {@code setLocationName(originalMemberKey)} into the same step that changes the member - * key so a rename can never drop the wire name. + * preserving declaration order and copying all traits; {@link Optional#empty()} if {@code oldName} + * is absent. The renamed member keeps its original wire name: since a member with no wire-name + * trait serializes under its member name, this pins the original name via the protocol-appropriate + * trait(s) ({@link #wireNamePreservingTraits}), mirroring C2J's rename+{@code setLocationName}. * - * @throws IllegalStateException if {@code newName} is already a distinct member — a genuine - * collision that would silently drop a member; or if the protocol has no wire-name trait - * to preserve the original key (see {@link #wireNamePreservingTrait}). Callers must not - * mask either. + * @throws IllegalStateException if {@code newName} is already a distinct member (a collision that + * would drop a member), or if the protocol has no wire-name trait to preserve the key. */ static Optional renameMember(StructureShape struct, String oldName, String newName, Protocol protocol) { @@ -236,26 +208,20 @@ static Optional renameMember(StructureShape struct, String oldNa } /** - * The trait(s) to add to the renamed member so its wire name(s) stay equal to what {@code oldName} - * produced. Existing wire-name traits are always copied verbatim by the rename, so this only - * synthesizes what the member lacks; if a protocol's trait is already present, nothing is added - * for it. + * The trait(s) to add so the renamed member's wire name(s) stay equal to what {@code oldName} + * produced. Existing wire-name traits are copied verbatim by the rename, so this only synthesizes + * what the member lacks. * *

    *
  • JSON-family ({@code awsJson}, {@code restJson1}): {@code @jsonName}.
  • *
  • {@code restXml} / {@code awsQuery}: {@code @xmlName}.
  • - *
  • {@code ec2Query}: request and response use different names, so both are pinned. - * The request query key is authoritative from {@code @ec2QueryName} (used verbatim); the - * response XML element is {@code @xmlName}. EC2 models routinely carry an {@code @xmlName} - * that is not merely the camelCase of the request key (e.g. member {@code Ipv6Addresses} - * has {@code ec2QueryName=Ipv6Addresses} but {@code xmlName=ipv6AddressesSet}), so - * reconstructing the request key from {@code capitalize(@xmlName)} — what legacy C2J does — - * is unreliable. We instead pin {@code @ec2QueryName} to the member's current request key - * ({@code capitalize(@xmlName ?? memberName)} when it has none of its own) so it survives - * the member-name change without depending on any serde-time fallback.
  • - *
  • Any other protocol (e.g. {@code rpcv2Cbor}, which has no wire-name trait and always - * serializes under the member name): fail fast rather than emit an inert trait and - * mis-generate later.
  • + *
  • {@code ec2Query}: request and response use different names, so both are pinned — + * {@code @ec2QueryName} for the request key, {@code @xmlName} for the response element. + * EC2's {@code @xmlName} is often not the camelCase of the request key (e.g. + * {@code Ipv6Addresses} vs {@code ipv6AddressesSet}), so rather than reconstruct it we pin + * {@code @ec2QueryName} to the current request key ({@code capitalize(@xmlName ?? memberName)}).
  • + *
  • Any other protocol (e.g. {@code rpcv2Cbor}, which has no wire-name trait): fail fast rather + * than emit an inert trait and mis-generate.
  • *
*/ private static List wireNamePreservingTraits(MemberShape member, String oldName, diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java index d29a3b6a107..9232e21bf08 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/CppTypeMapperTest.java @@ -254,9 +254,8 @@ void enumShape_lowerCamelName_mapsToUpperCamelType() { @Test void legacyEnumStringShape_mapsToEnumType() { - // Smithy 1.0 models a closed set as a `string` shape carrying the @enum trait (not a 2.0 - // EnumShape). C2J treats these as enums, so a member targeting one must resolve to the - // enum C++ type, NOT Aws::String. Mirrors ShapeClassifier / EnumResolver detection. + // Smithy 1.0 models a closed set as a `string` shape with the @enum trait. C2J treats these + // as enums, so a member targeting one resolves to the enum C++ type, not Aws::String. software.amazon.smithy.model.traits.EnumTrait enumTrait = software.amazon.smithy.model.traits.EnumTrait.builder() .addEnum(software.amazon.smithy.model.traits.EnumDefinition.builder() @@ -317,11 +316,7 @@ void mapOfStringToStruct_mapsToAwsMap() { // --- recursive (mutually-referenced) shape tests --- - /** - * Builds the connectcases-style mutual cycle: a union {@code BooleanCondition} with a direct - * member targeting struct {@code CompoundCondition}, which holds a list of - * {@code BooleanCondition}. The two aggregates are mutually referenced through the list. - */ + /** connectcases-style mutual cycle: union {@code BooleanCondition} -> struct {@code CompoundCondition} -> list of {@code BooleanCondition}. */ private static Model mutualCycleModel() { StructureShape operands = StructureShape.builder().id("com.example#BooleanOperands").build(); // Forward references are fine; Model.builder resolves them at build(). @@ -378,9 +373,8 @@ void recursiveMember_headerSwapsStructIncludeForAllocator_andForwardDeclares() { @Test void directSelfReference_isRecursive_butNotForwardDeclaredOrSelfIncluded() { - // connectcases CaseFilter has a `not` member targeting CaseFilter itself. C2J renders it as - // std::shared_ptr but adds neither a self forward-declaration nor a self-include - // (the class declares itself) — and, unlike the mutual case, no AWSAllocator.h either. + // connectcases CaseFilter's `not` member targets CaseFilter itself: C2J renders shared_ptr + // but adds no self forward-decl, no self-include, and (unlike the mutual case) no AWSAllocator.h. StructureShape filter = StructureShape.builder() .id("com.example#CaseFilter") .addMember("not", software.amazon.smithy.model.shapes.ShapeId.from("com.example#CaseFilter")) @@ -589,9 +583,8 @@ void getIncludesForShape_withListMember_includesVectorAndElement() { @Test void getIncludesForShape_withIdempotencyTokenMember_includesUuidHeader() { - // C2J adds to any shape carrying an @idempotencyToken member, - // because such members are brace-initialized with Aws::Utils::UUID::PseudoRandomUUID() - // (CppViewHelper.java). The include must be present for the initializer to compile. + // C2J adds for any @idempotencyToken member, which is brace-initialized + // with Aws::Utils::UUID::PseudoRandomUUID() and needs the include to compile. StringShape str = StringShape.builder().id("com.example#Str").build(); StructureShape struct = StructureShape.builder() .id("com.example#MyRequest") @@ -644,10 +637,8 @@ void getIncludesForShape_withMapMember_includesMapKeyAndValue() { @Test void getIncludesForShape_withNestedMapOfMap_includesLeafStructHeader() { - // apigateway Deployment.apiSummary is Map>. The outer - // map's value is itself a map (no header of its own), so a one-level unwrap stops before - // reaching the leaf struct MethodSnapshot and its header is dropped — an incomplete-type - // compile error. C2J recursively unwraps nested containers to include all leaf headers. + // apigateway Deployment.apiSummary is Map>: a one-level + // unwrap misses the leaf MethodSnapshot header, so C2J recursively unwraps nested containers. StringShape str = StringShape.builder().id("com.example#Str").build(); StructureShape leaf = StructureShape.builder().id("com.example#MethodSnapshot").build(); MapShape innerMap = MapShape.builder() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java index f22a5581945..8dae2e12f55 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EnumRendererTest.java @@ -43,9 +43,8 @@ void renderHeader_producesEnumClass() { @Test void renderHeader_capitalizesLowerCamelEnumName() { - // Some Smithy models (e.g. IAM) name enum shapes in lowerCamel. C2J normalizes every - // shape name to UpperCamel, so the C++ enum type, mapper namespace, and mapper - // functions must be capitalized regardless of the model's casing. + // Some Smithy models (e.g. IAM) name enum shapes in lowerCamel; C2J normalizes to UpperCamel, + // so the C++ enum type, mapper namespace, and functions must all be capitalized. EnumShape enumShape = EnumShape.builder() .id("com.example#statusType") .addMember("Active", "Active") diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java index 0b4bf2a5e11..6545cc4e58f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventPayloadRendererTest.java @@ -24,9 +24,7 @@ /** * Verifies {@link EventPayloadRenderer} produces a header-only blob-carrier event (C2J - * {@code EventHeader.vm} form): an {@code Aws::Vector} payload with a bytes - * constructor, non-template accessors, and a {@code GetWithOwnership()} move-out — and - * NO JSON serde and NO {@code .cpp}. + * {@code EventHeader.vm} form): {@code Aws::Vector} payload, no JSON serde, no {@code .cpp}. */ class EventPayloadRendererTest { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java index d04d8a98092..82925e48bd7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java @@ -87,9 +87,8 @@ private static Model twoEventModel() { return Model.builder().addShapes(str, stream, eventA, eventB, exc, modeledExc, input, output, op, service).build(); } - // A @streaming union with one empty event (target shape has no modeled members) and one data - // event (target shape has a modeled member). Callback/member names derive from the target - // shape name, matching twoEventModel's convention (alpha -> AlphaEvent -> m_onAlphaEvent). + // A @streaming union with one empty event (no modeled members) and one data event. Callback/member + // names derive from the target shape name (alpha -> AlphaEvent -> m_onAlphaEvent). private static Model unionWithEmptyAndDataEvent() { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape emptyEvent = StructureShape.builder() @@ -209,8 +208,7 @@ void handlerHeader_wrapsInitialResponseSettersInDocGroup() { @Test void eventStreamUnionHeader_noLongerEmitted() { // The incoming event-stream union is realized via the handler; nothing references it as a - // data type. The renderer must not emit its standalone .h (dead public API) — the - // classifier already drops it from subObjects so no other renderer emits it either. + // data type, so the renderer must not emit its standalone .h (dead public API). java.util.List paths = renderedFilePaths(twoEventModel()); assertTrue(paths.stream().noneMatch(p -> p.endsWith("MyStreamEventStream.h")), "incoming event-stream union header must not be emitted: " + paths); @@ -240,9 +238,8 @@ void initialResponseHeader_hasHeaderCollectionCtorAndSerdeDecls() { @Test void initialResponseHeader_rendersNonStreamingResultMembers() { - // C2J synthesizes InitialResponse from the result's non-event-stream members, so the - // header must carry accessors for those members (here: contentType) plus a private section. - // The @httpPayload streaming union member (stream) must NOT appear. + // C2J synthesizes InitialResponse from the result's non-event-stream members (here + // contentType); the @httpPayload streaming union member (stream) must not appear. String h = render("DoStreamInitialResponse.h"); assertTrue(h.contains("GetContentType") && h.contains("SetContentType") && h.contains("WithContentType"), "InitialResponse must render accessors for non-streaming result members: " + h); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index 1198a76430d..34c2568221d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -171,7 +171,6 @@ private static Model inputModelWithProtocol(String sdkId, @Test void computeReachableShapes_simpleOperation_includesInputAndOutput() { - // Build a minimal model with one operation that has input and output StructureShape input = StructureShape.builder() .id("com.example#MyInput") .addMember(MemberShape.builder() @@ -212,7 +211,6 @@ void computeReachableShapes_simpleOperation_includesInputAndOutput() { @Test void computeReachableShapes_nestedStructure_isReachable() { - // Nested structure should be reachable through member reference StructureShape nested = StructureShape.builder() .id("com.example#NestedStruct") .addMember(MemberShape.builder() @@ -257,7 +255,6 @@ void computeReachableShapes_nestedStructure_isReachable() { @Test void computeReachableShapes_unreferencedShape_notIncluded() { - // A shape that is not referenced by any operation should not be reachable StructureShape unreferenced = StructureShape.builder() .id("com.example#Unreferenced") .addMember(MemberShape.builder() @@ -297,7 +294,6 @@ void computeReachableShapes_unreferencedShape_notIncluded() { @Test void computeReachableShapes_listMember_targetIsReachable() { - // List member targets should be traversed StructureShape element = StructureShape.builder() .id("com.example#Element") .addMember(MemberShape.builder() @@ -350,7 +346,6 @@ void computeReachableShapes_listMember_targetIsReachable() { @Test void computeReachableShapes_mapKeyAndValue_areReachable() { - // Map key and value targets should be traversed StructureShape valueShape = StructureShape.builder() .id("com.example#MapValue") .addMember(MemberShape.builder() @@ -407,7 +402,6 @@ void computeReachableShapes_mapKeyAndValue_areReachable() { @Test void computeReachableShapes_errorShapes_areReachable() { - // Error shapes should be traversed StructureShape error = StructureShape.builder() .id("com.example#MyError") .addMember(MemberShape.builder() @@ -449,9 +443,8 @@ void computeReachableShapes_errorShapes_areReachable() { @Test void computeReachableShapes_excludesStructReachableOnlyViaDeprecatedOperation() { - // A @deprecated operation is dropped entirely (matching legacy C2J, which omits deprecated - // operations). A struct reachable ONLY through the deprecated op's input must fall out of the - // reachable set, while a struct shared with a live op stays reachable via that live op. + // A @deprecated operation is dropped entirely (C2J parity). A struct reachable only via it + // falls out of the reachable set; one shared with a live op stays reachable. StructureShape deprecatedOnly = StructureShape.builder() .id("com.example#DeprecatedOnly") .addMember(MemberShape.builder() @@ -512,9 +505,8 @@ void computeReachableShapes_excludesStructReachableOnlyViaDeprecatedOperation() @Test void dropDeprecatedMembers_removesDeprecatedMember_keepsOthers() { - // Mirrors C2J: a member with @deprecated is dropped from the generated shape; siblings stay. - // The shape must be reachable from the service (used as an operation input here) so that the - // reachability-scoped transform considers it. + // Mirrors C2J: a @deprecated member is dropped; siblings stay. The shape is an operation + // input so the reachability-scoped transform considers it. StructureShape config = StructureShape.builder() .id("com.example#LocationConfiguration") .addMember(MemberShape.builder() @@ -590,9 +582,8 @@ void dropDeprecatedMembers_orphanedTargetBecomesUnreachable() { @Test void dropDeprecatedMembers_sharedTargetSurvivesViaNonDeprecatedReference() { - // A shape reached through BOTH a @deprecated member and a live member must stay reachable: - // dropping the deprecated reference must never orphan a shape the surviving model still uses. - // This guards against a pruning bug that would drop a shared shape and dangle the live ref. + // A shape reached through both a @deprecated and a live member must stay reachable: dropping + // the deprecated reference must not orphan a shape the surviving model still uses. StructureShape shared = StructureShape.builder() .id("com.example#SharedDetail") .addMember(MemberShape.builder() @@ -636,9 +627,8 @@ private static ServiceShape serviceOf(Model model, String name) { @Test void injectResponseMetadata_failsFastOnModeledResponseMetadataMember() { - // ResponseMetadata is framework-reserved. A modeled member of that name on a result would - // make MemberRenderer's name-based recognition ambiguous, so injection fails fast rather - // than clobber the modeled member or silently mis-render it. + // ResponseMetadata is framework-reserved; a modeled member of that name would make + // name-based recognition ambiguous, so injection fails fast rather than clobber it. StructureShape input = StructureShape.builder().id("com.example#DoThingInput").build(); StructureShape output = StructureShape.builder() .id("com.example#DoThingOutput") @@ -791,9 +781,8 @@ void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataStruc @Test void injectResponseMetadata_skipsDeprecatedOperationOutputSharedByLiveOp() { - // A @deprecated operation's output that is ALSO reused as a nested member by a live op's - // output is reachable/emitted as a sub-object, but C2J drops the deprecated op entirely and - // never injects ResponseMetadata into that shape. Only genuine live-op outputs get it. + // A @deprecated op's output reused as a nested member stays emitted, but C2J drops the + // deprecated op and never injects ResponseMetadata there; only genuine live-op outputs get it. StructureShape sharedOutput = StructureShape.builder() .id("com.example#SharedOutput") .addMember(MemberShape.builder() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java index 7925f00304e..cfc961f1168 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererOutputTest.java @@ -40,7 +40,6 @@ void fullOutput_matchesExpectedPattern() { System.out.println("=== PUBLIC ==="); System.out.println(pubOutput); - // Verify ShardId accessor pattern assertTrue(pubOutput.contains("inline const Aws::String& GetShardId() const { return m_shardId; }")); assertTrue(pubOutput.contains("inline bool ShardIdHasBeenSet() const { return m_shardIdHasBeenSet; }")); assertTrue(pubOutput.contains("template ")); @@ -50,16 +49,13 @@ void fullOutput_matchesExpectedPattern() { assertTrue(pubOutput.contains("ChildShard& WithShardId(ShardIdT&& value)")); assertTrue(pubOutput.contains("SetShardId(std::forward(value));")); - // Verify ParentShards list pattern - includes Add method assertTrue(pubOutput.contains("inline const Aws::Vector& GetParentShards() const { return m_parentShards; }")); assertTrue(pubOutput.contains("ChildShard& AddParentShards(ParentShardsT&& value)")); assertTrue(pubOutput.contains("m_parentShards.emplace_back(std::forward(value));")); - // Verify no Add method for non-list members assertFalse(pubOutput.contains("AddShardId")); assertFalse(pubOutput.contains("AddHashKeyRange")); - // Private section CppWriter privWriter = new CppWriter(); MemberRenderer.forStructure(model, shape, null).renderPrivateSection(privWriter); String privOutput = privWriter.toString(); @@ -115,9 +111,8 @@ void nonChecksumStringMember_hasNoAlgorithmSideEffectOrConstCharOverload() { @Test void sparseListAndMap_emitOptionalTypesAndAddOverloads() { - // Mirrors C2J's generated SparseNullsOperationRequest.h: a @sparse list/map wraps its - // element/value in Aws::Crt::Optional, and gets an extra Add overload accepting the - // Optional element/value directly. + // Mirrors C2J SparseNullsOperationRequest.h: @sparse list/map wraps element/value in + // Aws::Crt::Optional and gets an extra Add overload taking the Optional directly. StringShape str = StringShape.builder().id("com.example#String").build(); ListShape sparseList = ListShape.builder() .id("com.example#SparseStringList") @@ -142,7 +137,6 @@ void sparseListAndMap_emitOptionalTypesAndAddOverloads() { String out = writer.toString(); System.out.println(out); - // --- sparse list --- assertTrue(out.contains( "inline const Aws::Vector>& GetSparseStringList() const { return m_sparseStringList; }"), out); @@ -155,7 +149,6 @@ void sparseListAndMap_emitOptionalTypesAndAddOverloads() { out); assertTrue(out.contains("m_sparseStringList.push_back(value);"), out); - // --- sparse map --- assertTrue(out.contains( "inline const Aws::Map>& GetSparseStringMap() const { return m_sparseStringMap; }"), out); @@ -172,9 +165,8 @@ void sparseListAndMap_emitOptionalTypesAndAddOverloads() { @Test void recursiveMember_rendersSharedPtrFieldGetterAndMakeSharedSetter() { - // Mirrors connectcases BooleanCondition.h: the andAll member targets CompoundCondition, - // which lists BooleanCondition back — a cycle C2J breaks with std::shared_ptr, a *m_x - // getter, and a MakeShared setter tagged with the enclosing class name. + // Mirrors connectcases BooleanCondition.h: the andAll->CompoundCondition->BooleanCondition + // cycle C2J breaks with std::shared_ptr, a *m_x getter, and an enclosing-class MakeShared setter. StructureShape operands = StructureShape.builder().id("com.example#BooleanOperands").build(); UnionShape booleanCondition = UnionShape.builder() .id("com.example#BooleanCondition") diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java index 598095009a8..354199013f5 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/MemberRendererTest.java @@ -38,9 +38,8 @@ void renderPublicSection_stringMember_producesGetSetWith() { @Test void renderPublicSection_lowercaseMember_capitalizesMethodNames() { - // Smithy member names frequently start lowercase (e.g. "extendedKeyUsage"). - // The legacy C2J convention capitalizes the accessor method names and template - // params while keeping the decapitalized field name (m_extendedKeyUsage). + // Smithy member names often start lowercase; C2J capitalizes accessor/template names while + // keeping the decapitalized field name (m_extendedKeyUsage). StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape shape = StructureShape.builder() .id("com.example#MyShape") @@ -55,7 +54,6 @@ void renderPublicSection_lowercaseMember_capitalizesMethodNames() { assertTrue(output.contains("SetExtendedKeyUsage(ExtendedKeyUsageT&& value)"), "Setter should be capitalized: " + output); assertTrue(output.contains("WithExtendedKeyUsage(ExtendedKeyUsageT&& value)"), "With should be capitalized: " + output); assertTrue(output.contains("m_extendedKeyUsage = std::forward"), "Field should stay decapitalized: " + output); - // Must not emit the raw lowercase-first method names. assertFalse(output.contains("GetextendedKeyUsage"), "Must not emit lowercase getter: " + output); assertFalse(output.contains("WithextendedKeyUsage"), "Must not emit lowercase With: " + output); } @@ -177,9 +175,8 @@ void renderPublicSection_mapWithNonPrimitiveKeyAndValue_addIsTemplated() { @Test void renderPublicSection_documentMember_getterReturnsDocumentViewByValue() { - // C2J special-cases the document getter to return Aws::Utils::DocumentView by value - // (ModelClassMembersAndInlines.vm: $returnType = "Aws::Utils::DocumentView"), while the - // field and setter stay Aws::Utils::Document. + // C2J special-cases the document getter to return Aws::Utils::DocumentView by value, while + // the field and setter stay Aws::Utils::Document. software.amazon.smithy.model.shapes.DocumentShape doc = software.amazon.smithy.model.shapes.DocumentShape.builder().id("com.example#Doc").build(); StructureShape shape = StructureShape.builder() @@ -251,7 +248,6 @@ void renderPublicSection_primitiveGetter_returnsByValue() { CppWriter writer = new CppWriter(); MemberRenderer.forStructure(model, shape, "MyShape").renderPublicAccessors(writer); String output = writer.toString(); - // Primitive getter should return by value, not const ref assertTrue(output.contains("inline int GetCount() const"), "Primitive should return by value: " + output); assertFalse(output.contains("inline const int&"), "Should NOT return const ref for primitives: " + output); } @@ -308,10 +304,8 @@ void renderPrivateSection_nonPrimitiveMembers_noDefaultValue() { @Test void renderPrivateSection_idempotencyTokenMember_initializesWithPseudoRandomUuidAndHasBeenSetTrue() { - // C2J auto-populates @idempotencyToken members with a random UUID at construction - // (ServiceClientModelHeaderMemberDeclaration.vm) and flags them as already-set - // (ModelClassMembersAndInlines.vm), so a caller who omits the token still gets - // idempotent behavior. The initializer and the =true flag must both be emitted. + // C2J auto-populates @idempotencyToken members with a random UUID and flags them already-set, + // so a caller who omits the token still gets idempotent behavior. StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape shape = StructureShape.builder() .id("com.example#MyShape") @@ -369,7 +363,6 @@ void renderPrivateSection_hasBeenSetFlagsGroupedAtEnd() { CppWriter writer = new CppWriter(); MemberRenderer.forStructure(model, shape, null).renderPrivateSection(writer); String output = writer.toString(); - // HasBeenSet flags should come after data members int nameFieldPos = output.indexOf("Aws::String m_name;"); int countFieldPos = output.indexOf("int m_count{0};"); int nameHasBeenSetPos = output.indexOf("bool m_nameHasBeenSet = false;"); @@ -426,9 +419,8 @@ private static StructureShape myShape(Model model) { @Test void injectedResponseMetadata_inStructure_omitsGetter_whileOthersKeepIt() { - // The injected ResponseMetadata envelope is always present -> no HasBeenSet getter. A - // modeled @required member is NOT special-cased (C2J clears required), so it keeps its - // getter just like a plain member. + // The injected ResponseMetadata envelope is always present -> no HasBeenSet getter. A modeled + // @required member is not special-cased, so it keeps its getter like a plain member. Model model = responseMetadataModel(); CppWriter writer = new CppWriter(); MemberRenderer.forStructure(model, myShape(model), "MyShape").renderPublicAccessors(writer); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java index 0ff4553eb25..993a727d05d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java @@ -22,42 +22,28 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * End-to-end guard for suppressing DynamoDB's {@code AttributeValue} union from the default - * sub-object set. Suppression is now driven by {@link DynamoDbTransforms} marking the shape - * {@code @customRendered} and {@link ShapeClassifier} skipping marked shapes — the generic - * {@code ModelGenerator} no longer knows about dynamodb. This test therefore applies the DynamoDB - * transform to its model before running {@code ModelGenerator}, exercising the whole chain: - * transform-marks -> classifier-skips -> single bespoke file. - * - *

The suppression is load-bearing, not cosmetic: {@code CppWriterDelegator.useFileWriter} - * keys writers by filename via {@code computeIfAbsent}, so if {@code AttributeValue} were left in - * {@code subObjects}, {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.SubObjectRenderer} + * End-to-end guard that DynamoDB's {@code AttributeValue} union is suppressed from the default + * sub-object set: {@link DynamoDbTransforms} marks it {@code @customRendered} and + * {@link ShapeClassifier} skips it. Load-bearing, not cosmetic: {@code CppWriterDelegator} keys + * writers by filename, so a leftover {@code AttributeValue} would make + * {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.SubObjectRenderer} * and {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.DynamoDbRenderer} - * would both resolve the same {@code include/aws/dynamodb/model/AttributeValue.h} key, share one - * writer, and APPEND — silently concatenating the generic tagged-union struct onto the bespoke - * document type with no error. This test runs {@code ModelGenerator} end-to-end and asserts the - * emitted header is the bespoke class only, never the generic union. The per-renderer tests - * ({@code DynamoDbRendererTest}, {@code SubObjectRendererTest}) do not exercise this wiring where - * the double-emit would occur. + * share one writer and APPEND, silently concatenating the generic union onto the bespoke type. This + * runs {@code ModelGenerator} end-to-end and asserts the header is the bespoke class only. */ class ModelGeneratorTest { private static final String ATTRIBUTE_VALUE_HEADER = "include/aws/dynamodb/model/AttributeValue.h"; - // A synthetic union member whose generic per-member accessor (produced by SubObjectRenderer) - // does not exist anywhere in the bespoke AttributeValue resource, so its presence/absence - // cleanly distinguishes generic-union output from the hand-written document type. + // Synthetic union member whose generic accessor exists only in generic-union output, not the + // bespoke AttributeValue — so it distinguishes the two. private static final String GENERIC_UNION_MARKER = "WithSyntheticProbe"; // A member unique to the bespoke hand-written AttributeValue (holds the AttributeValueValue). private static final String BESPOKE_MARKER = "std::shared_ptr m_value;"; /** - * A minimal model with a service, one operation, and an {@code AttributeValue} union - * referenced by the operation input. The union carries a synthetic member so that, were it - * rendered generically, {@link #GENERIC_UNION_MARKER} would appear in the output. - * - *

The service carries a {@code ServiceTrait} whose {@code sdkId} is {@code smithyServiceName} - * so {@link DynamoDbTransforms}' own self-guard (which reads the service's sdk id) fires - * consistently with the {@code smithyServiceName} passed to {@code ModelGenerator}. + * Minimal model with a service, one operation, and an {@code AttributeValue} union (carrying a + * synthetic member) referenced by the operation input. The service's {@code ServiceTrait} sdkId + * is {@code smithyServiceName} so {@link DynamoDbTransforms}' self-guard fires consistently. */ private static Model model(String smithyServiceName) { StringShape str = StringShape.builder().id("com.amazonaws.dynamodb#Str").build(); @@ -95,9 +81,8 @@ private static MockManifest generate(String smithyServiceName, String namespace, Model model = model(smithyServiceName); ServiceShape service = model.expectShape( ShapeId.from("com.amazonaws.dynamodb#DynamoDB_20120810"), ServiceShape.class); - // Apply the DynamoDB service-level transform first, mirroring the real ModelCodegenPlugin - // pipeline: for dynamodb it marks AttributeValue @customRendered; for any other service it - // is a no-op. Suppression then flows through ShapeClassifier, not ModelGenerator. + // Apply the DynamoDB service-level transform first (mirrors ModelCodegenPlugin): marks + // AttributeValue @customRendered for dynamodb, no-op otherwise. Suppression flows through ShapeClassifier. Model transformed = DynamoDbTransforms.asTransform().apply(model, service); MockManifest manifest = new MockManifest(); CppWriterDelegator delegator = new CppWriterDelegator(manifest); @@ -127,8 +112,7 @@ void dynamoDb_emitsBespokeAttributeValueOnly_notGenericUnion() { // It is the bespoke document type ... assertTrue(header.contains(BESPOKE_MARKER), "AttributeValue.h must be the bespoke document type: " + header); - // ... and NOT the generic tagged-union SubObjectRenderer would produce for the union - // members. Its presence would mean the generic body was (also) written to this file. + // ... and NOT the generic tagged-union (its presence would mean the generic body was appended here). assertFalse(header.contains(GENERIC_UNION_MARKER), "AttributeValue.h must not contain generic-union accessors (double-emit/corruption): " + header); @@ -147,9 +131,8 @@ void dynamoDb_emitsBespokeAttributeValueOnly_notGenericUnion() { @Test void otherService_rendersAttributeValueUnionGenerically() { - // Control: the suppression is dynamodb-specific. For any other service, DynamoDbRenderer is - // a no-op and the AttributeValue union flows through SubObjectRenderer as a generic union, - // proving the buildRenderers filter is what removes it for dynamodb. + // Control: suppression is dynamodb-specific. For any other service the AttributeValue union + // flows through SubObjectRenderer as a generic union. MockManifest manifest = generate("kinesis", "Kinesis", "AWS_KINESIS_API"); String header = manifest.getFileString("include/aws/kinesis/model/AttributeValue.h") diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/OutgoingEventStreamRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/OutgoingEventStreamRendererTest.java index 483d2f652a2..36373f8b21b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/OutgoingEventStreamRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/OutgoingEventStreamRendererTest.java @@ -29,11 +29,7 @@ class OutgoingEventStreamRendererTest { - /** - * A bidirectional operation whose input binds a @streaming union with one event member whose - * payload is a nested structure (the implicit-structure case, like bedrock's - * BidirectionalInputPayloadPart). - */ + /** Input binds a @streaming union with one event member whose payload is a nested structure (implicit-structure case). */ private static Model structurePayloadModel() { StringShape str = StringShape.builder().id("com.example#String").build(); BlobShape blob = BlobShape.builder().id("com.example#PartBody").build(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java index e4b8e298ba1..4709a4bf4a6 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java @@ -28,13 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Characterization tests pinning the exact generated C++ text for every supported - * protocol, so that changes to the model renderers or their {@link ProtocolTraits} - * strategies cannot silently alter generated output. - * - *

A failure here means generated output changed. Unless the change is intentional, - * fix the production code rather than the assertion; if it is intentional, update the - * assertion in the same commit that changes the renderer. + * Characterization tests pinning the exact generated C++ text for every supported protocol, so + * changes to the renderers or their {@link ProtocolTraits} strategies cannot silently alter output. + * A failure means generated output changed: fix the production code, or update the assertion in the + * same commit if the change is intentional. */ class ProtocolTraitsCharacterizationTest { @@ -72,8 +69,7 @@ private static Model modelFor(Protocol p) { .id("com.example#Nested") .addMember("value", str.getId()) .build(); - // Input carries a plain member, an httpHeader member, and an httpQuery member so - // both request Axis-1 predicates (header + query) fire. + // Input carries plain + httpHeader + httpQuery members so both request predicates fire. StructureShape.Builder inputBuilder = StructureShape.builder() .id("com.example#DoThingInput") .addMember("name", str.getId()) @@ -93,9 +89,8 @@ private static Model modelFor(Protocol p) { .id("com.example#DoThingOutput$status").target(intShape.getId()) .addTrait(new software.amazon.smithy.model.traits.HttpResponseCodeTrait()).build()) .build(); - // SupportsPresigningTransform stamps every query/ec2 OPERATION; mirror it in the fixture so - // this end-to-end characterization pins the same post-transform output (protected - // DumpBodyToUrl decl + protocol-specific impl). + // SupportsPresigningTransform stamps every query/ec2 operation; mirror it so this pins the + // same post-transform output (protected DumpBodyToUrl decl + protocol-specific impl). OperationShape.Builder opBuilder = OperationShape.builder() .id("com.example#DoThing") .input(input.getId()) @@ -500,8 +495,7 @@ private static String stripIndent(String s) { @EnumSource(value = Protocol.class, names = {"QUERY_XML", "EC2"}) void queryLikeResultHeader_noBlankBeforeHttpResponseCodeWhenNoRequestId(Protocol p) { // Without a top-level m_requestId, the last data member is followed directly by - // m_HttpResponseCode (no intervening blank line), matching C2J. The fixture's last - // result member is the @httpResponseCode int "status". + // m_HttpResponseCode (no blank line), matching C2J. String h = stripIndent(file(p, "DoThingResult.h")); assertTrue(h.contains("int m_status{0};\nAws::Http::HttpResponseCode m_HttpResponseCode;"), h); } @@ -518,9 +512,8 @@ void nonQueryResultHeader_blankLinePrecedesRequestId(Protocol p) { @ParameterizedTest @EnumSource(value = Protocol.class, names = {"QUERY_XML", "EC2"}) void queryLikeResultHeader_omitsAWSStringWhenNoStringMemberOrRequestId(Protocol p) { - // With no top-level m_requestId and no string-typed member, the Query/EC2 result header - // has no Aws::String use and must not include AWSString.h, matching C2J include hygiene. - // (The fixture DoThingOutput has only a nested struct + httpResponseCode int member.) + // With no top-level m_requestId and no string-typed member, the Query/EC2 result header has + // no Aws::String use and must not include AWSString.h, matching C2J. String h = file(p, "DoThingResult.h"); assertFalse(h.contains("AWSString.h"), h); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 10638077b1f..4622ddb31d8 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -162,11 +162,7 @@ private static Model supportsPresigningModel(boolean marked) { return Model.builder().addShapes(str, input, output, op, service).build(); } - /** - * A presignable operation whose input is the shared {@code smithy.api#Unit} (no {@code input(...)} - * set) — the case that broke: the input shape cannot carry the trait, but the operation can, so - * the decl must still be emitted. Mirrors an IAM-style query op like {@code GetAccountSummary}. - */ + /** Presignable op with a shared {@code smithy.api#Unit} input: the input can't carry the trait but the operation can, so the decl must still emit (IAM-style query op). */ private static Model supportsPresigningUnitInputModel() { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape output = StructureShape.builder() @@ -177,9 +173,8 @@ private static Model supportsPresigningUnitInputModel() { .build(); ServiceShape service = ServiceShape.builder().id("com.example#Example") .version("2024-01-01").addOperation(op.getId()).build(); - // Assemble (not Model.builder) so the smithy.api#Unit prelude shape exists: the operation has - // no input, so its input target defaults to Unit, which ShapeClassifier resolves to build the - // request. Unit must be present in the model for the request class to be emitted. + // Assemble (not Model.builder) so the smithy.api#Unit prelude shape exists: the op defaults + // its input to Unit, which must be present for the request class to be emitted. return Model.assembler().addShapes(str, output, op, service).assemble().unwrap(); } @@ -229,9 +224,8 @@ void streamingResponseRequest_hasEventStreamAugmentation() { "Missing decoder include: " + h); assertFalse(h.contains("IsEventStreamRequest"), "Response-only op must not declare IsEventStreamRequest: " + h); - // Mainline ordering: handler/decoder sit AFTER the data members and BEFORE the - // HasBeenSet flags (not at the top of the private block). Target the member - // DECLARATION ("DoStreamHandler m_handler;"), not the public getter body. + // Mainline ordering: handler/decoder sit after data members and before HasBeenSet flags. + // Target the member DECLARATION ("DoStreamHandler m_handler;"), not the public getter body. int dataMember = h.indexOf("Aws::String m_name;"); int handlerDecl = h.indexOf("DoStreamHandler m_handler;"); int firstFlag = h.indexOf("HasBeenSet = false;"); @@ -252,10 +246,8 @@ void bidirectionalRequest_alsoHasIsEventStreamRequest() { @Test void bidirectionalRequest_rendersEventStreamInputMemberAsSharedPtr() { - // C2J renders a request with an event-stream (input) member specially: an inline empty - // SerializePayload, a GetBody() override returning the encoded IOStream, and the member - // itself as a std::shared_ptr with a collision-renamed getter (GetMemberBody, - // because GetBody is reserved). The member has no templated setter and stores a shared_ptr. + // C2J renders an event-stream (input) member specially: inline empty SerializePayload, a + // GetBody() override, and the member as shared_ptr with a renamed getter (GetMemberBody). String h = renderRequestHeaderForStreamingOp(true, true); assertTrue(h.contains("#include "), "Missing include: " + h); assertTrue(h.contains("Aws::String SerializePayload() const override { return {}; }"), @@ -281,15 +273,13 @@ void bidirectionalRequest_rendersEventStreamInputMemberAsSharedPtr() { @Test void bidirectionalRequestSource_definesGetBody() { - // The header declares `std::shared_ptr GetBody() const override;`, so the - // source MUST define it (returning the event-stream member) or linking fails. Matches C2J - // StreamRequestSource.vm. + // Header declares GetBody() const override, so the source MUST define it (returning the + // event-stream member) or linking fails. Matches C2J StreamRequestSource.vm. String c = renderStreamingOp(true, true, "DoStreamRequest.cpp"); assertTrue(c.contains( "std::shared_ptr DoStreamRequest::GetBody() const { return m_body; }"), "Bidirectional request source must define GetBody() returning the event-stream member: " + c); - // C2J's event-stream request source pulls AmazonWebServiceResult.h and the Stream/Aws - // usings rather than the JSON serde header. + // C2J's event-stream request source pulls AmazonWebServiceResult.h + Stream/Aws usings, not JSON serde. assertTrue(c.contains("#include "), c); assertTrue(c.contains("using namespace Aws::Utils::Stream;"), c); } @@ -324,10 +314,8 @@ private static Model queryMemberModel() { } /** - * Request headers must NOT include {@code } even when they declare - * URI-taking methods: the base {@code AmazonWebServiceRequest.h} forward-declares - * {@code Aws::Http::URI}, which suffices for a reference parameter, and C2J omits the - * include. Emitting it would break byte-parity with the C2J output. + * Request headers must NOT include {@code }: the base + * {@code AmazonWebServiceRequest.h} forward-declares {@code Aws::Http::URI}, and C2J omits it. */ @Test void requestWithQueryMember_doesNotIncludeUriHeader() { @@ -387,10 +375,8 @@ private static String renderRawStreamingPayloadRequest(String fileSuffix) { @Test void rawStreamingPayloadRequest_usesStreamingBaseClassAndDropsPayloadMembers() { - // C2J: a request with a raw streaming @httpPayload member derives from - // StreamingRequest, which supplies GetBody/SetBody and GetContentType/SetContentType. - // The payload member (body) and the contentType member are stripped, and SerializePayload - // is not emitted (the base handles the body). Other members (modelId) remain. + // C2J: a raw streaming @httpPayload request derives from StreamingRequest (supplies + // GetBody/GetContentType); the body + contentType members and SerializePayload are dropped. String h = renderRawStreamingPayloadRequest("DoStreamRequest.h"); assertTrue(h.contains("class DoStreamRequest : public StreamingExampleRequest {"), "Must derive from StreamingExampleRequest: " + h); @@ -428,11 +414,7 @@ void rawStreamingPayloadRequestSource_usesStreamIncludesNotJsonSerde() { "Streaming-payload request source must not use the Json namespace: " + c); } - /** - * Same as {@link #rawStreamingPayloadRequestModel()} but under REST-JSON, where {@code contentType} - * (stripped, supplied by the streaming base) is the ONLY header-bound member and - * {@code hasTargetHeader()} is false. This is the combination that exposes header/source drift. - */ + /** Like {@link #rawStreamingPayloadRequestModel()} but REST-JSON, where the stripped {@code contentType} is the only header-bound member ({@code hasTargetHeader()} false) — exposes header/source drift. */ private static Model rawStreamingPayloadRestJsonRequestModel() { StringShape str = StringShape.builder().id("com.example#String").build(); software.amazon.smithy.model.shapes.BlobShape blob = @@ -477,11 +459,7 @@ private static String renderRawStreamingPayloadRestJsonRequest(String fileSuffix // --- @httpChecksum --- - /** - * A JSON operation with @httpChecksum. The input carries a {@code checksumAlgorithm} enum member - * (for requestAlgorithmMember) and a {@code checksumMode} enum member (for - * requestValidationModeMember); the trait is configured from the given values. - */ + /** JSON op with @httpChecksum; input carries {@code checksumAlgorithm} and {@code checksumMode} enum members. */ private static Model httpChecksumModel(software.amazon.smithy.aws.traits.HttpChecksumTrait trait) { StringShape str = StringShape.builder().id("com.example#String").build(); software.amazon.smithy.model.shapes.EnumShape algo = @@ -575,10 +553,8 @@ void httpChecksumRequestChecksumRequired_rendersInlineOverride() { @Test void httpChecksumRequired_rendersInlineShouldComputeContentMd5() { - // The legacy smithy.api#httpChecksumRequired trait (s3control uses it) requests a - // Content-MD5 header. C2J derives Shape.computeContentMd5 from it and emits an inline - // ShouldComputeContentMd5() override (RequestHeader.vm:105-108, no .cpp body). Distinct - // from the flexible @httpChecksum trait. + // The legacy smithy.api#httpChecksumRequired trait (s3control) emits an inline + // ShouldComputeContentMd5() override (no .cpp body); distinct from the flexible @httpChecksum. StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape input = StructureShape.builder().id("com.example#PutThingInput") .addMember("name", str.getId()).build(); @@ -628,11 +604,7 @@ void requestWithoutHttpChecksum_emitsNoChecksumMethods() { // --- @requestCompression --- - /** - * Model for a JSON operation carrying {@code @requestCompression(encodings: ["gzip"])} on - * either a plain input (streaming = false) or a raw {@code @httpPayload} blob body input - * (streaming = true). - */ + /** JSON op with {@code @requestCompression(encodings: ["gzip"])} on a plain input (streaming=false) or a raw {@code @httpPayload} blob body (streaming=true). */ private static Model requestCompressionModel(boolean streaming, java.util.List encodings) { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape.Builder input = StructureShape.builder().id("com.example#PutThingInput"); @@ -683,10 +655,8 @@ private static String renderCompressionRequest(boolean streaming, String fileSuf @Test void requestCompressionGzip_headerDeclaresGuardedVirtualOverride() { - // C2J's RequestHeader.vm:148-156 emits GetSelectedCompressionAlgorithm as a virtual override - // gated by ENABLED_ZLIB_REQUEST_COMPRESSION. The types (CompressionAlgorithm, - // RequestCompressionConfig) come from the base AmazonWebServiceRequest.h transitively — - // NO extra include in the request header. + // C2J emits GetSelectedCompressionAlgorithm as a virtual override gated by + // ENABLED_ZLIB_REQUEST_COMPRESSION; its types come from the base transitively (no extra include). String h = renderCompressionRequest(false, "PutThingRequest.h"); assertTrue(h.contains("#ifdef ENABLED_ZLIB_REQUEST_COMPRESSION"), "Missing ENABLED_ZLIB_REQUEST_COMPRESSION guard: " + h); @@ -699,10 +669,8 @@ void requestCompressionGzip_headerDeclaresGuardedVirtualOverride() { @Test void requestCompressionGzip_nonStreamingSourceUsesBodySizeCheck() { - // Non-streaming variant (ModelClassRequiredCompression.vm): DISABLE -> NONE, then read the - // already-serialized body via AmazonSerializableWebServiceRequest::GetBody(), compare its - // size to config.requestMinCompressionSizeBytes, and either NONE or GZIP. Matches cloudwatch - // PutMetricDataRequest.cpp exactly. Body only touches base state; NOT serde-blocked. + // Non-streaming variant: DISABLE -> NONE, else compare the serialized body size to + // config.requestMinCompressionSizeBytes to pick NONE or GZIP. Matches cloudwatch PutMetricDataRequest.cpp. String c = renderCompressionRequest(false, "PutThingRequest.cpp"); assertTrue(c.contains("#ifdef ENABLED_ZLIB_REQUEST_COMPRESSION"), c); assertTrue(c.contains( @@ -772,12 +740,9 @@ void requestWithoutCompressionTrait_emitsNothingCompressionRelated() { @Test void rawStreamingPayloadRequestRestJson_headerAndSourceAgreeOnRequestSpecificHeaders() { - // Under a REST protocol (hasTargetHeader() == false), a raw-streaming-payload request whose - // ONLY header-bound member is the stripped contentType must emit GetRequestSpecificHeaders in - // NEITHER the header nor the source. The header renders from the contentType-excluded shape; - // the source MUST render from the same shape. Otherwise the source defines - // GetRequestSpecificHeaders() out-of-line for a method the header never declares (a C++ - // compile error). + // Under REST (hasTargetHeader()==false), a raw-streaming-payload request whose only + // header-bound member is the stripped contentType must emit GetRequestSpecificHeaders in neither + // header nor source, else the source defines a method the header never declares (compile error). String h = renderRawStreamingPayloadRestJsonRequest("DoStreamRequest.h"); String c = renderRawStreamingPayloadRestJsonRequest("DoStreamRequest.cpp"); assertFalse(h.contains("GetRequestSpecificHeaders"), @@ -831,9 +796,8 @@ private static String renderOperationContextRequest(Model model, String fileSuff @Test void operationContextParams_headerDeclaresGetters() { - // An operation carrying only smithy.rules#operationContextParams must produce both the - // GetEndpointContextParams() virtual override and the GetOperationContextParams() accessor - // in its request header. Fails on main because RequestRenderer ignores the trait. + // An op carrying only smithy.rules#operationContextParams must emit both GetEndpointContextParams() + // and GetOperationContextParams() in its request header. String h = renderOperationContextRequest(operationContextParamsOnlyModel(), "DoBatchRequest.h"); assertTrue(h.contains("EndpointParameters GetEndpointContextParams() const override;"), "Missing GetEndpointContextParams decl: " + h); @@ -983,11 +947,7 @@ void operationContextParams_multiSelectFlattenPattern_endToEnd() { // --- aws.auth#unsignedPayload (SignBody) --- - /** - * Operation carrying {@code aws.auth#unsignedPayload}. When {@code emptyInput} is false the input - * has a member; when true the input has none (exercises the {@code !members.isEmpty()} guard). - * When {@code marked} is false the trait is omitted. - */ + /** Op with {@code aws.auth#unsignedPayload} ({@code marked}); {@code emptyInput} toggles a member to exercise the {@code !members.isEmpty()} guard. */ private static Model unsignedPayloadModel(boolean marked, boolean emptyInput) { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape.Builder inB = StructureShape.builder().id("com.example#DoThingRequest"); @@ -1089,9 +1049,8 @@ private static Model longPollingModel(boolean marked) { @Test void longPollingTrait_emitsIsLongPollingOperationTrue() { - // C2J RequestHeader.vm emits IsLongPollingOperation() -> true for a long-polling request - // (gated on $operation.longPolling); the marker (stamped by LongPollingTransform) drives the - // same override here. + // C2J emits IsLongPollingOperation() -> true for a long-polling request; the marker (stamped + // by LongPollingTransform) drives the same override here. String h = renderDoThingRequestHeader(longPollingModel(true)); assertTrue(h.contains("bool IsLongPollingOperation() const override { return true; }"), "LongPollingTrait must emit the IsLongPollingOperation override: " + h); @@ -1100,8 +1059,7 @@ void longPollingTrait_emitsIsLongPollingOperationTrue() { @Test void longPollingTrait_emittedWithTopIdentityMethods() { // Ordering: IsLongPollingOperation sits with the top identity methods (after - // GetServiceRequestName, before SerializePayload), NOT down with the SignBody/IsChunked - // block. Matches C2J RequestHeader.vm lines 57-64. + // GetServiceRequestName, before SerializePayload), not the SignBody/IsChunked block. String h = renderDoThingRequestHeader(longPollingModel(true)); int requestName = h.indexOf("GetServiceRequestName"); int longPolling = h.indexOf("IsLongPollingOperation"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java index 7f01064501c..c543526c953 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ResultRendererTest.java @@ -92,8 +92,7 @@ void ec2Result_usesResponseSuffix() { @Test void cborResult_omitsHasBeenSetAccessors() { // C2J's CborResultHeader.vm sets useRequiredField=false, so result classes never emit - // HasBeenSet() accessors — same as every other protocol. (Only sub-object and request - // headers set useRequiredField=true.) + // HasBeenSet() accessors (only sub-object and request headers do). String h = renderResultHeader(software.amazon.smithy.protocol.traits.Rpcv2CborTrait.builder().build()); assertFalse(h.contains("HasBeenSet() const"), h); } @@ -306,9 +305,8 @@ void statusCodeMember_setFromResponseCode() { } /** - * A one-member rest-xml output operation whose output structure optionally carries the internal - * {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.TopLevelHostIdTrait} - * marker (as {@code S3ControlTransforms} stamps it). + * A one-member rest-xml output whose output structure optionally carries the internal + * {@link com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.TopLevelHostIdTrait} marker. */ private static Model hostIdResultModel(boolean marked) { StringShape str = StringShape.builder().id("com.example#Str").build(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ServiceNameUtilTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ServiceNameUtilTest.java index ecbf42c2093..9d8e5ba74de 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ServiceNameUtilTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ServiceNameUtilTest.java @@ -32,14 +32,12 @@ void capitalize_singleChar() { @Test void getExportMacro_standardService() { - // Test the export macro format follows AWS_{SERVICE_NAME}_API pattern - // We test it indirectly through the capitalize logic it uses + // Export macro is AWS_{SERVICE_NAME}_API; exercised indirectly via the capitalize logic it uses. assertEquals("Kinesis", ServiceNameUtil.capitalize("kinesis")); } @Test void getProjectName_standardService() { - // Test the project name format (lowercase hyphenated) - // This would require a full ServiceShape which is tested separately + // Project name format (lowercase hyphenated) needs a full ServiceShape; covered separately. } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java index 42517bc1492..58526386d4a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifierTest.java @@ -424,13 +424,7 @@ void noInputOperation_stillProducesRequest() { "Expected a RequestInfo for the no-input operation Ping"); } - /** - * A structure that is BOTH an operation output AND referenced as a member (via a list - * element). Mirrors Lambda's FunctionConfiguration, which is the output of - * GetFunctionConfiguration and also the element of FunctionList / a member of another - * response. Such a dual-role shape must end up in BOTH results (per-op output) and - * subObjects (standalone model file), matching C2J. - */ + /** Structure that is both an operation output and a list-element member (dual-role, like Lambda FunctionConfiguration); must end up in both results and subObjects. */ private Model buildDualRoleModel() { StringShape str = StringShape.builder().id("com.example#String").build(); // Thing is the output of GetThing AND the element of ThingList. @@ -503,12 +497,7 @@ void outputOnly_appearsInResultsButNotSubObjects() { "Output-only GetItemResponse must NOT be over-emitted as a sub-object: " + classified.subObjects()); } - /** - * A @streaming union with two event members: one whose sole payload is an @eventPayload blob - * (like Lambda's InvokeResponseStreamUpdate / the PayloadChunk member) and one with only a - * plain string member (like a CompleteEvent). Bound to an operation output so both event - * structs are reachable. - */ + /** @streaming union with an @eventPayload-blob event and a plain-string event, bound to an operation output so both are reachable. */ private Model eventStreamBlobPayloadModel() { StringShape str = StringShape.builder().id("com.example#String").build(); BlobShape blob = BlobShape.builder().id("com.example#Blob").build(); @@ -571,12 +560,7 @@ void nonBlobEvent_staysSubObject() { "Non-blob event struct must NOT be a blob-payload event: " + classified.blobPayloadEvents()); } - /** - * A service whose operation input references two structs: one marked {@link CustomRenderedTrait} - * (owned by a dedicated renderer) and one plain. The classifier's generic marker rule must drop - * the marked one from subObjects while keeping the plain one — for any service, not just - * dynamodb. - */ + /** Operation input references two structs, one marked {@link CustomRenderedTrait} and one plain; the marker rule drops the marked one from subObjects for any service. */ private Model modelWithCustomRenderedShape() { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape marked = StructureShape.builder() @@ -617,12 +601,7 @@ void customRenderedShape_isExcludedFromSubObjects() { "unmarked shape must remain a sub-object: " + classified.subObjects()); } - /** - * A @streaming union with two event members: one empty-member event (like S3's - * ContinuationEvent / EndEvent, referenced by nothing after EventStreamRenderer's void() - * callback fix) and one data event carrying a string member. Bound to an operation output so - * both event structs are reachable. - */ + /** @streaming union with an empty-member event (like S3 ContinuationEvent) and a string data event, bound to an operation output so both are reachable. */ private Model eventStreamEmptyAndDataModel() { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape emptyEvt = StructureShape.builder() @@ -668,9 +647,8 @@ void classifyDropsEmptyMemberEventStructFromSubObjects() { @Test void classifyDropsIncomingEventStreamUnionFromSubObjects() { - // The @streaming union bound to an operation output (an incoming event stream) is realized - // via the generated handler; nothing references the union as a data type, so it must not be - // emitted as a standalone sub-object header. + // The @streaming union bound to an output (incoming event stream) is realized via the + // generated handler; nothing references it as a data type, so no standalone sub-object header. Model model = eventStreamEmptyAndDataModel(); ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); var classified = ShapeClassifier.classify(model, service, ProtocolResolver.resolve(service, model)); @@ -681,9 +659,8 @@ void classifyDropsIncomingEventStreamUnionFromSubObjects() { @Test void deprecatedOperation_inputAndOutputExcludedFromRequestsAndResults() { - // Legacy C2J drops @deprecated operations entirely, so their orphaned request/result structs - // are never emitted. The classifier must not put a @deprecated op's input in requests nor its - // output in results, while a live op's input/output are present. + // Legacy C2J drops @deprecated operations entirely; the classifier must keep a @deprecated + // op's input/output out of requests/results while a live op's are present. StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape deprecatedRequest = StructureShape.builder() .id("com.example#DeprecatedRequest").addMember("id", str.getId()).build(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java index 6bd4b31f34e..01bfb42a133 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java @@ -26,19 +26,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Verifies that {@link SubObjectRenderer} renders C2J-style union shapes. In C2J a union is a - * {@code structure} with {@code "union": true} and is emitted by the same ModelClass templates - * as a plain structure (serde decls + per-member Get/Set/With/HasBeenSet accessors + private - * data members and flags). Non-streaming unions must produce header + source files; {@code - * @streaming} unions belong to the event-stream renderers and must be skipped here. + * Verifies {@link SubObjectRenderer} renders C2J-style union shapes like plain structures (serde + * decls + per-member accessors + private members). Non-streaming unions produce header + source; + * {@code @streaming} unions belong to the event-stream renderers and are skipped here. */ class SubObjectRendererTest { - /** - * A model with a plain structure sub-object, a non-streaming union, and a {@code @streaming} - * union — mirroring bedrock-runtime (ContentBlock / ToolChoice are data unions; - * InvokeModelWithBidirectionalStreamInput is a streaming union). - */ + /** Plain structure sub-object, a non-streaming data union, and a {@code @streaming} union (mirrors bedrock-runtime). */ private static Model model() { StringShape str = StringShape.builder().id("com.example#Str").build(); StructureShape leaf = StructureShape.builder() @@ -59,13 +53,11 @@ private static Model model() { .addTrait(new StreamingTrait()) .addMember("chunk", leaf.getId()) .build(); - // Memberless structure (e.g. bedrock-runtime AnyToolChoice / AutoToolChoice): C2J emits - // no private: section when the shape has no members. + // Memberless structure (e.g. bedrock-runtime AnyToolChoice): C2J emits no private: section. StructureShape empty = StructureShape.builder() .id("com.example#AnyToolChoice") .build(); - // Union with a blob member (e.g. bedrock-runtime AudioSource): its source needs - // HashingUtils.h for Base64 blob serde. + // Union with a blob member (e.g. bedrock-runtime AudioSource): source needs HashingUtils.h for Base64 serde. software.amazon.smithy.model.shapes.BlobShape blob = software.amazon.smithy.model.shapes.BlobShape.builder().id("com.example#PartBody").build(); UnionShape blobUnion = UnionShape.builder() @@ -120,7 +112,6 @@ void nonStreamingUnion_headerHasSerdeDeclsAndPerMemberAccessors() { assertTrue(h.contains("AWS_EXAMPLE_API ContentBlock() = default;"), h); assertTrue(h.contains("AWS_EXAMPLE_API ContentBlock(Aws::Utils::Json::JsonView jsonValue);"), h); assertTrue(h.contains("AWS_EXAMPLE_API Aws::Utils::Json::JsonValue Jsonize() const;"), h); - // Per-member accessors for each variant. assertTrue(h.contains("GetText") && h.contains("SetText") && h.contains("WithText"), h); assertTrue(h.contains("GetLeaf") && h.contains("SetLeaf") && h.contains("WithLeaf"), h); assertTrue(h.contains("bool m_textHasBeenSet = false;"), h); @@ -140,8 +131,7 @@ void nonStreamingUnion_sourceHasSerdeImpls() { @Test void blobMemberSource_includesHashingUtils() { - // A sub-object with a blob member needs HashingUtils.h in its source (Base64 blob serde), - // matching C2J's computeSourceIncludes. The header must NOT carry it (source-only include). + // Blob member needs HashingUtils.h in source (Base64 serde, C2J computeSourceIncludes); header must not carry it. java.util.Map files = renderAll(); String c = files.get("AudioSource.cpp"); assertTrue(c.contains("#include "), @@ -153,9 +143,8 @@ void blobMemberSource_includesHashingUtils() { @Test void memberlessShape_omitsPrivateSection() { - // C2J emits the private: section only when the shape has members - // (ModelClassMembersAndInlines.vm: `#if($shape.members.size() > 0 ...`). A memberless - // sub-object ends right after its serde decls — no trailing blank line and no private:. + // C2J emits private: only when the shape has members; a memberless sub-object ends right + // after its serde decls with no private: section. String h = renderAll().get("AnyToolChoice.h"); assertTrue(h.contains("AWS_EXAMPLE_API Aws::Utils::Json::JsonValue Jsonize() const;"), h); assertFalse(h.contains("private:"), @@ -173,17 +162,12 @@ void streamingUnion_isNotRenderedBySubObjectRenderer() { // --- dual-role (operation output that is also a member) requestId stamp --- - /** - * A model where {@code Thing} is BOTH the output of {@code DoThing} AND a member of {@code Plain} - * (dual-role: an output referenced as a member). {@code Plain} is a plain member-only sub-object. - * The service carries the given protocol trait. - */ + /** {@code Thing} is both the output of {@code DoThing} and a member of {@code Plain} (dual-role); {@code Plain} is member-only. */ private static Model dualRoleModel(Trait protocolTrait) { StringShape str = StringShape.builder().id("com.example#Str").build(); StructureShape thing = StructureShape.builder() .id("com.example#Thing").addMember("name", str.getId()).build(); - // Plain references Thing (making Thing a member target) and is itself a member of the input, - // so both Plain and Thing are reachable sub-objects; only Thing is an operation output. + // Both Plain and Thing are reachable sub-objects; only Thing is an operation output. StructureShape plain = StructureShape.builder() .id("com.example#Plain") .addMember("label", str.getId()) @@ -241,8 +225,7 @@ void memberOnlySubObject_jsonProtocol_hasNoRequestId() { @Test void dualRoleOutput_queryProtocol_hasNoRequestId() { - // Query/EC2 dual-role outputs get a ResponseMetadata member instead (injectResponseMetadata), - // so resultHasTopLevelRequestId() is false and no requestId block is stamped here. + // Query/EC2 dual-role outputs get ResponseMetadata instead, so no requestId block is stamped. String h = renderDualRole( new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait()).get("Thing.h"); assertFalse(h.contains("GetRequestId"), diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java index c178d0abb85..04506885b12 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java @@ -54,7 +54,6 @@ void transformReceivesOutputOfPrevious() { .build(); ServiceShape service = original.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); - // First transform adds a new shape Model withExtra = original.toBuilder() .addShape(ServiceShape.builder().id("com.example#Extra").version("2024-01-01").build()) .build(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 0a436e66646..1e4755a7763 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -212,9 +212,8 @@ void restJson_headerMember_isWireSerialized() { @Test void restJson_additionalHeadersTrait_emitsConstantHeaderBeforeMemberHeaders() { - // A streaming request marked with AdditionalRequestHeadersTrait (Glacier's - // x-amz-glacier-version) emits the constant header inside GetRequestSpecificHeaders, - // ordered after any X-Amz-Target and before the member-driven headers (StreamRequestSource.vm). + // A request with AdditionalRequestHeadersTrait (Glacier's x-amz-glacier-version) emits the + // constant header in GetRequestSpecificHeaders, after X-Amz-Target and before member headers. var req = reqWith(true, false).toBuilder() .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms .AdditionalRequestHeadersTrait(java.util.Map.of("x-amz-glacier-version", "2012-06-01"))) @@ -247,9 +246,8 @@ void restJson_queryMember_isWireSerialized() { @Test void supportsPresigning_emitsDumpBodyToUrlStubImpl() { - // A presignable operation (Polly SynthesizeSpeech) carries SupportsPresigningTrait on the - // OPERATION; the decl is emitted by RequestRenderer, and JsonProtocolTraits supplies a stub - // impl (gated on the same operation trait) that defers serde. + // A presignable op (Polly SynthesizeSpeech) carries SupportsPresigningTrait; RequestRenderer + // emits the decl, JsonProtocolTraits supplies a stub impl (same trait) that defers serde. var req = reqWith(false, false); var model = modelWith(req); String i = render(w -> restJson.writeRequestMethodImpls( w, "SynthesizeSpeechRequest", req, opDoThingPresigning(), svcAthena(), model)); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java index e9a42e13787..42fe60411dc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsIncludeSetTest.java @@ -49,9 +49,8 @@ void queryXml_subobjectHeader_hasStreamFwd() { @Test void requestSource_everyProtocolIncludesNumericForListHeaderAccumulate() { - // RequestHeaderSerializer emits std::accumulate for list-typed @httpHeader members and is - // protocol-agnostic, so every protocol's REQUEST_SOURCE must declare . Guards the - // JSON/QueryXml regression where only RestXml carried it (relying on transitive includes). + // RequestHeaderSerializer emits std::accumulate for list-typed @httpHeader members (protocol- + // agnostic), so every protocol's REQUEST_SOURCE must declare . Guards a JSON/QueryXml regression. for (ProtocolTraits t : List.of( new JsonProtocolTraits(Protocol.JSON), new JsonProtocolTraits(Protocol.REST_JSON), diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsSerdeTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsSerdeTest.java index 39a7858d7bd..ae96eb2b59e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsSerdeTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsSerdeTest.java @@ -15,9 +15,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Pins the invariant that the event- and error-payload stubs stay protocol-agnostic - * for EVERY protocol -- they are {@code default} methods on {@link ProtocolTraits} and - * no implementation should override them with protocol-specific text until + * Pins that event- and error-payload stubs stay protocol-agnostic for EVERY protocol: {@code default} + * methods on {@link ProtocolTraits} that no impl overrides with protocol-specific text until * schema-based serde lands. */ class ProtocolTraitsSerdeTest { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsStreamingPayloadTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsStreamingPayloadTest.java index 76be69124d0..5ae6596afae 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsStreamingPayloadTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraitsStreamingPayloadTest.java @@ -21,11 +21,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * C2J gates {@code SerializePayload()} on {@code !hasStreamMembers()} in the single shared - * {@code RequestHeader.vm}, so the rule is protocol-agnostic: no protocol emits SerializePayload - * for a request with a raw streaming {@code @httpPayload} member. These tests pin that every - * {@link ProtocolTraits} implementation honours it (and still emits SerializePayload for a plain - * request). + * C2J gates {@code SerializePayload()} on {@code !hasStreamMembers()}, so the rule is protocol-agnostic: + * no protocol emits it for a raw streaming {@code @httpPayload} request. Pins that every + * {@link ProtocolTraits} honours this (and still emits SerializePayload for a plain request). */ class ProtocolTraitsStreamingPayloadTest { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index ee64dda0c18..a9778cae485 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -24,10 +24,8 @@ private static String render(java.util.function.Consumer body) { } /** - * Renders inside a simulated class body (indent level 1), matching how request-method - * declarations are emitted by {@code RequestRenderer}. Query/EC2 decls open with a - * {@code dedent()} for the {@code protected:} sandwich, which requires a non-zero - * starting indent. + * Renders at indent level 1, as {@code RequestRenderer} emits request-method decls. Query/EC2 + * decls open with a {@code dedent()} for the {@code protected:} sandwich, needing a non-zero indent. */ private static String renderInClassBody(java.util.function.Consumer body) { CppWriter writer = new CppWriter(); @@ -279,9 +277,8 @@ void restXml_withoutEmbeddedErrorsTrait_omitsHasEmbeddedError() { @Test void queryXml_serializePayloadAndDumpBodyToUrlImpl() { - // The DumpBodyToUrl DECL is emitted protocol-agnostically by RequestRenderer (gated on the - // operation's SupportsPresigningTrait), so the query traits' decls no longer carry it; the - // IMPL is here and now gated on the SAME operation trait so decl+impl stay symmetric. + // DumpBodyToUrl DECL is emitted by RequestRenderer (gated on SupportsPresigningTrait), not the + // query traits; the IMPL is here, gated on the SAME operation trait so decl+impl stay symmetric. var req = reqWith(false, false); var model = modelWith(req); ProtocolTraits q = new QueryXmlProtocolTraits(Protocol.QUERY_XML); String d = renderInClassBody(w -> q.writeRequestMethodDecls(w, "AWS_EX_API", req, opDoThingPresigning(), model)); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java index 9de7100e3f7..d0150f6d619 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/endpointcontext/SmithyEndpointsJmesPathVisitorTest.java @@ -143,9 +143,8 @@ void multiSelectListFlattenPattern() { @Test void unsupportedNode_throws() { - // A JMESPath expression exercising an unsupported node (filter projection) must throw - // UnsupportedOperationException, inherited from UnsupportedExpressionVisitor: fail fast - // on unrecognized constructs. + // An unsupported node (filter projection) must throw UnsupportedOperationException (from + // UnsupportedExpressionVisitor): fail fast on unrecognized constructs. StructureShape input = StructureShape.builder() .id("com.example#Req").addMember("x", ShapeId.from(STR)).build(); Model model = Model.builder().addShapes(str(), input).build(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java index 899681f7f22..225c674c4a7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java @@ -20,12 +20,10 @@ /** * Verifies {@link DynamoDbTransforms} stamps {@link CustomRenderedTrait} onto DynamoDB's - * {@code AttributeValue} shape and is a no-op for other services / absent shapes. - * - *

Also serves as the empirical proof that Smithy accepts an in-memory trait instance - * with a synthetic, undefined id ({@code aws.cpp.internal#customRendered}) added inside a transform - * via {@code shapeToBuilder().addTrait(...)} + {@code model.toBuilder().build()} — no model-level - * trait definition required, because that build path does not run trait-definition validation. + * {@code AttributeValue} and is a no-op for other services / absent shapes. Also proves Smithy + * accepts an in-memory trait instance with a synthetic, undefined id via + * {@code shapeToBuilder().addTrait(...)} + {@code model.toBuilder().build()} — that build path skips + * trait-definition validation. */ class DynamoDbTransformsTest { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java index 0f0e352e7c9..442a7188edf 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java @@ -135,7 +135,6 @@ void modelsUserDataAsSensitiveSecureBlobAttributeValue() { assertTrue(valueTarget.hasTrait(SensitiveTrait.class), "the blob must be @sensitive so it renders as CryptoBuffer"); - // UserData is repointed to SecureBlobAttributeValue. MemberShape userData = out.expectShape( ShapeId.from("com.example#ModifyInstanceAttributeRequest"), StructureShape.class) .getAllMembers().get("UserData"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java index 49c31744cf5..def0b08b431 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java @@ -47,7 +47,6 @@ void removesInvokeAsyncOperationAndShapes() { assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsync")).isEmpty()); assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsyncRequest")).isEmpty()); assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsyncResult")).isEmpty()); - // Invoke and its shapes are untouched assertTrue(out.getShape(ShapeId.from("com.example#Invoke")).isPresent()); assertTrue(out.getShape(ShapeId.from("com.example#InvocationRequest")).isPresent()); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 9879cc9a88e..89e52711383 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -103,11 +103,7 @@ void copyObjectResultRename_throwsOnCollision() { assertThrows(IllegalStateException.class, () -> S3Transforms.asTransform().apply(m, svc)); } - /** - * Builds an S3 model with a single PutObject-style operation whose input and output both - * carry an {@code Expires} member (initially a {@code string}, matching the current model), - * mirroring the operation-wiring pattern in {@code AccessAnalyzerTransformsTest}. - */ + /** PutObject-style op whose input and output both carry a {@code string} {@code Expires} member. */ private static Model expiresModel() { Shape expires = StringShape.builder().id(NS + "#Expires").build(); StructureShape input = StructureShape.builder().id(NS + "#PutObjectRequest") @@ -141,7 +137,6 @@ void retypesExpiresShapeToTimestamp() { Model out = S3Transforms.asTransform().apply(m, expiresService(m)); assertTrue(out.expectShape(ShapeId.from(NS + "#Expires")) instanceof TimestampShape, "Expires retyped to a timestamp shape"); - // Both input and output Expires members now target the timestamp. StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); StructureShape output = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); assertTrue(out.expectShape(input.getMember("Expires").orElseThrow().getTarget()) instanceof TimestampShape); @@ -149,9 +144,8 @@ void retypesExpiresShapeToTimestamp() { } /** - * Builds an S3 model with a ListParts-style operation whose request and result reference the - * {@code PartNumberMarker} / {@code NextPartNumberMarker} shapes as strings (matching the current - * Smithy model, where Coral2Smithy treats them as opaque pagination tokens). + * ListParts-style op whose request/result reference {@code PartNumberMarker} / + * {@code NextPartNumberMarker} as strings (Coral2Smithy treats them as opaque pagination tokens). */ private static Model partNumberMarkerModel() { Shape marker = StringShape.builder().id(NS + "#PartNumberMarker").build(); @@ -183,7 +177,6 @@ void retypesPartNumberMarkersToInteger() { "PartNumberMarker retyped to integer to preserve the shipped C2J int API"); assertTrue(out.expectShape(ShapeId.from(NS + "#NextPartNumberMarker")) instanceof IntegerShape, "NextPartNumberMarker retyped to integer to preserve the shipped C2J int API"); - // Request and result members both now resolve to integer targets. StructureShape input = out.expectShape(ShapeId.from(NS + "#ListPartsRequest"), StructureShape.class); StructureShape output = out.expectShape(ShapeId.from(NS + "#ListPartsOutput"), StructureShape.class); assertTrue(out.expectShape(input.getMember("PartNumberMarker").orElseThrow().getTarget()) instanceof IntegerShape); @@ -206,9 +199,8 @@ void marksOverrideStreamingRequests() { } /** - * Builds an S3 model with a PutObject-style request carrying the checksum members plus a - * non-checksum member; {@code withAlgorithmMember} controls whether the request also has the - * {@code ChecksumAlgorithm} member that gates the C2J customization. + * PutObject-style request with checksum members plus a non-checksum one; {@code withAlgorithmMember} + * toggles the {@code ChecksumAlgorithm} member that gates the C2J customization. */ private static Model checksumModel(boolean withAlgorithmMember) { Shape crc32 = StringShape.builder().id(NS + "#ChecksumCRC32").build(); @@ -298,7 +290,6 @@ void doesNotAddExpiresStringToInput() { @Test void appendsMissingBucketLocationConstraintRegions() { ServiceShape svc = s3Service("S3"); - // Model BucketLocationConstraint as an EnumShape with an existing region. software.amazon.smithy.model.shapes.EnumShape enumShape = software.amazon.smithy.model.shapes.EnumShape.builder() .id(NS + "#BucketLocationConstraint") @@ -386,10 +377,7 @@ void injectsGetObjectId2Only() { "ObjectRequestId shape must not be created"); } - /** - * Builds an S3 model with a single operation whose input carries two ordinary members, so the - * appended-last ordering of the injected access-log tag member can be asserted. - */ + /** Op whose input has two ordinary members, so the access-log tag's appended-last order is assertable. */ private static Model accessLogModel() { StructureShape input = StructureShape.builder().id(NS + "#PutObjectRequest") .addMember("Bucket", ShapeId.from("smithy.api#String")) @@ -425,13 +413,11 @@ void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { assertEquals("smithy.api#String", mapShape.getKey().getTarget().toString()); assertEquals("smithy.api#String", mapShape.getValue().getTarget().toString()); - // Must bind to the query string (@httpQueryParams) so RequestBindings.hasQueryStringMembers - // is true and the request emits AddQueryStringParameters — matching C2J, which renders that - // method on every request via the customizedAccessLogTag querystring member. + // Must bind @httpQueryParams so the request emits AddQueryStringParameters — matching C2J, + // which renders that method via the customizedAccessLogTag querystring member. assertTrue(tag.hasTrait(software.amazon.smithy.model.traits.HttpQueryParamsTrait.class), "customizedAccessLogTag must carry @httpQueryParams"); - // Appended after all existing members, preserving prior order. java.util.List order = new java.util.ArrayList<>(input.getAllMembers().keySet()); assertEquals(java.util.List.of("Bucket", "Key", "customizedAccessLogTag"), order, "access-log tag member appended last"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java index 5993373c131..4e41dcdb333 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java @@ -14,7 +14,7 @@ class SourceRegionTransformTest { - // Builds a single-operation service model. sdkId drives ServiceNameUtil.getSmithyServiceName. + // sdkId drives ServiceNameUtil.getSmithyServiceName. private static Model modelWithOp(String sdkId, String opName, String reqName) { StructureShape req = StructureShape.builder() .id("com.example#" + reqName) @@ -57,7 +57,6 @@ void injectsSourceRegionIntoRdsRequest() { @Test void noOpForUntargetedOperation() { - // Operation not in the RDS table -> unchanged Model m = modelWithOp("RDS", "DescribeDBClusters", "DescribeDBClustersRequest"); Model out = SourceRegionTransform.asTransform().apply(m, service(m)); assertTrue(out.expectShape(ShapeId.from("com.example#DescribeDBClustersRequest"), diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java index 849302eebaa..60196800cb1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java @@ -43,7 +43,7 @@ void addsValuesToEnumShape() { List values = EnumRenderer.getEnumValues( out.expectShape(ShapeId.from("com.example#QueueAttributeName"))); assertTrue(values.containsAll(ADDED)); - assertTrue(values.contains("All")); // originals preserved + assertTrue(values.contains("All")); } @Test diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java index e138b7e54d5..6143b4b6b0c 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java @@ -52,9 +52,8 @@ private static Model twoOpModel(Trait protocolTrait, ServiceTrait serviceTrait, } /** - * One operation with a normal input and one operation with NO input (its input target defaults to - * {@code smithy.api#Unit}), under a service carrying {@code protocolTrait}. Mirrors an IAM-style - * {@code GetAccountSummary} where the request struct is the shared {@code Unit}. + * A normal-input op plus a no-input op (input defaults to {@code smithy.api#Unit}), under a + * service with {@code protocolTrait}. Mirrors IAM {@code GetAccountSummary} (shared Unit input). */ private static Model opPlusUnitInputModel(Trait protocolTrait, String normalOp, String unitOp) { StructureShape in = StructureShape.builder().id("com.example#" + normalOp + "Request").build(); From d7522b50553c5a8e15fc3ac6d1d2f900544d0c58 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 15:10:49 -0400 Subject: [PATCH 43/53] Refactor Model transform interface. use streams over loops --- .../generators/model/ModelCodegenPlugin.java | 30 ++++++------ .../generators/model/ModelTransform.java | 25 ++++++++-- .../generators/model/ShapeClassifier.java | 33 ++++++------- .../generators/model/TransformPipeline.java | 4 +- .../model/renderers/SubObjectRenderer.java | 5 -- .../transforms/AccessAnalyzerTransforms.java | 15 +++--- .../transforms/ApiGatewayTransforms.java | 15 +++--- .../transforms/ApiGatewayV2Transforms.java | 15 +++--- .../transforms/ChunkedEncodingTransform.java | 12 ++--- .../model/transforms/DynamoDbTransforms.java | 15 +++--- .../model/transforms/Ec2Transforms.java | 15 +++--- .../model/transforms/GlacierTransforms.java | 15 +++--- .../model/transforms/GlobalTransforms.java | 14 ++++-- .../model/transforms/LambdaTransforms.java | 15 +++--- .../transforms/LongPollingTransform.java | 16 +++---- .../model/transforms/S3ControlTransforms.java | 15 +++--- .../model/transforms/S3Transforms.java | 17 +++---- .../transforms/SourceRegionTransform.java | 15 +++--- .../model/transforms/SqsTransforms.java | 15 +++--- .../SupportsPresigningTransform.java | 12 ++--- .../model/GlobalTransformsTest.java | 34 +++++++------- .../generators/model/ModelGeneratorTest.java | 8 ++-- .../ProtocolTraitsCharacterizationTest.java | 2 +- .../model/SubObjectRendererTest.java | 2 +- .../model/TransformPipelineTest.java | 42 +++++++++++++++-- .../AccessAnalyzerTransformsTest.java | 7 ++- .../transforms/ApiGatewayTransformsTest.java | 5 +- .../ApiGatewayV2TransformsTest.java | 5 +- .../ChunkedEncodingTransformTest.java | 10 ++-- .../transforms/DynamoDbTransformsTest.java | 13 ++---- .../model/transforms/Ec2TransformsTest.java | 15 +++--- .../transforms/GlacierTransformsTest.java | 16 +++---- .../transforms/LambdaTransformsTest.java | 5 +- .../transforms/LongPollingTransformTest.java | 12 ++--- .../transforms/S3ControlTransformsTest.java | 5 +- .../model/transforms/S3TransformsTest.java | 46 +++++++++---------- .../transforms/SourceRegionTransformTest.java | 15 +++--- .../model/transforms/SqsTransformsTest.java | 8 ++-- .../SupportsPresigningTransformTest.java | 10 ++-- 39 files changed, 289 insertions(+), 289 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 65905d5e67c..1c9a1a7051b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -53,21 +53,21 @@ public void execute(PluginContext context) { Map namespaceMap = parseNamespaceMap(settings); TransformPipeline pipeline = new TransformPipeline(List.of( - GlobalTransforms.asTransform(), - SourceRegionTransform.asTransform(), - LambdaTransforms.asTransform(), - SqsTransforms.asTransform(), - ApiGatewayTransforms.asTransform(), - ApiGatewayV2Transforms.asTransform(), - Ec2Transforms.asTransform(), - AccessAnalyzerTransforms.asTransform(), - DynamoDbTransforms.asTransform(), - S3Transforms.asTransform(), - S3ControlTransforms.asTransform(), - GlacierTransforms.asTransform(), - SupportsPresigningTransform.asTransform(), - ChunkedEncodingTransform.asTransform(), - LongPollingTransform.asTransform() + new GlobalTransforms(), + new SourceRegionTransform(), + new LambdaTransforms(), + new SqsTransforms(), + new ApiGatewayTransforms(), + new ApiGatewayV2Transforms(), + new Ec2Transforms(), + new AccessAnalyzerTransforms(), + new DynamoDbTransforms(), + new S3Transforms(), + new S3ControlTransforms(), + new GlacierTransforms(), + new SupportsPresigningTransform(), + new ChunkedEncodingTransform(), + new LongPollingTransform() )); CppWriterDelegator writerDelegator = new CppWriterDelegator(context.getFileManifest()); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java index 843e59563d7..105367c4451 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java @@ -10,16 +10,35 @@ /** * A model-to-model transform applied before code generation. Transforms run in sequence, * each receiving the previous transform's output (or the original model for the first). + * + *

{@link #shouldRun} is the service-level gate and defaults to {@code false}: a transform runs + * only when it explicitly opts in by overriding it — a service check, or {@code true} for transforms + * that apply to every service. This fails closed, so a transform added without a gate silently + * no-ops instead of running for every service and mutating models it was never meant to touch. When + * {@code shouldRun} returns true, {@code transform} may assume it applies and need not re-check the + * service. */ -@FunctionalInterface public interface ModelTransform { /** - * Applies this transform to the model. + * Whether this transform applies to the given service. Evaluated by the pipeline before + * {@link #transform}; a false result skips the transform. Defaults to {@code false}, so a + * transform must override this to run — either a service check or {@code true} to run always. + * + * @param service the service shape being generated + * @return true if {@link #transform} should be invoked for this service + */ + default boolean shouldRun(ServiceShape service) { + return false; + } + + /** + * Applies this transform to the model. Only invoked when {@link #shouldRun} returns true, + * so implementations need not re-check the service. * * @param model the current model (may have been modified by earlier transforms) * @param service the service shape being generated * @return the transformed model (may be the same instance if no changes needed) */ - Model apply(Model model, ServiceShape service); + Model transform(Model model, ServiceShape service); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java index 34812a68b20..237f318c3ff 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeClassifier.java @@ -161,21 +161,20 @@ public static ClassifiedShapes classify(Model model, ServiceShape service, Proto } // Shape ids referenced as a member by any reachable shape (includes list/map element targets). - Set memberTargetIds = new HashSet<>(); - for (ShapeId id : reachable) { - model.expectShape(id).members().forEach(m -> memberTargetIds.add(m.getTarget())); - } + Set memberTargetIds = reachable.stream() + .flatMap(id -> model.expectShape(id).members().stream()) + .map(MemberShape::getTarget) + .collect(Collectors.toSet()); // Structs that are members of a reachable @streaming union — i.e. events. A blob-payload // event is recognised only among these, so a plain data struct carrying an @eventPayload // blob is never mis-claimed. - Set eventStructIds = new HashSet<>(); - for (ShapeId id : reachable) { - Shape shape = model.expectShape(id); - if (shape.isUnionShape() && shape.hasTrait(StreamingTrait.class)) { - shape.members().forEach(m -> eventStructIds.add(m.getTarget())); - } - } + Set eventStructIds = reachable.stream() + .map(model::expectShape) + .filter(shape -> shape.isUnionShape() && shape.hasTrait(StreamingTrait.class)) + .flatMap(shape -> shape.members().stream()) + .map(MemberShape::getTarget) + .collect(Collectors.toSet()); // Incoming event-stream union shape ids: the @streaming union member of every event-stream // handler output. Realized via the handler and never referenced as a data type, so their @@ -278,13 +277,11 @@ private static boolean isBlobPayloadEvent(Shape shape, Model model, Set * blob-payload event renderer so they agree on which member becomes the blob payload. */ public static Optional blobPayloadMemberName(StructureShape shape, Model model) { - for (MemberShape member : shape.getAllMembers().values()) { - if (member.hasTrait(EventPayloadTrait.class) - && model.expectShape(member.getTarget()).isBlobShape()) { - return Optional.of(member.getMemberName()); - } - } - return Optional.empty(); + return shape.getAllMembers().values().stream() + .filter(member -> member.hasTrait(EventPayloadTrait.class) + && model.expectShape(member.getTarget()).isBlobShape()) + .map(MemberShape::getMemberName) + .findFirst(); } /** diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipeline.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipeline.java index 4259807bbd1..fcaae7fad13 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipeline.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipeline.java @@ -33,7 +33,9 @@ public TransformPipeline(List transforms) { public Model apply(Model model, ServiceShape service) { Model current = model; for (ModelTransform transform : transforms) { - current = transform.apply(current, service); + if (transform.shouldRun(service)) { + current = transform.transform(current, service); + } } return current; } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java index 477a253f680..8c9d273cc79 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/SubObjectRenderer.java @@ -33,11 +33,6 @@ public SubObjectRenderer(List subObjects, Set resultOutputIds, R this.ctx = ctx; } - /** Convenience overload for callers with no dual-role output shapes (e.g. characterization tests). */ - public SubObjectRenderer(List subObjects, RenderContext ctx) { - this(subObjects, java.util.Collections.emptySet(), ctx); - } - @Override public void render(CppWriterDelegator writerDelegator) { for (Shape shape : subObjects) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java index d29a00c398c..2be23779b59 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransforms.java @@ -25,18 +25,15 @@ * trait so serde stays correct. Self-guards on service name accessanalyzer; no-op when the domain * shape is absent; throws if GeneratedPolicyResults is already occupied by a distinct shape. */ -public final class AccessAnalyzerTransforms { +public final class AccessAnalyzerTransforms implements ModelTransform { - private AccessAnalyzerTransforms() {} - - public static ModelTransform asTransform() { - return AccessAnalyzerTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "accessanalyzer".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"accessanalyzer".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { String ns = service.getId().getNamespace(); ShapeId oldShape = ShapeId.fromParts(ns, "GeneratedPolicyResult"); ShapeId newShape = ShapeId.fromParts(ns, "GeneratedPolicyResults"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java index 5aff1662174..9162529c645 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransforms.java @@ -20,18 +20,15 @@ * Renames the reserved {@code body}/{@code headers} members of API Gateway's test-invoke requests to * {@code requestBody}/{@code requestHeaders}. Mirrors the legacy C2J {@code APIGatewayRestJsonCppClientGenerator}. */ -public final class ApiGatewayTransforms { +public final class ApiGatewayTransforms implements ModelTransform { - private ApiGatewayTransforms() {} - - public static ModelTransform asTransform() { - return ApiGatewayTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "api-gateway".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"api-gateway".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { String ns = service.getId().getNamespace(); Protocol protocol = ProtocolResolver.resolve(service, model); List updated = new ArrayList<>(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java index a1636497b07..b6dea0be843 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2Transforms.java @@ -20,18 +20,15 @@ * Renames the reserved {@code Body} member of API Gateway V2's import requests to {@code requestBody}. * Mirrors the legacy C2J {@code APIGatewayV2RestJsonCppClientGenerator}. */ -public final class ApiGatewayV2Transforms { +public final class ApiGatewayV2Transforms implements ModelTransform { - private ApiGatewayV2Transforms() {} - - public static ModelTransform asTransform() { - return ApiGatewayV2Transforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "apigatewayv2".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"apigatewayv2".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { String ns = service.getId().getNamespace(); Protocol protocol = ProtocolResolver.resolve(service, model); List updated = new ArrayList<>(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java index 9f8683c447c..d40bd0e5da0 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransform.java @@ -24,17 +24,17 @@ * hasStreamMembers proxy, also guaranteeing members > 0), and either the service is MediaStore Data * or the operation is S3's WriteGetObjectResponse. No-op otherwise. */ -public final class ChunkedEncodingTransform { +public final class ChunkedEncodingTransform implements ModelTransform { private static final String WRITE_GET_OBJECT_RESPONSE = "WriteGetObjectResponse"; - private ChunkedEncodingTransform() {} - - public static ModelTransform asTransform() { - return ChunkedEncodingTransform::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return true; } - private static Model apply(Model model, ServiceShape service) { + @Override + public Model transform(Model model, ServiceShape service) { boolean mediaStoreData = "mediastore-data".equals(ServiceNameUtil.getSmithyServiceName(service, null)); List updated = new ArrayList<>(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java index 6b7c56ffc45..d2793ad40a2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransforms.java @@ -21,18 +21,15 @@ * shape stays in the model so member references still resolve. Self-guards on service name dynamodb; * no-op when AttributeValue is absent. */ -public final class DynamoDbTransforms { +public final class DynamoDbTransforms implements ModelTransform { - private DynamoDbTransforms() {} - - public static ModelTransform asTransform() { - return DynamoDbTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "dynamodb".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"dynamodb".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { ShapeId attributeValueId = ShapeId.fromParts(service.getId().getNamespace(), "AttributeValue"); Optional attributeValue = model.getShape(attributeValueId); if (attributeValue.isEmpty()) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java index dc43824d1cf..e225608c11b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2Transforms.java @@ -28,18 +28,15 @@ * BlobAttributeValue). Out of scope (left to C2J): legacy error-code injection, CopySnapshot * pre-signing, and the endpoint template. */ -public final class Ec2Transforms { +public final class Ec2Transforms implements ModelTransform { - private Ec2Transforms() {} - - public static ModelTransform asTransform() { - return Ec2Transforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "ec2".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"ec2".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { return renameResultShapesToResponse( addSecureBlobUserData(addSpotInstanceStateDisabled(model))); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java index 58aa21d8987..4675df14d8e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransforms.java @@ -33,20 +33,17 @@ * {@link AdditionalRequestHeadersTrait} on their inputs so request rendering emits the matching * headers.insert(...). Self-guards on service name; no-op when the model has no streaming request. */ -public final class GlacierTransforms { +public final class GlacierTransforms implements ModelTransform { private static final String GLACIER_VERSION_HEADER = "x-amz-glacier-version"; - private GlacierTransforms() {} - - public static ModelTransform asTransform() { - return GlacierTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "glacier".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"glacier".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { return retypeLimitQueryMembersToString(addAdditionalHeaders(model, service), service); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java index 1823039213f..99040d3eab7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlobalTransforms.java @@ -36,7 +36,7 @@ * Global model transforms applied before code generation. * Handles reserved member renaming and reachability filtering. */ -public final class GlobalTransforms { +public final class GlobalTransforms implements ModelTransform { /** * Services (raw smithy names) that skip the "body" -> "requestBody" rename. api-gateway/apigatewayv2 @@ -61,8 +61,6 @@ public final class GlobalTransforms { */ public static final String RESPONSE_METADATA = "ResponseMetadata"; - private GlobalTransforms() {} - /** * Renames reserved request members on every operation-input structure ({@code body -> requestBody}, * {@code headers/Headers -> headerValues}), honoring the per-service skip-lists. Mirrors C2J's @@ -170,8 +168,14 @@ public static List nonDeprecatedOperations(Model model, ServiceS * sees the pruned model), then {@link #renameReservedRequestMembers}, then * {@link #injectResponseMetadata}. */ - public static ModelTransform asTransform() { - return (model, service) -> injectResponseMetadata( + @Override + public boolean shouldRun(ServiceShape service) { + return true; + } + + @Override + public Model transform(Model model, ServiceShape service) { + return injectResponseMetadata( renameReservedRequestMembers(dropDeprecatedMembers(model, service), service), service); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java index 344442d7543..3da6a97ee65 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransforms.java @@ -23,20 +23,17 @@ * Lambda service. Mirrors the legacy C2J {@code LambdaRestJsonCppClientGenerator}, which removed * {@code InvokeAsync} because it collides with the generated async client. */ -public final class LambdaTransforms { +public final class LambdaTransforms implements ModelTransform { private static final ShapeId UNIT = ShapeId.from("smithy.api#Unit"); - private LambdaTransforms() {} - - public static ModelTransform asTransform() { - return LambdaTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "lambda".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"lambda".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { Optional invokeAsync = TopDownIndex.of(model) .getContainedOperations(service).stream() .filter(op -> "InvokeAsync".equals(op.getId().getName())) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java index de10d889b75..fc212625b91 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransform.java @@ -24,7 +24,7 @@ * smithy service name (from {@link ServiceNameUtil#getSmithyServiceName(ServiceShape, Map)} with a * {@code null} map, so no c2jMap remap like {@code sfn->states}). No-op for other services. */ -public final class LongPollingTransform { +public final class LongPollingTransform implements ModelTransform { private static final Map> LONG_POLLING_OPERATIONS = Map.of( "sqs", Set.of("ReceiveMessage"), @@ -32,18 +32,16 @@ public final class LongPollingTransform { "swf", Set.of("PollForActivityTask", "PollForDecisionTask") ); - private LongPollingTransform() {} - - public static ModelTransform asTransform() { - return LongPollingTransform::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return LONG_POLLING_OPERATIONS.containsKey( + ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { + @Override + public Model transform(Model model, ServiceShape service) { Set longPollOps = LONG_POLLING_OPERATIONS.get(ServiceNameUtil.getSmithyServiceName(service, null)); - if (longPollOps == null) { - return model; - } List updated = new ArrayList<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { if (longPollOps.contains(op.getId().getName())) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java index d510bc260f9..57bcc9ece02 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransforms.java @@ -22,18 +22,15 @@ * each operation-output with {@link TopLevelHostIdTrait}, which {@code ResultRenderer} turns into the * top-level HostId accessor group. Self-guards on the raw smithy service name {@code s3-control}. */ -public final class S3ControlTransforms { +public final class S3ControlTransforms implements ModelTransform { - private S3ControlTransforms() {} - - public static ModelTransform asTransform() { - return S3ControlTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "s3-control".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"s3-control".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { TopDownIndex index = TopDownIndex.of(model); List marked = new ArrayList<>(); for (OperationShape op : index.getContainedOperations(service)) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java index 1fa5e3dad1e..ae0793ee0fd 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3Transforms.java @@ -42,19 +42,16 @@ * when its shapes are absent and fast-fails on genuine collisions. Client/endpoint/ARN/S3Express/CRT * customizations and serde-body emission are out of scope. */ -public final class S3Transforms { +public final class S3Transforms implements ModelTransform { - private S3Transforms() {} - - public static ModelTransform asTransform() { - return S3Transforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + String name = ServiceNameUtil.getSmithyServiceName(service, null); + return "s3".equals(name) || "s3-crt".equals(name); } - private static Model apply(Model model, ServiceShape service) { - String name = ServiceNameUtil.getSmithyServiceName(service, null); - if (!"s3".equals(name) && !"s3-crt".equals(name)) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { Model result = markEmbeddedErrors(injectAccessLogTagQuery(normalizeReplicationStatus( expandBucketLocationConstraint(hackGetObjectResult( addExpiresCustomization(renameCopyObjectResult( diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java index b8ec549a219..947dfe257ba 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransform.java @@ -24,7 +24,7 @@ * RDS-family services (RDS/DocDB/Neptune), mirroring the C2J injection that backs presigned-URL * generation. Model-shape scope only; the presigned-URL client logic remains in the C2J path. */ -public final class SourceRegionTransform { +public final class SourceRegionTransform implements ModelTransform { private static final String SOURCE_REGION = "SourceRegion"; @@ -44,18 +44,15 @@ public final class SourceRegionTransform { "CreateDBCluster") ); - private SourceRegionTransform() {} - - public static ModelTransform asTransform() { - return SourceRegionTransform::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return TARGETS.containsKey(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { + @Override + public Model transform(Model model, ServiceShape service) { String serviceName = ServiceNameUtil.getSmithyServiceName(service, null); Set operations = TARGETS.get(serviceName); - if (operations == null) { - return model; - } List updated = new ArrayList<>(); for (OperationShape op : TopDownIndex.of(model).getContainedOperations(service)) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java index 4c6698b8f6c..32c69f2ed59 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransforms.java @@ -16,22 +16,19 @@ * {@code SQSQueryXmlCppClientGenerator}/{@code SQSJsonCppClientGenerator} injected. These values are * returned by the service but absent from the model. */ -public final class SqsTransforms { +public final class SqsTransforms implements ModelTransform { private static final String ENUM_NAME = "QueueAttributeName"; private static final List ADDED_VALUES = List.of( "SentTimestamp", "ApproximateFirstReceiveTimestamp", "ApproximateReceiveCount", "SenderId"); - private SqsTransforms() {} - - public static ModelTransform asTransform() { - return SqsTransforms::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return "sqs".equals(ServiceNameUtil.getSmithyServiceName(service, null)); } - private static Model apply(Model model, ServiceShape service) { - if (!"sqs".equals(ServiceNameUtil.getSmithyServiceName(service, null))) { - return model; - } + @Override + public Model transform(Model model, ServiceShape service) { return TransformSupport.appendEnumValuesByName(model, ENUM_NAME, ADDED_VALUES); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java index 3eb51cfce34..78c8337147d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransform.java @@ -24,15 +24,15 @@ * also covers Unit-input operations. C2J sets the flag for every query/ec2 operation, plus Polly's * {@code SynthesizeSpeech}. No-op for other services. */ -public final class SupportsPresigningTransform { +public final class SupportsPresigningTransform implements ModelTransform { - private SupportsPresigningTransform() {} - - public static ModelTransform asTransform() { - return SupportsPresigningTransform::apply; + @Override + public boolean shouldRun(ServiceShape service) { + return true; } - private static Model apply(Model model, ServiceShape service) { + @Override + public Model transform(Model model, ServiceShape service) { Protocol protocol = ProtocolResolver.resolve(service, model); boolean queryLike = protocol == Protocol.QUERY_XML || protocol == Protocol.EC2; boolean polly = "polly".equals(ServiceNameUtil.getSmithyServiceName(service, null)); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java index 34c2568221d..80868cd9e88 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/GlobalTransformsTest.java @@ -42,7 +42,7 @@ private static StructureShape input(Model m) { @Test void reservedRename_body_becomesRequestBody_forNonSkippedService() { Model m = inputModel("Security IR", "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertFalse(input(out).getMember("body").isPresent()); assertTrue(input(out).getMember("requestBody").isPresent()); } @@ -50,7 +50,7 @@ void reservedRename_body_becomesRequestBody_forNonSkippedService() { @Test void reservedRename_body_skippedForBedrockRuntime() { Model m = inputModel("Bedrock Runtime", "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertTrue(input(out).getMember("body").isPresent(), "skip-listed service keeps body"); } @@ -59,14 +59,14 @@ void reservedRename_body_skippedForApiGateway_rawName() { // C2J name is "apigateway" but the raw smithy name is "api-gateway"; the skip-list must use // the raw name or API Gateway's dedicated transform gets pre-empted. Model m = inputModel("API Gateway", "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertTrue(input(out).getMember("body").isPresent(), "api-gateway must be skipped"); } @Test void reservedRename_headers_becomesHeaderValues_forNonSkippedService() { Model m = inputModel("Kinesis", "headers"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertTrue(input(out).getMember("headerValues").isPresent()); assertFalse(input(out).getMember("headers").isPresent()); } @@ -74,7 +74,7 @@ void reservedRename_headers_becomesHeaderValues_forNonSkippedService() { @Test void reservedRename_capitalHeaders_alwaysRenamed() { Model m = inputModel("API Gateway", "Headers"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertTrue(input(out).getMember("headerValues").isPresent()); } @@ -94,7 +94,7 @@ void reservedRename_onlyTouchesOperationInputs_notArbitraryShapes() { .sdkId("Kinesis").arnNamespace("x").cloudFormationName("X").cloudTrailEventSource("x").build()) .addOperation(op.getId()).build(); Model m = Model.assembler().addShapes(domain, input, output, op, service).assemble().unwrap(); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); assertTrue(out.expectShape(ShapeId.from("com.example#HttpThing"), StructureShape.class) .getMember("body").isPresent(), "domain shape body must not be renamed"); } @@ -103,13 +103,13 @@ void reservedRename_onlyTouchesOperationInputs_notArbitraryShapes() { void reservedRename_collision_throws() { Model m = inputModel("Kinesis", "body", "requestBody"); assertThrows(IllegalStateException.class, - () -> GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example"))); + () -> new GlobalTransforms().transform(m, serviceOf(m, "Example"))); } @Test void reservedRename_jsonService_preservesWireNameWithJsonName() { Model m = inputModel("Kinesis", "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); assertEquals("body", renamed.expectTrait(JsonNameTrait.class).getValue(), "JSON service must keep the 'body' wire key via @jsonName"); @@ -120,7 +120,7 @@ void reservedRename_jsonService_preservesWireNameWithJsonName() { void reservedRename_queryXmlService_preservesWireNameWithXmlName() { Model m = inputModelWithProtocol("Kinesis", new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait(), "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); assertEquals("body", renamed.expectTrait(XmlNameTrait.class).getValue(), "awsQuery service must keep the 'body' wire key via @xmlName"); @@ -136,7 +136,7 @@ void reservedRename_ec2Service_pinsRequestKeyAndResponseName() { // name (@xmlName) differ, so both are pinned rather than relying on capitalize(@xmlName). Model m = inputModelWithProtocol("Kinesis", new software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait(), "body"); - Model out = GlobalTransforms.asTransform().apply(m, serviceOf(m, "Example")); + Model out = new GlobalTransforms().transform(m, serviceOf(m, "Example")); MemberShape renamed = input(out).getMember("requestBody").orElseThrow(); assertEquals("Body", renamed.expectTrait( software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait.class).getValue(), @@ -699,7 +699,7 @@ private static ServiceShape serviceOf(Model model) { @Test void injectResponseMetadata_awsQuery_addsResponseMetadataMemberToResult() { Model model = oneOutputModel(new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); StructureShape result = out.expectShape( ShapeId.from("com.example#DoThingOutput"), StructureShape.class); @@ -713,7 +713,7 @@ void injectResponseMetadata_awsQuery_addsResponseMetadataMemberToResult() { @Test void injectResponseMetadata_awsQuery_addsResponseMetadataStructureWithRequestId() { Model model = oneOutputModel(new software.amazon.smithy.aws.traits.protocols.AwsQueryTrait()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); ShapeId rmId = out.expectShape(ShapeId.from("com.example#DoThingOutput"), StructureShape.class) .getMember("ResponseMetadata").get().getTarget(); @@ -726,7 +726,7 @@ void injectResponseMetadata_awsQuery_addsResponseMetadataStructureWithRequestId( @Test void injectResponseMetadata_ec2_addsResponseMetadataMemberToResult() { Model model = oneOutputModel(new software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); StructureShape result = out.expectShape( ShapeId.from("com.example#DoThingOutput"), StructureShape.class); @@ -738,7 +738,7 @@ void injectResponseMetadata_ec2_addsResponseMetadataMemberToResult() { void injectResponseMetadata_restJson_leavesResultUnchanged() { Model model = oneOutputModel( software.amazon.smithy.aws.traits.protocols.RestJson1Trait.builder().build()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); StructureShape result = out.expectShape( ShapeId.from("com.example#DoThingOutput"), StructureShape.class); @@ -753,7 +753,7 @@ void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataMembe Model model = oneOutputModel( software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build(), new software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); StructureShape result = out.expectShape( ShapeId.from("com.example#DoThingOutput"), StructureShape.class); @@ -769,7 +769,7 @@ void injectResponseMetadata_awsJsonWithQueryCompatible_addsResponseMetadataStruc Model model = oneOutputModel( software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build(), new software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); ShapeId rmId = out.expectShape(ShapeId.from("com.example#DoThingOutput"), StructureShape.class) .getMember("ResponseMetadata").get().getTarget(); @@ -831,7 +831,7 @@ void injectResponseMetadata_awsJsonWithoutQueryCompatible_leavesResultUnchanged( // Plain awsJson1_0 (no @awsQueryCompatible) must NOT get ResponseMetadata injected. Model model = oneOutputModel( software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait.builder().build()); - Model out = GlobalTransforms.asTransform().apply(model, serviceOf(model)); + Model out = new GlobalTransforms().transform(model, serviceOf(model)); StructureShape result = out.expectShape( ShapeId.from("com.example#DoThingOutput"), StructureShape.class); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java index 993a727d05d..2f147eb11c0 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelGeneratorTest.java @@ -81,9 +81,11 @@ private static MockManifest generate(String smithyServiceName, String namespace, Model model = model(smithyServiceName); ServiceShape service = model.expectShape( ShapeId.from("com.amazonaws.dynamodb#DynamoDB_20120810"), ServiceShape.class); - // Apply the DynamoDB service-level transform first (mirrors ModelCodegenPlugin): marks - // AttributeValue @customRendered for dynamodb, no-op otherwise. Suppression flows through ShapeClassifier. - Model transformed = DynamoDbTransforms.asTransform().apply(model, service); + // Apply the DynamoDB service-level transform first (mirrors ModelCodegenPlugin): its + // shouldRun gate marks AttributeValue @customRendered for dynamodb only, so any other + // service is skipped and AttributeValue flows through ShapeClassifier generically. + var ddb = new DynamoDbTransforms(); + Model transformed = ddb.shouldRun(service) ? ddb.transform(model, service) : model; MockManifest manifest = new MockManifest(); CppWriterDelegator delegator = new CppWriterDelegator(manifest); new ModelGenerator(transformed, service, delegator, smithyServiceName, exportMacro, namespace) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java index 4709a4bf4a6..727ddcd3482 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ProtocolTraitsCharacterizationTest.java @@ -127,7 +127,7 @@ private static java.util.Map renderAll(Protocol p) { ProtocolTraits traits = ProtocolResolver.traitsFor(resolved); RenderContext ctx = new RenderContext(model, service, traits, "Example", "AWS_EXAMPLE_API", "example"); - new SubObjectRenderer(classified.subObjects(), ctx).render(delegator); + new SubObjectRenderer(classified.subObjects(), classified.resultOutputIds(), ctx).render(delegator); new RequestRenderer(classified.requests(), ctx).render(delegator); new ResultRenderer(classified.results(), ctx).render(delegator); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java index 01bfb42a133..891480b256b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/SubObjectRendererTest.java @@ -85,7 +85,7 @@ private static java.util.Map renderAll() { model.expectShape(ShapeId.from("com.example#BidirectionalInput")), model.expectShape(ShapeId.from("com.example#AnyToolChoice")), model.expectShape(ShapeId.from("com.example#AudioSource"))); - new SubObjectRenderer(subObjects, + new SubObjectRenderer(subObjects, java.util.Collections.emptySet(), new RenderContext(model, service, traits, "Example", "AWS_EXAMPLE_API", "example")).render(delegator); delegator.flushWriters(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java index 04506885b12..3e006c7ea4e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/TransformPipelineTest.java @@ -11,12 +11,27 @@ import java.util.ArrayList; import java.util.List; +import java.util.function.BiFunction; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; class TransformPipelineTest { + /** Wraps a transform body as an always-run transform (shouldRun defaults to false otherwise). */ + private static ModelTransform alwaysRun(BiFunction body) { + return new ModelTransform() { + @Override + public boolean shouldRun(ServiceShape service) { + return true; + } + @Override + public Model transform(Model model, ServiceShape service) { + return body.apply(model, service); + } + }; + } + @Test void emptyPipelineReturnsModelUnchanged() { Model model = Model.builder() @@ -38,8 +53,8 @@ void transformsExecuteInOrder() { ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); List executionOrder = new ArrayList<>(); - ModelTransform first = (m, s) -> { executionOrder.add("first"); return m; }; - ModelTransform second = (m, s) -> { executionOrder.add("second"); return m; }; + ModelTransform first = alwaysRun((m, s) -> { executionOrder.add("first"); return m; }); + ModelTransform second = alwaysRun((m, s) -> { executionOrder.add("second"); return m; }); TransformPipeline pipeline = new TransformPipeline(List.of(first, second)); pipeline.apply(model, service); @@ -58,12 +73,12 @@ void transformReceivesOutputOfPrevious() { .addShape(ServiceShape.builder().id("com.example#Extra").version("2024-01-01").build()) .build(); - ModelTransform addShape = (m, s) -> withExtra; - ModelTransform checkShape = (m, s) -> { + ModelTransform addShape = alwaysRun((m, s) -> withExtra); + ModelTransform checkShape = alwaysRun((m, s) -> { // This transform should see the shape added by the first m.expectShape(ShapeId.from("com.example#Extra")); return m; - }; + }); TransformPipeline pipeline = new TransformPipeline(List.of(addShape, checkShape)); Model result = pipeline.apply(original, service); @@ -71,4 +86,21 @@ void transformReceivesOutputOfPrevious() { // Final result is the model from the last transform assertSame(withExtra, result); } + + @Test + void skipsTransformThatDoesNotOptIn() { + Model model = Model.builder() + .addShape(ServiceShape.builder().id("com.example#TestService").version("2024-01-01").build()) + .build(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); + + List executionOrder = new ArrayList<>(); + // A bare transform inherits shouldRun == false, so the pipeline must skip it. + ModelTransform notOptedIn = (m, s) -> { executionOrder.add("skipped"); return m; }; + ModelTransform optedIn = alwaysRun((m, s) -> { executionOrder.add("ran"); return m; }); + + new TransformPipeline(List.of(notOptedIn, optedIn)).apply(model, service); + + assertEquals(List.of("ran"), executionOrder); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java index 8ad9cda0120..2b5e91b311a 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/AccessAnalyzerTransformsTest.java @@ -40,7 +40,7 @@ private static ServiceShape service(Model m) { @Test void renamesShapeAndMember_withJsonNamePreserved() { Model m = model("AccessAnalyzer", true); - Model out = AccessAnalyzerTransforms.asTransform().apply(m, service(m)); + Model out = new AccessAnalyzerTransforms().transform(m, service(m)); assertTrue(out.getShape( ShapeId.from("com.amazonaws.accessanalyzer#GeneratedPolicyResults")).isPresent(), @@ -62,8 +62,7 @@ void renamesShapeAndMember_withJsonNamePreserved() { @Test void noOpForOtherService() { Model m = model("SomethingElse", true); - Model out = AccessAnalyzerTransforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new AccessAnalyzerTransforms().shouldRun(service(m))); } @Test @@ -84,6 +83,6 @@ void throwsWhenTargetShapeAlreadyExists() { .addOperation(op.getId()).build(); Model m = Model.assembler().addShapes(gpr, gprs, resp, req, op, svc).assemble().unwrap(); assertThrows(IllegalStateException.class, - () -> AccessAnalyzerTransforms.asTransform().apply(m, service(m))); + () -> new AccessAnalyzerTransforms().transform(m, service(m))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java index cc70ad9c1c6..42e4382fad0 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayTransformsTest.java @@ -52,7 +52,7 @@ private static ServiceShape service(Model m) { @Test void renamesBodyAndHeaders() { Model m = apiGatewayModel("API Gateway"); - Model out = ApiGatewayTransforms.asTransform().apply(m, service(m)); + Model out = new ApiGatewayTransforms().transform(m, service(m)); StructureShape r = out.expectShape( ShapeId.from("com.example#TestInvokeMethodRequest"), StructureShape.class); @@ -74,7 +74,6 @@ void renamesBodyAndHeaders() { @Test void noOpForOtherService() { Model m = apiGatewayModel("SomeOther"); - Model out = ApiGatewayTransforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new ApiGatewayTransforms().shouldRun(service(m))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java index 9ac34b20a9e..21a8c62aac9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ApiGatewayV2TransformsTest.java @@ -47,7 +47,7 @@ private static ServiceShape service(Model m) { @Test void renamesBody() { Model m = model("ApiGatewayV2"); - Model out = ApiGatewayV2Transforms.asTransform().apply(m, service(m)); + Model out = new ApiGatewayV2Transforms().transform(m, service(m)); for (String name : new String[]{"ImportApiRequest", "ReimportApiRequest"}) { StructureShape r = out.expectShape(ShapeId.from("com.example#" + name), StructureShape.class); assertTrue(r.getMember("requestBody").isPresent(), name); @@ -60,7 +60,6 @@ void renamesBody() { @Test void noOpForOtherService() { Model m = model("SomeOther"); - Model out = ApiGatewayV2Transforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new ApiGatewayV2Transforms().shouldRun(service(m))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java index bc3515b8060..035f70ca240 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ChunkedEncodingTransformTest.java @@ -68,7 +68,7 @@ private static Model oneOpModel(String sdkId, String opName, boolean streaming, @Test void mediaStoreDataUnsignedStreamingOp_stampsInput() { Model m = oneOpModel("MediaStore Data", "PutObject", true, true); - Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + Model out = new ChunkedEncodingTransform().transform(m, service(m)); assertTrue(stamped(out, "PutObjectRequest"), "MediaStore Data unsigned-payload streaming request must be stamped"); } @@ -76,7 +76,7 @@ void mediaStoreDataUnsignedStreamingOp_stampsInput() { @Test void mediaStoreDataNonStreamingOp_notStamped() { Model m = oneOpModel("MediaStore Data", "DescribeObject", false, true); - Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + Model out = new ChunkedEncodingTransform().transform(m, service(m)); assertSame(m, out, "no qualifying operation must leave the model untouched"); assertFalse(stamped(out, "DescribeObjectRequest"), "a non-streaming request must not be stamped"); @@ -85,7 +85,7 @@ void mediaStoreDataNonStreamingOp_notStamped() { @Test void mediaStoreDataSignedStreamingOp_notStamped() { Model m = oneOpModel("MediaStore Data", "PutObject", true, false); - Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + Model out = new ChunkedEncodingTransform().transform(m, service(m)); assertSame(m, out, "no qualifying operation must leave the model untouched"); assertFalse(stamped(out, "PutObjectRequest"), "a signed (no @unsignedPayload) request must not be stamped"); @@ -94,7 +94,7 @@ void mediaStoreDataSignedStreamingOp_notStamped() { @Test void s3WriteGetObjectResponseUnsignedStreamingOp_stampsInput() { Model m = oneOpModel("S3", "WriteGetObjectResponse", true, true); - Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + Model out = new ChunkedEncodingTransform().transform(m, service(m)); assertTrue(stamped(out, "WriteGetObjectResponseRequest"), "S3 WriteGetObjectResponse unsigned-payload streaming request must be stamped"); } @@ -102,7 +102,7 @@ void s3WriteGetObjectResponseUnsignedStreamingOp_stampsInput() { @Test void unrelatedServiceStreamingOp_notStamped() { Model m = oneOpModel("S3", "PutObject", true, true); - Model out = ChunkedEncodingTransform.asTransform().apply(m, service(m)); + Model out = new ChunkedEncodingTransform().transform(m, service(m)); assertSame(m, out, "an unrelated operation must leave the model untouched"); assertFalse(stamped(out, "PutObjectRequest"), "only WriteGetObjectResponse (or MediaStore Data) may be stamped"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java index 225c674c4a7..4d73c507999 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/DynamoDbTransformsTest.java @@ -60,7 +60,7 @@ private static ServiceShape service(Model m) { @Test void marksAttributeValueForDynamoDb() { Model m = model("DynamoDB", true); - Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); + Model out = new DynamoDbTransforms().transform(m, service(m)); assertTrue(out.expectShape(ShapeId.from(NS + "#AttributeValue")) .hasTrait(CustomRenderedTrait.class), @@ -69,19 +69,16 @@ void marksAttributeValueForDynamoDb() { @Test void noOpForOtherService() { - // A non-dynamodb service (sdkId resolves via getSmithyServiceName) is untouched. + // A non-dynamodb service (sdkId resolves via getSmithyServiceName) does not run. Model m = model("Kinesis", true); - Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); - assertSame(m, out, "transform must be a no-op for non-dynamodb services"); - assertFalse(out.expectShape(ShapeId.from(NS + "#AttributeValue")) - .hasTrait(CustomRenderedTrait.class), - "non-dynamodb AttributeValue must not be marked"); + assertFalse(new DynamoDbTransforms().shouldRun(service(m)), + "transform must not run for non-dynamodb services"); } @Test void noOpWhenAttributeValueAbsent() { Model m = model("DynamoDB", false); - Model out = DynamoDbTransforms.asTransform().apply(m, service(m)); + Model out = new DynamoDbTransforms().transform(m, service(m)); assertSame(m, out, "transform must be a no-op when AttributeValue is absent"); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java index 442a7188edf..e3baad7b016 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Ec2TransformsTest.java @@ -46,7 +46,7 @@ private static ServiceShape ec2Service(String sdkId) { @Test void addsDisabledToSpotInstanceState() { Model m = ec2Model("EC2"); - Model out = Ec2Transforms.asTransform().apply(m, service(m)); + Model out = new Ec2Transforms().transform(m, service(m)); assertTrue(EnumRenderer.getEnumValues( out.expectShape(ShapeId.from("com.example#SpotInstanceState"))).contains("disabled")); } @@ -54,8 +54,7 @@ void addsDisabledToSpotInstanceState() { @Test void noOpForOtherService() { Model m = ec2Model("SomeOther"); - Model out = Ec2Transforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new Ec2Transforms().shouldRun(service(m))); } @Test @@ -65,7 +64,7 @@ void renamesNestedResultStructToResponse() { ServiceShape service = ec2Service("EC2"); Model m = Model.assembler().addShapes(nested, service).assemble().unwrap(); - Model out = Ec2Transforms.asTransform().apply(m, service); + Model out = new Ec2Transforms().transform(m, service); assertFalse(out.getShape(ShapeId.from("com.example#MetricDataResult")).isPresent()); assertTrue(out.getShape(ShapeId.from("com.example#MetricDataResponse")).isPresent()); @@ -88,7 +87,7 @@ void throwsWhenResponseShapeAlreadyExists() { .addOperation(op.getId()).build(); Model m = Model.assembler().addShapes(result, response, in, out, op, service).assemble().unwrap(); assertThrows(IllegalStateException.class, - () -> Ec2Transforms.asTransform().apply(m, service(m))); + () -> new Ec2Transforms().transform(m, service(m))); } /** @@ -122,7 +121,7 @@ private static Model userDataModel() { @Test void modelsUserDataAsSensitiveSecureBlobAttributeValue() { Model m = userDataModel(); - Model out = Ec2Transforms.asTransform().apply(m, service(m)); + Model out = new Ec2Transforms().transform(m, service(m)); // SecureBlobAttributeValue exists with a Value member targeting a @sensitive blob // (a @sensitive blob maps to Aws::Utils::CryptoBuffer, matching the C2J baseline). @@ -151,8 +150,8 @@ void modelsUserDataAsSensitiveSecureBlobAttributeValue() { void throwsWhenSecureBlobAttributeValueAlreadyExists() { // Once upstream aws-models adds SecureBlobAttributeValue, this compensating transform is // obsolete. Fail loudly so a human removes it, rather than silently self-retiring. - Model once = Ec2Transforms.asTransform().apply(userDataModel(), service(userDataModel())); + Model once = new Ec2Transforms().transform(userDataModel(), service(userDataModel())); assertThrows(IllegalStateException.class, - () -> Ec2Transforms.asTransform().apply(once, service(once))); + () -> new Ec2Transforms().transform(once, service(once))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java index 2aba1d64a30..f85f64e9768 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/GlacierTransformsTest.java @@ -85,9 +85,7 @@ void noOpForOtherService() { ServiceShape svc = ServiceShape.builder().id("com.amazonaws.other#Other").version("1") .addTrait(ServiceTrait.builder().sdkId("Other").arnNamespace("other") .cloudFormationName("Other").cloudTrailEventSource("other").build()).build(); - Model m = Model.builder().addShape(svc).build(); - Model out = GlacierTransforms.asTransform().apply(m, svc); - assertSame(m, out, "non-glacier service must be untouched"); + assertFalse(new GlacierTransforms().shouldRun(svc), "non-glacier service must not run"); } @Test @@ -95,7 +93,7 @@ void stampsVersionHeaderOnStreamingRequestInputs() { StructureShape upload = streamingInput("UploadArchiveInput"); OperationShape uploadOp = op("UploadArchive", upload); ServiceShape svc = glacierService("Glacier", uploadOp); - Model out = GlacierTransforms.asTransform().apply(modelWith(svc, upload, uploadOp), svc); + Model out = new GlacierTransforms().transform(modelWith(svc, upload, uploadOp), svc); AdditionalRequestHeadersTrait trait = out .expectShape(ShapeId.from(NS + "#UploadArchiveInput"), StructureShape.class) @@ -111,7 +109,7 @@ void doesNotStampNonStreamingRequestInputs() { StructureShape plain = plainInput("CompleteVaultLockInput"); OperationShape plainOp = op("CompleteVaultLock", plain); ServiceShape svc = glacierService("Glacier", plainOp); - Model out = GlacierTransforms.asTransform().apply(modelWith(svc, plain, plainOp), svc); + Model out = new GlacierTransforms().transform(modelWith(svc, plain, plainOp), svc); assertFalse(out.expectShape(ShapeId.from(NS + "#CompleteVaultLockInput"), StructureShape.class) .hasTrait(AdditionalRequestHeadersTrait.class), @@ -123,7 +121,7 @@ void retypesQueryLimitMemberBackToString() { StructureShape listJobs = queryLimitInput("ListJobsInput"); OperationShape listJobsOp = op("ListJobs", listJobs); ServiceShape svc = glacierService("Glacier", listJobsOp); - Model out = GlacierTransforms.asTransform().apply(modelWith(svc, listJobs, listJobsOp), svc); + Model out = new GlacierTransforms().transform(modelWith(svc, listJobs, listJobsOp), svc); MemberShape limit = out.expectShape(ShapeId.from(NS + "#ListJobsInput"), StructureShape.class) .getMember("limit").orElseThrow(); @@ -140,7 +138,7 @@ void leavesQueryLimitUnchangedWhenAlreadyString() { .build(); OperationShape listJobsOp = op("ListJobs", listJobs); ServiceShape svc = glacierService("Glacier", listJobsOp); - Model out = GlacierTransforms.asTransform().apply(modelWith(svc, listJobs, listJobsOp), svc); + Model out = new GlacierTransforms().transform(modelWith(svc, listJobs, listJobsOp), svc); MemberShape limit = out.expectShape(ShapeId.from(NS + "#ListJobsInput"), StructureShape.class) .getMember("limit").orElseThrow(); @@ -152,8 +150,8 @@ void isIdempotent() { StructureShape upload = streamingInput("UploadArchiveInput"); OperationShape uploadOp = op("UploadArchive", upload); ServiceShape svc = glacierService("Glacier", uploadOp); - Model once = GlacierTransforms.asTransform().apply(modelWith(svc, upload, uploadOp), svc); - Model twice = GlacierTransforms.asTransform().apply(once, svc); + Model once = new GlacierTransforms().transform(modelWith(svc, upload, uploadOp), svc); + Model twice = new GlacierTransforms().transform(once, svc); assertTrue(twice.expectShape(ShapeId.from(NS + "#UploadArchiveInput"), StructureShape.class) .hasTrait(AdditionalRequestHeadersTrait.class), diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java index def0b08b431..81034fc2313 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LambdaTransformsTest.java @@ -42,7 +42,7 @@ private static ServiceShape service(Model m) { @Test void removesInvokeAsyncOperationAndShapes() { Model m = lambdaModel("Lambda"); - Model out = LambdaTransforms.asTransform().apply(m, service(m)); + Model out = new LambdaTransforms().transform(m, service(m)); assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsync")).isEmpty()); assertTrue(out.getShape(ShapeId.from("com.example#InvokeAsyncRequest")).isEmpty()); @@ -54,7 +54,6 @@ void removesInvokeAsyncOperationAndShapes() { @Test void noOpForOtherService() { Model m = lambdaModel("SomeOther"); - Model out = LambdaTransforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new LambdaTransforms().shouldRun(service(m))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java index 6a96b92c588..aba0216fbf1 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/LongPollingTransformTest.java @@ -62,7 +62,7 @@ private static Model model(String sdkId, String... opNames) { @Test void sqsReceiveMessage_stampsOnlyReceiveMessageInput() { Model m = model("SQS", "ReceiveMessage", "SendMessage"); - Model out = LongPollingTransform.asTransform().apply(m, service(m)); + Model out = new LongPollingTransform().transform(m, service(m)); assertTrue(stamped(out, "ReceiveMessageRequest"), "SQS ReceiveMessage input must be stamped"); assertFalse(stamped(out, "SendMessageRequest"), @@ -72,7 +72,7 @@ void sqsReceiveMessage_stampsOnlyReceiveMessageInput() { @Test void swf_stampsBothPollOperations() { Model m = model("SWF", "PollForActivityTask", "PollForDecisionTask", "StartWorkflowExecution"); - Model out = LongPollingTransform.asTransform().apply(m, service(m)); + Model out = new LongPollingTransform().transform(m, service(m)); assertTrue(stamped(out, "PollForActivityTaskRequest"), "SWF PollForActivityTask input must be stamped"); assertTrue(stamped(out, "PollForDecisionTaskRequest"), @@ -84,7 +84,7 @@ void swf_stampsBothPollOperations() { @Test void sfnGetActivityTask_stampsInput() { Model m = model("SFN", "GetActivityTask", "StartExecution"); - Model out = LongPollingTransform.asTransform().apply(m, service(m)); + Model out = new LongPollingTransform().transform(m, service(m)); assertTrue(stamped(out, "GetActivityTaskRequest"), "SFN GetActivityTask input must be stamped"); assertFalse(stamped(out, "StartExecutionRequest"), @@ -94,9 +94,7 @@ void sfnGetActivityTask_stampsInput() { @Test void unrelatedService_stampsNothing() { Model m = model("DynamoDB", "GetItem", "ReceiveMessage"); - Model out = LongPollingTransform.asTransform().apply(m, service(m)); - assertSame(m, out, "an unrelated service must leave the model untouched"); - assertFalse(stamped(out, "ReceiveMessageRequest"), - "an operation on an unrelated service must not be stamped even if its name matches"); + assertFalse(new LongPollingTransform().shouldRun(service(m)), + "an unrelated service must not run even if an operation name matches"); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java index b8b2e9f35d1..b5678579cee 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3ControlTransformsTest.java @@ -34,7 +34,7 @@ static ServiceShape service(Model m) { @Test void marksResultShapesWithHostIdTrait() { Model m = model("S3 Control"); - Model out = S3ControlTransforms.asTransform().apply(m, service(m)); + Model out = new S3ControlTransforms().transform(m, service(m)); assertTrue(out.expectShape(ShapeId.from(NS + "#CreateAccessPointResult")) .hasTrait(TopLevelHostIdTrait.class), "result shape marked"); } @@ -42,7 +42,6 @@ void marksResultShapesWithHostIdTrait() { @Test void noOpForOtherService() { Model m = model("SomethingElse"); - Model out = S3ControlTransforms.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new S3ControlTransforms().shouldRun(service(m))); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java index 89e52711383..b4d560f86ec 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/S3TransformsTest.java @@ -43,9 +43,7 @@ void noOpForOtherService() { ServiceShape svc = ServiceShape.builder().id("com.amazonaws.other#Other").version("1") .addTrait(ServiceTrait.builder().sdkId("Other").arnNamespace("other") .cloudFormationName("Other").cloudTrailEventSource("other").build()).build(); - Model m = Model.builder().addShape(svc).build(); - Model out = S3Transforms.asTransform().apply(m, svc); - assertSame(m, out, "non-s3 service must be untouched"); + assertFalse(new S3Transforms().shouldRun(svc), "non-s3 service must not run"); } @Test @@ -53,7 +51,7 @@ void noOpForS3WhenNothingToDo() { ServiceShape svc = s3Service("S3"); Model m = modelWith(svc); // Scaffold has no sub-transforms yet: s3 model returns unchanged (structurally equal). - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); assertNotNull(out); assertTrue(out.getShape(ShapeId.from(NS + "#AmazonS3")).isPresent()); } @@ -74,7 +72,7 @@ void renamesCopyObjectResultShapeAndMember() { StructureShape copyOutput = StructureShape.builder().id(NS + "#CopyObjectOutput") .addMember("CopyObjectResult", copyResult.getId()).build(); Model m = modelWith(svc, copyResult, copyOutput); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); assertTrue(out.getShape(ShapeId.from(NS + "#CopyObjectResultDetails")).isPresent(), "shape renamed to CopyObjectResultDetails"); @@ -100,7 +98,7 @@ void copyObjectResultRename_throwsOnCollision() { StructureShape details = StructureShape.builder().id(NS + "#CopyObjectResultDetails") .addMember("Other", ShapeId.from("smithy.api#String")).build(); Model m = modelWith(svc, copyResult, details); - assertThrows(IllegalStateException.class, () -> S3Transforms.asTransform().apply(m, svc)); + assertThrows(IllegalStateException.class, () -> new S3Transforms().transform(m, svc)); } /** PutObject-style op whose input and output both carry a {@code string} {@code Expires} member. */ @@ -134,7 +132,7 @@ void retypesExpiresShapeToTimestamp() { Model m = expiresModel(); assertTrue(m.expectShape(ShapeId.from(NS + "#Expires")).isStringShape(), "precondition: Expires starts as a string"); - Model out = S3Transforms.asTransform().apply(m, expiresService(m)); + Model out = new S3Transforms().transform(m, expiresService(m)); assertTrue(out.expectShape(ShapeId.from(NS + "#Expires")) instanceof TimestampShape, "Expires retyped to a timestamp shape"); StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); @@ -172,7 +170,7 @@ void retypesPartNumberMarkersToInteger() { assertTrue(m.expectShape(ShapeId.from(NS + "#NextPartNumberMarker")).isStringShape(), "precondition: NextPartNumberMarker starts as a string"); ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); assertTrue(out.expectShape(ShapeId.from(NS + "#PartNumberMarker")) instanceof IntegerShape, "PartNumberMarker retyped to integer to preserve the shipped C2J int API"); assertTrue(out.expectShape(ShapeId.from(NS + "#NextPartNumberMarker")) instanceof IntegerShape, @@ -189,7 +187,7 @@ void marksOverrideStreamingRequests() { StructureShape policy = StructureShape.builder().id(NS + "#PutBucketPolicyRequest").build(); StructureShape other = StructureShape.builder().id(NS + "#GetObjectRequest").build(); ServiceShape svc = s3Service("S3"); - Model out = S3Transforms.asTransform().apply(modelWith(svc, put, policy, other), svc); + Model out = new S3Transforms().transform(modelWith(svc, put, policy, other), svc); assertTrue(out.expectShape(put.getId()).hasTrait(OverrideStreamingTrait.class), "PutObjectAnnotationRequest is in REQUESTS_TO_OVERRIDE_STREAMING"); assertTrue(out.expectShape(policy.getId()).hasTrait(OverrideStreamingTrait.class), @@ -232,7 +230,7 @@ private static Model checksumModel(boolean withAlgorithmMember) { void marksChecksumMembersOnRequestWithChecksumAlgorithm() { Model m = checksumModel(true); ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); StructureShape req = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); assertEquals("CRC32", req.getMember("ChecksumCRC32").orElseThrow().expectTrait(ChecksumMemberTrait.class).getValue()); @@ -249,7 +247,7 @@ void marksChecksumMembersOnRequestWithChecksumAlgorithm() { void doesNotMarkChecksumMembersWithoutChecksumAlgorithm() { Model m = checksumModel(false); ServiceShape svc = m.expectShape(ShapeId.from(NS + "#AmazonS3"), ServiceShape.class); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); StructureShape req = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); assertFalse(req.getMember("ChecksumCRC32").orElseThrow().hasTrait(ChecksumMemberTrait.class), "no ChecksumAlgorithm member => C2J does not flag the checksum members"); @@ -258,7 +256,7 @@ void doesNotMarkChecksumMembersWithoutChecksumAlgorithm() { @Test void addsExpiresStringToOutputAndDeprecatesExpires() { Model m = expiresModel(); - Model out = S3Transforms.asTransform().apply(m, expiresService(m)); + Model out = new S3Transforms().transform(m, expiresService(m)); assertTrue(out.getShape(ShapeId.from(NS + "#ExpiresString")).isPresent(), "ExpiresString string shape injected"); @@ -276,7 +274,7 @@ void addsExpiresStringToOutputAndDeprecatesExpires() { @Test void doesNotAddExpiresStringToInput() { Model m = expiresModel(); - Model out = S3Transforms.asTransform().apply(m, expiresService(m)); + Model out = new S3Transforms().transform(m, expiresService(m)); StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); assertFalse(input.getMember("ExpiresString").isPresent(), @@ -296,7 +294,7 @@ void appendsMissingBucketLocationConstraintRegions() { .addMember("us_west_2", "us-west-2") .build(); Model m = modelWith(svc, enumShape); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); software.amazon.smithy.model.shapes.EnumShape result = out.expectShape( ShapeId.from(NS + "#BucketLocationConstraint"), @@ -324,8 +322,8 @@ void bucketLocationConstraintExpansionIsIdempotent() { .addMember("us_west_2", "us-west-2") .build(); Model m = modelWith(svc, enumShape); - Model once = S3Transforms.asTransform().apply(m, svc); - Model twice = S3Transforms.asTransform().apply(once, svc); + Model once = new S3Transforms().transform(m, svc); + Model twice = new S3Transforms().transform(once, svc); software.amazon.smithy.model.shapes.EnumShape result = twice.expectShape( ShapeId.from(NS + "#BucketLocationConstraint"), software.amazon.smithy.model.shapes.EnumShape.class); @@ -346,7 +344,7 @@ void normalizesReplicationStatusCompleteToCompleted() { .addMember("COMPLETED", "COMPLETED") .build(); Model m = modelWith(svc, enumShape); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); java.util.List values = com.amazonaws.util.awsclientsmithygenerator.generators.model .EnumRenderer.getEnumValues(out.expectShape(ShapeId.from(NS + "#ReplicationStatus"))); @@ -360,7 +358,7 @@ void injectsGetObjectId2Only() { StructureShape getObjectOutput = StructureShape.builder().id(NS + "#GetObjectOutput") .addMember("ETag", ShapeId.from("smithy.api#String")).build(); Model m = modelWith(svc, getObjectOutput); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); assertTrue(out.getShape(ShapeId.from(NS + "#ObjectId2")).isPresent()); StructureShape outShape = out.expectShape(ShapeId.from(NS + "#GetObjectOutput"), StructureShape.class); @@ -402,7 +400,7 @@ private static ServiceShape s3ServiceOf(Model m) { @Test void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { Model m = accessLogModel(); - Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + Model out = new S3Transforms().transform(m, s3ServiceOf(m)); StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); MemberShape tag = input.getMember("customizedAccessLogTag").orElseThrow(); @@ -426,7 +424,7 @@ void injectsCustomizedAccessLogTagIntoRequestAsStringMapAppendedLast() { @Test void stampsCustomizedAccessLogTagMarkerAndKeepsQueryParams() { Model m = accessLogModel(); - Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + Model out = new S3Transforms().transform(m, s3ServiceOf(m)); StructureShape input = out.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); MemberShape tag = input.getMember("customizedAccessLogTag").orElseThrow(); @@ -443,7 +441,7 @@ void stampsCustomizedAccessLogTagMarkerAndKeepsQueryParams() { @Test void doesNotInjectCustomizedAccessLogTagIntoOutput() { Model m = accessLogModel(); - Model out = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); + Model out = new S3Transforms().transform(m, s3ServiceOf(m)); StructureShape output = out.expectShape(ShapeId.from(NS + "#PutObjectOutput"), StructureShape.class); assertFalse(output.getMember("customizedAccessLogTag").isPresent(), @@ -458,7 +456,7 @@ void stampsEmbeddedErrorsTraitOnRequestInC2jSet() { StructureShape notInSet = StructureShape.builder().id(NS + "#SomeOtherRequest") .addMember("Bucket", ShapeId.from("smithy.api#String")).build(); Model m = modelWith(svc, inSet, notInSet); - Model out = S3Transforms.asTransform().apply(m, svc); + Model out = new S3Transforms().transform(m, svc); StructureShape marked = out.expectShape(ShapeId.from(NS + "#CreateSessionRequest"), StructureShape.class); assertTrue(marked.hasTrait(EmbeddedErrorsTrait.class), @@ -471,8 +469,8 @@ void stampsEmbeddedErrorsTraitOnRequestInC2jSet() { @Test void accessLogTagInjectionIsIdempotent() { Model m = accessLogModel(); - Model once = S3Transforms.asTransform().apply(m, s3ServiceOf(m)); - Model twice = S3Transforms.asTransform().apply(once, s3ServiceOf(once)); + Model once = new S3Transforms().transform(m, s3ServiceOf(m)); + Model twice = new S3Transforms().transform(once, s3ServiceOf(once)); StructureShape input = twice.expectShape(ShapeId.from(NS + "#PutObjectRequest"), StructureShape.class); long count = input.getAllMembers().keySet().stream() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java index 4e41dcdb333..4b20eafdac2 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SourceRegionTransformTest.java @@ -46,7 +46,7 @@ private static ServiceShape service(Model m) { @Test void injectsSourceRegionIntoRdsRequest() { Model m = modelWithOp("RDS", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); - Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + Model out = new SourceRegionTransform().transform(m, service(m)); StructureShape req = out.expectShape( ShapeId.from("com.example#CopyDBClusterSnapshotRequest"), StructureShape.class); @@ -58,7 +58,7 @@ void injectsSourceRegionIntoRdsRequest() { @Test void noOpForUntargetedOperation() { Model m = modelWithOp("RDS", "DescribeDBClusters", "DescribeDBClustersRequest"); - Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + Model out = new SourceRegionTransform().transform(m, service(m)); assertTrue(out.expectShape(ShapeId.from("com.example#DescribeDBClustersRequest"), StructureShape.class).getMember("SourceRegion").isEmpty()); } @@ -66,15 +66,14 @@ void noOpForUntargetedOperation() { @Test void noOpForUntargetedService() { Model m = modelWithOp("SomeOther", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); - Model out = SourceRegionTransform.asTransform().apply(m, service(m)); - assertSame(m, out); + assertFalse(new SourceRegionTransform().shouldRun(service(m))); } @Test void idempotent_doesNotDuplicateExistingMember() { Model m = modelWithOp("RDS", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotRequest"); - Model once = SourceRegionTransform.asTransform().apply(m, service(m)); - Model twice = SourceRegionTransform.asTransform().apply(once, service(once)); + Model once = new SourceRegionTransform().transform(m, service(m)); + Model twice = new SourceRegionTransform().transform(once, service(once)); long count = twice.expectShape(ShapeId.from("com.example#CopyDBClusterSnapshotRequest"), StructureShape.class).members().stream() .filter(mem -> mem.getMemberName().equals("SourceRegion")).count(); @@ -84,7 +83,7 @@ void idempotent_doesNotDuplicateExistingMember() { @Test void injectsSourceRegionIntoDocDbRequest() { Model m = modelWithOp("DocDB", "CreateDBCluster", "CreateDBClusterMessage"); - Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + Model out = new SourceRegionTransform().transform(m, service(m)); assertTrue(out.expectShape(ShapeId.from("com.example#CreateDBClusterMessage"), StructureShape.class).getMember("SourceRegion").isPresent()); } @@ -92,7 +91,7 @@ void injectsSourceRegionIntoDocDbRequest() { @Test void injectsSourceRegionIntoNeptuneRequest() { Model m = modelWithOp("Neptune", "CopyDBClusterSnapshot", "CopyDBClusterSnapshotMessage"); - Model out = SourceRegionTransform.asTransform().apply(m, service(m)); + Model out = new SourceRegionTransform().transform(m, service(m)); assertTrue(out.expectShape(ShapeId.from("com.example#CopyDBClusterSnapshotMessage"), StructureShape.class).getMember("SourceRegion").isPresent()); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java index 60196800cb1..91eec74c160 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SqsTransformsTest.java @@ -39,7 +39,7 @@ void addsValuesToEnumShape() { Model m = Model.assembler().addShapes(enumShape, sqsService()).assemble().unwrap(); ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); - Model out = SqsTransforms.asTransform().apply(m, svc); + Model out = new SqsTransforms().transform(m, svc); List values = EnumRenderer.getEnumValues( out.expectShape(ShapeId.from("com.example#QueueAttributeName"))); assertTrue(values.containsAll(ADDED)); @@ -58,7 +58,7 @@ void addsValuesToStringEnumTrait() { Model m = Model.assembler().addShapes(s, sqsService()).assemble().unwrap(); ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); - Model out = SqsTransforms.asTransform().apply(m, svc); + Model out = new SqsTransforms().transform(m, svc); List values = EnumRenderer.getEnumValues( out.expectShape(ShapeId.from("com.example#QueueAttributeName"))); assertTrue(values.containsAll(ADDED)); @@ -81,8 +81,8 @@ void idempotent() { Model m = Model.assembler().addShapes(enumShape, sqsService()).assemble().unwrap(); ServiceShape svc = m.expectShape(ShapeId.from("com.example#TestService"), ServiceShape.class); - Model once = SqsTransforms.asTransform().apply(m, svc); - Model twice = SqsTransforms.asTransform().apply(once, svc); + Model once = new SqsTransforms().transform(m, svc); + Model twice = new SqsTransforms().transform(once, svc); long senderId = EnumRenderer.getEnumValues( twice.expectShape(ShapeId.from("com.example#QueueAttributeName"))) .stream().filter("SenderId"::equals).count(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java index 6143b4b6b0c..78960b1adcc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/SupportsPresigningTransformTest.java @@ -76,7 +76,7 @@ private static ServiceTrait pollyServiceTrait() { @Test void queryXmlService_stampsEveryOperation() { Model m = twoOpModel(new AwsQueryTrait(), null, "GetUser", "CreateUser"); - Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + Model out = new SupportsPresigningTransform().transform(m, service(m)); assertTrue(stamped(out, "GetUser"), "query operation must be stamped"); assertTrue(stamped(out, "CreateUser"), "query operation must be stamped"); } @@ -84,7 +84,7 @@ void queryXmlService_stampsEveryOperation() { @Test void ec2Service_stampsEveryOperation() { Model m = twoOpModel(new Ec2QueryTrait(), null, "DescribeThings", "RunThings"); - Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + Model out = new SupportsPresigningTransform().transform(m, service(m)); assertTrue(stamped(out, "DescribeThings"), "ec2 operation must be stamped"); assertTrue(stamped(out, "RunThings"), "ec2 operation must be stamped"); } @@ -94,7 +94,7 @@ void queryXmlService_stampsUnitInputOperation() { // The regression: a Unit-input query op (e.g. iam GetAccountSummary) cannot stamp the shared // Unit input shape, but the operation itself carries the trait so decl+impl stay symmetric. Model m = opPlusUnitInputModel(new AwsQueryTrait(), "ListUsers", "GetAccountSummary"); - Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + Model out = new SupportsPresigningTransform().transform(m, service(m)); assertTrue(stamped(out, "ListUsers"), "normal-input query operation must be stamped"); assertTrue(stamped(out, "GetAccountSummary"), "Unit-input query operation must be stamped on the operation itself"); @@ -104,7 +104,7 @@ void queryXmlService_stampsUnitInputOperation() { void pollyService_stampsOnlySynthesizeSpeechOperation() { Model m = twoOpModel(RestJson1Trait.builder().build(), pollyServiceTrait(), "SynthesizeSpeech", "DescribeVoices"); - Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + Model out = new SupportsPresigningTransform().transform(m, service(m)); assertTrue(stamped(out, "SynthesizeSpeech"), "Polly SynthesizeSpeech must be stamped"); assertFalse(stamped(out, "DescribeVoices"), "Polly must stamp only SynthesizeSpeech, not other operations"); @@ -113,7 +113,7 @@ void pollyService_stampsOnlySynthesizeSpeechOperation() { @Test void plainRestJsonService_stampsNothing() { Model m = twoOpModel(RestJson1Trait.builder().build(), null, "GetThing", "PutThing"); - Model out = SupportsPresigningTransform.asTransform().apply(m, service(m)); + Model out = new SupportsPresigningTransform().transform(m, service(m)); assertSame(m, out, "a non-query, non-Polly rest-json service must be left untouched"); assertFalse(stamped(out, "GetThing")); assertFalse(stamped(out, "PutThing")); From 379184add897edb362e4d1c3dd8770236b0cc217 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Wed, 2 Sep 2026 15:54:06 -0400 Subject: [PATCH 44/53] slash some comments out --- .../generators/model/ModelTransform.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java index 105367c4451..cb8157f79bc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelTransform.java @@ -10,20 +10,11 @@ /** * A model-to-model transform applied before code generation. Transforms run in sequence, * each receiving the previous transform's output (or the original model for the first). - * - *

{@link #shouldRun} is the service-level gate and defaults to {@code false}: a transform runs - * only when it explicitly opts in by overriding it — a service check, or {@code true} for transforms - * that apply to every service. This fails closed, so a transform added without a gate silently - * no-ops instead of running for every service and mutating models it was never meant to touch. When - * {@code shouldRun} returns true, {@code transform} may assume it applies and need not re-check the - * service. */ public interface ModelTransform { /** - * Whether this transform applies to the given service. Evaluated by the pipeline before - * {@link #transform}; a false result skips the transform. Defaults to {@code false}, so a - * transform must override this to run — either a service check or {@code true} to run always. + * Whether this transform applies to the given service. * * @param service the service shape being generated * @return true if {@link #transform} should be invoked for this service @@ -33,8 +24,7 @@ default boolean shouldRun(ServiceShape service) { } /** - * Applies this transform to the model. Only invoked when {@link #shouldRun} returns true, - * so implementations need not re-check the service. + * Applies this transform to the model. * * @param model the current model (may have been modified by earlier transforms) * @param service the service shape being generated From c7d2f2d76437bfd9c5d92d6e82dacf56e5fab011 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 12:00:17 -0400 Subject: [PATCH 45/53] Smithy: invert CloudFrontTransforms idempotency guard to avoid continue --- .../generators/model/ModelCodegenPlugin.java | 2 + .../transforms/CloudFrontTransforms.java | 63 +++++++++++++ .../transforms/CloudFrontTransformsTest.java | 92 +++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 1c9a1a7051b..4a44e188cd7 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -10,6 +10,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ApiGatewayV2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.CloudFrontTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.DynamoDbTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Ec2Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlacierTransforms; @@ -65,6 +66,7 @@ public void execute(PluginContext context) { new S3Transforms(), new S3ControlTransforms(), new GlacierTransforms(), + new CloudFrontTransforms(), new SupportsPresigningTransform(), new ChunkedEncodingTransform(), new LongPollingTransform() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java new file mode 100644 index 00000000000..56f4755c4bc --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java @@ -0,0 +1,63 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.HashMap; +import java.util.Map; + +/** + * CloudFront C2J parity. C2J names each operation with the API version baked into the wire Action + * (e.g. {@code AssociateAlias2020_05_31}), so the generated request/result classes carry that + * suffix ({@code AssociateAlias2020_05_31Request}/{@code ...Result}). The Smithy model names + * operations cleanly ({@code AssociateAlias}) and keeps the version only on the service + * ({@code version: "2020-05-31"}), which would emit clean class names and break public-API parity. + * This renames every contained operation to append the underscore-joined version suffix; request and + * result class/file names derive from the operation name, so the suffix flows through automatically. + * + *

Only operation shapes are renamed. The input/output structures fold into the request/result + * classes (not emitted standalone) and domain structs (e.g. {@code Distribution}) must keep clean + * names, matching C2J. Self-guards on service name (excludes cloudfront-keyvaluestore) and is + * idempotent (skips operations already carrying the suffix). + */ +public final class CloudFrontTransforms implements ModelTransform { + + @Override + public boolean shouldRun(ServiceShape service) { + return "cloudfront".equals(ServiceNameUtil.getSmithyServiceName(service, null)); + } + + @Override + public Model transform(Model model, ServiceShape service) { + String suffix = service.getVersion().replace("-", "_"); + + Map renames = new HashMap<>(); + for (OperationShape operation : TopDownIndex.of(model).getContainedOperations(service)) { + ShapeId opId = operation.getId(); + // Skip operations already carrying the suffix (idempotent). + if (!opId.getName().endsWith(suffix)) { + ShapeId targetId = ShapeId.fromParts(opId.getNamespace(), opId.getName() + suffix); + if (model.getShape(targetId).filter(shape -> !shape.getId().equals(opId)).isPresent()) { + throw new IllegalStateException("CloudFront operation version-suffix rename collision: '" + + targetId + "' already exists (would clobber '" + opId + + "'). Upstream model likely changed; review the CloudFront transform."); + } + renames.put(opId, targetId); + } + } + if (renames.isEmpty()) { + return model; + } + return ModelTransformer.create().renameShapes(model, renames); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java new file mode 100644 index 00000000000..cc060e0c26c --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java @@ -0,0 +1,92 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class CloudFrontTransformsTest { + + private static final String NS = "com.amazonaws.cloudfront"; + + private static Model cloudFrontModel(String sdkId, String version) { + StructureShape in = StructureShape.builder().id(NS + "#AssociateAliasRequest").build(); + StructureShape out = StructureShape.builder().id(NS + "#AssociateAliasResult").build(); + OperationShape op = OperationShape.builder().id(NS + "#AssociateAlias") + .input(in.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id(NS + "#Cloudfront2020_05_31").version(version) + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("cloudfront") + .cloudFormationName("CloudFront").cloudTrailEventSource("cloudfront.amazonaws.com").build()) + .addOperation(op.getId()) + .build(); + return Model.assembler().addShapes(in, out, op, service).assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from(NS + "#Cloudfront2020_05_31"), ServiceShape.class); + } + + @Test + void suffixesOperationNameWithApiVersion() { + Model m = cloudFrontModel("CloudFront", "2020-05-31"); + Model out = new CloudFrontTransforms().transform(m, service(m)); + + ShapeId suffixed = ShapeId.from(NS + "#AssociateAlias2020_05_31"); + assertTrue(out.getShape(suffixed).isPresent(), "operation must be renamed with version suffix"); + assertFalse(out.getShape(ShapeId.from(NS + "#AssociateAlias")).isPresent(), + "clean operation name must no longer exist"); + assertTrue(service(out).getOperations().contains(suffixed), + "service must reference the suffixed operation"); + } + + @Test + void doesNotRenameInputOrOutputStructures() { + Model m = cloudFrontModel("CloudFront", "2020-05-31"); + Model out = new CloudFrontTransforms().transform(m, service(m)); + + assertTrue(out.getShape(ShapeId.from(NS + "#AssociateAliasRequest")).isPresent(), + "input structure must keep its clean name (it folds into the request class)"); + assertTrue(out.getShape(ShapeId.from(NS + "#AssociateAliasResult")).isPresent(), + "output structure must keep its clean name"); + } + + @Test + void noOpForOtherService() { + StructureShape in = StructureShape.builder().id("com.example#DoThingRequest").build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing").input(in.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id("com.example#KvsService").version("2022-07-26") + .addTrait(ServiceTrait.builder().sdkId("CloudFront KeyValueStore").arnNamespace("cloudfront-keyvaluestore") + .cloudFormationName("CloudFrontKeyValueStore").cloudTrailEventSource("cloudfront-keyvaluestore.amazonaws.com").build()) + .addOperation(op.getId()) + .build(); + Model m = Model.assembler().addShapes(in, op, service).assemble().unwrap(); + ServiceShape svc = m.expectShape(ShapeId.from("com.example#KvsService"), ServiceShape.class); + + assertFalse(new CloudFrontTransforms().shouldRun(svc), + "cloudfront-keyvaluestore is a separate service and must not run"); + } + + @Test + void idempotentDoesNotDoubleSuffix() { + Model m = cloudFrontModel("CloudFront", "2020-05-31"); + Model once = new CloudFrontTransforms().transform(m, service(m)); + Model twice = new CloudFrontTransforms().transform(once, service(once)); + + assertTrue(twice.getShape(ShapeId.from(NS + "#AssociateAlias2020_05_31")).isPresent()); + assertFalse(twice.getShape(ShapeId.from(NS + "#AssociateAlias2020_05_312020_05_31")).isPresent(), + "running twice must not append the suffix again"); + } +} From e1d17bfc8d78ca04e748a8dc38d304c92d92ce80 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 13:41:26 -0400 Subject: [PATCH 46/53] Smithy: keep GetServiceRequestName unsuffixed for version-renamed operations (CloudFront) --- .../model/renderers/RequestRenderer.java | 8 +++- .../transforms/CloudFrontTransforms.java | 16 +++++++- .../transforms/ServiceRequestNameTrait.java | 25 ++++++++++++ .../generators/model/RequestRendererTest.java | 38 +++++++++++++++++++ .../transforms/CloudFrontTransformsTest.java | 12 ++++++ 5 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ServiceRequestNameTrait.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java index 37ef5369a2b..fb7fc26761e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/RequestRenderer.java @@ -17,6 +17,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ChunkedEncodingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LongPollingTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.OverrideStreamingTrait; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.ServiceRequestNameTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SupportsPresigningTrait; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.Emit; import com.amazonaws.util.awsclientsmithygenerator.generators.model.renderers.endpointcontext.SmithyEndpointsJmesPathVisitor; @@ -134,8 +135,13 @@ private void renderHeader(CppWriterDelegator writerDelegator, writer.write("// each operation should has unique request name, so that we can get operation's name from this request."); writer.write("// Note: this is not true for response, multiple operations may have the same response name,"); writer.write("// so we can not get operation's name from response."); + // Logical operation name (metrics/telemetry) — stays unsuffixed even when the class + // name is version-suffixed (e.g. CloudFront), matching C2J. ServiceRequestNameTrait + // carries the clean name for operations a transform renamed for C++ identity. writer.write("inline virtual const char* GetServiceRequestName() const override { return \"$L\"; }", - operation.getId().getName()); + operation.getTrait(ServiceRequestNameTrait.class) + .map(ServiceRequestNameTrait::getValue) + .orElse(operation.getId().getName())); writer.write(""); if (streamingRequest) { writer.write("inline virtual bool IsEventStreamRequest() const override { return true; }"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java index 56f4755c4bc..d1f15d8610d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java @@ -10,10 +10,13 @@ import software.amazon.smithy.model.knowledge.TopDownIndex; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.transform.ModelTransformer; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -42,6 +45,8 @@ public Model transform(Model model, ServiceShape service) { String suffix = service.getVersion().replace("-", "_"); Map renames = new HashMap<>(); + // suffixed operation id -> its clean (pre-rename) name, for GetServiceRequestName. + Map cleanNames = new HashMap<>(); for (OperationShape operation : TopDownIndex.of(model).getContainedOperations(service)) { ShapeId opId = operation.getId(); // Skip operations already carrying the suffix (idempotent). @@ -53,11 +58,20 @@ public Model transform(Model model, ServiceShape service) { + "'). Upstream model likely changed; review the CloudFront transform."); } renames.put(opId, targetId); + cleanNames.put(targetId, opId.getName()); } } if (renames.isEmpty()) { return model; } - return ModelTransformer.create().renameShapes(model, renames); + Model renamed = ModelTransformer.create().renameShapes(model, renames); + // Stamp AFTER the rename: renameShapes does not preserve a definition-less internal trait. + // ServiceRequestNameTrait keeps GetServiceRequestName unsuffixed (matches C2J). + List stamped = new ArrayList<>(); + cleanNames.forEach((suffixedId, cleanName) -> + stamped.add(renamed.expectShape(suffixedId, OperationShape.class).toBuilder() + .addTrait(new ServiceRequestNameTrait(cleanName)) + .build())); + return renamed.toBuilder().addShapes(stamped.toArray(new Shape[0])).build(); } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ServiceRequestNameTrait.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ServiceRequestNameTrait.java new file mode 100644 index 00000000000..0ffb2d80168 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/ServiceRequestNameTrait.java @@ -0,0 +1,25 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import software.amazon.smithy.model.SourceLocation; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.StringTrait; + +/** + * Internal marker (never declared in any model file) carrying the clean logical operation name for + * an operation whose shape id has been version-suffixed for C++ class/method naming (see + * {@link CloudFrontTransforms}). {@code GetServiceRequestName()} is the logical operation name used + * for metrics/telemetry and must stay unsuffixed — matching C2J, which suffixes the class/method + * identifiers but returns the clean name from {@code GetServiceRequestName()}. {@code RequestRenderer} + * emits this trait's value for a marked operation instead of the (suffixed) shape name. + */ +public final class ServiceRequestNameTrait extends StringTrait { + public static final ShapeId ID = ShapeId.from("aws.cpp.internal#serviceRequestName"); + + public ServiceRequestNameTrait(String cleanOperationName) { + super(ID, cleanOperationName, SourceLocation.NONE); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java index 4622ddb31d8..a2922b1da59 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/RequestRendererTest.java @@ -1047,6 +1047,44 @@ private static Model longPollingModel(boolean marked) { return Model.builder().addShapes(str, input, output, op, service).build(); } + // An operation whose shape id is version-suffixed (CloudFront-style) but stamped with the clean + // logical name via ServiceRequestNameTrait. + private static Model serviceRequestNameModel() { + StringShape str = StringShape.builder().id("com.example#String").build(); + StructureShape input = StructureShape.builder() + .id("com.example#DoThing2020_05_31Request").addMember("name", str.getId()).build(); + StructureShape output = StructureShape.builder() + .id("com.example#DoThing2020_05_31Output").addMember("result", str.getId()).build(); + OperationShape op = OperationShape.builder().id("com.example#DoThing2020_05_31") + .input(input.getId()).output(output.getId()) + .addTrait(new com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms + .ServiceRequestNameTrait("DoThing")) + .build(); + ServiceShape service = ServiceShape.builder().id("com.example#Example") + .version("2020-05-31").addOperation(op.getId()).build(); + return Model.builder().addShapes(str, input, output, op, service).build(); + } + + @Test + void serviceRequestNameTrait_keepsGetServiceRequestNameClean_whileClassStaysSuffixed() { + Model model = serviceRequestNameModel(); + ServiceShape service = model.expectShape(ShapeId.from("com.example#Example"), ServiceShape.class); + MockManifest manifest = new MockManifest(); + CppWriterDelegator delegator = new CppWriterDelegator(manifest); + Protocol protocol = ProtocolResolver.resolve(service, model); + new RequestRenderer(ShapeClassifier.classify(model, service, protocol).requests(), + new RenderContext(model, service, ProtocolResolver.traitsFor(protocol), + "Example", "AWS_EXAMPLE_API", "example")).render(delegator); + delegator.flushWriters(); + String h = manifest.getFileString(manifest.getFiles().stream() + .filter(p -> p.toString().endsWith("DoThing2020_05_31Request.h")).findFirst().orElseThrow()) + .orElseThrow(); + assertTrue(h.contains("GetServiceRequestName() const override { return \"DoThing\"; }"), + "GetServiceRequestName must return the clean name from the trait: " + h); + assertTrue(h.contains("class DoThing2020_05_31Request"), + "class name must keep the version suffix: " + h); + } + @Test void longPollingTrait_emitsIsLongPollingOperationTrue() { // C2J emits IsLongPollingOperation() -> true for a long-polling request; the marker (stamped diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java index cc060e0c26c..54633abffb9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java @@ -51,6 +51,18 @@ void suffixesOperationNameWithApiVersion() { "service must reference the suffixed operation"); } + @Test + void stampsCleanServiceRequestNameOnSuffixedOperation() { + Model m = cloudFrontModel("CloudFront", "2020-05-31"); + Model out = new CloudFrontTransforms().transform(m, service(m)); + + OperationShape suffixed = out.expectShape( + ShapeId.from(NS + "#AssociateAlias2020_05_31"), OperationShape.class); + assertEquals("AssociateAlias", + suffixed.expectTrait(ServiceRequestNameTrait.class).getValue(), + "renamed operation must carry the clean logical name for GetServiceRequestName"); + } + @Test void doesNotRenameInputOrOutputStructures() { Model m = cloudFrontModel("CloudFront", "2020-05-31"); From 125857f55080014e44088dee28129d380c743994 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 14:00:08 -0400 Subject: [PATCH 47/53] Smithy: retype route-53/cloudfront MaxItems/MaxResults pagination members back to string --- .../generators/model/ModelCodegenPlugin.java | 2 + .../transforms/CloudFrontTransforms.java | 68 ++++++++++++++++++ .../model/transforms/Route53Transforms.java | 57 +++++++++++++++ .../transforms/CloudFrontTransformsTest.java | 58 +++++++++++++++ .../transforms/Route53TransformsTest.java | 70 +++++++++++++++++++ 5 files changed, 255 insertions(+) create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53Transforms.java create mode 100644 tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53TransformsTest.java diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java index 4a44e188cd7..edc4553adcc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ModelCodegenPlugin.java @@ -17,6 +17,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.GlobalTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LambdaTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.LongPollingTransform; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.Route53Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3ControlTransforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.S3Transforms; import com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms.SourceRegionTransform; @@ -67,6 +68,7 @@ public void execute(PluginContext context) { new S3ControlTransforms(), new GlacierTransforms(), new CloudFrontTransforms(), + new Route53Transforms(), new SupportsPresigningTransform(), new ChunkedEncodingTransform(), new LongPollingTransform() diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java index d1f15d8610d..a330c732bdc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransforms.java @@ -8,6 +8,7 @@ import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.Shape; @@ -18,6 +19,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * CloudFront C2J parity. C2J names each operation with the API version baked into the wire Action @@ -32,9 +35,48 @@ * classes (not emitted standalone) and domain structs (e.g. {@code Distribution}) must keep clean * names, matching C2J. Self-guards on service name (excludes cloudfront-keyvaluestore) and is * idempotent (skips operations already carrying the suffix). + * + *

Also retypes the {@code MaxItems} pagination member back to string on an allowlist of request + * shapes: C2J ships those as {@code Aws::String}, but the Coral/Smithy model types them + * {@code smithy.api#Integer}, which would flip the accessors to {@code int} and break the public C++ + * API. The retype is scoped to the allowlist because other shapes ({@code int} in C2J) must stay int. */ public final class CloudFrontTransforms implements ModelTransform { + /** + * C2J ships these 27 request shapes' {@code MaxItems} as {@code Aws::String} while 32 other shapes + * (newer requests + list structs like {@code DistributionList}) ship {@code int}; retype only this + * allowlist so the whole-service retype does not flip the int ones and introduce a breaking change. + */ + private static final Set MAX_ITEMS_STRING_SHAPES = Set.of( + "ListCachePoliciesRequest", + "ListCloudFrontOriginAccessIdentitiesRequest", + "ListContinuousDeploymentPoliciesRequest", + "ListDistributionsByAnycastIpListIdRequest", + "ListDistributionsByCachePolicyIdRequest", + "ListDistributionsByKeyGroupRequest", + "ListDistributionsByOriginRequestPolicyIdRequest", + "ListDistributionsByOwnedResourceRequest", + "ListDistributionsByRealtimeLogConfigRequest", + "ListDistributionsByResponseHeadersPolicyIdRequest", + "ListDistributionsByTrustStoreRequest", + "ListDistributionsByVpcOriginIdRequest", + "ListDistributionsByWebACLIdRequest", + "ListDistributionsRequest", + "ListFieldLevelEncryptionConfigsRequest", + "ListFieldLevelEncryptionProfilesRequest", + "ListFunctionsRequest", + "ListInvalidationsRequest", + "ListKeyGroupsRequest", + "ListKeyValueStoresRequest", + "ListOriginAccessControlsRequest", + "ListOriginRequestPoliciesRequest", + "ListPublicKeysRequest", + "ListRealtimeLogConfigsRequest", + "ListResponseHeadersPoliciesRequest", + "ListStreamingDistributionsRequest", + "ListVpcOriginsRequest"); + @Override public boolean shouldRun(ServiceShape service) { return "cloudfront".equals(ServiceNameUtil.getSmithyServiceName(service, null)); @@ -42,6 +84,32 @@ public boolean shouldRun(ServiceShape service) { @Override public Model transform(Model model, ServiceShape service) { + return retypeMaxItemsToString(suffixOperationNames(model, service)); + } + + /** + * Retargets the {@code MaxItems} member to the prelude {@code smithy.api#String} on the + * {@link #MAX_ITEMS_STRING_SHAPES} allowlist only, skipping members already targeting a string + * shape. C2J ships those as {@code Aws::String}, but the Coral/Smithy model types them + * {@code smithy.api#Integer}, which would flip the accessors to {@code int} and break the public + * C++ API. The retype is scoped to the allowlist because other shapes ({@code int} in C2J) must + * stay int. Idempotent: returns the model unchanged when nothing needs retyping. + */ + private static Model retypeMaxItemsToString(Model model) { + ShapeId stringTarget = ShapeId.from("smithy.api#String"); + Set replacements = model.shapes(MemberShape.class) + .filter(member -> "MaxItems".equals(member.getMemberName())) + .filter(member -> MAX_ITEMS_STRING_SHAPES.contains(member.getContainer().getName())) + .filter(member -> !model.expectShape(member.getTarget()).isStringShape()) + .map(member -> member.toBuilder().target(stringTarget).build()) + .collect(Collectors.toSet()); + if (replacements.isEmpty()) { + return model; + } + return ModelTransformer.create().replaceShapes(model, new ArrayList<>(replacements)); + } + + private static Model suffixOperationNames(Model model, ServiceShape service) { String suffix = service.getVersion().replace("-", "_"); Map renames = new HashMap<>(); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53Transforms.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53Transforms.java new file mode 100644 index 00000000000..2056811d430 --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53Transforms.java @@ -0,0 +1,57 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import com.amazonaws.util.awsclientsmithygenerator.generators.ServiceNameUtil; +import com.amazonaws.util.awsclientsmithygenerator.generators.model.ModelTransform; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.transform.ModelTransformer; + +import java.util.ArrayList; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * Route 53 C2J parity. C2J ships the {@code MaxItems} and {@code MaxResults} pagination members as + * {@code Aws::String}, but the Coral/Smithy model types them {@code smithy.api#Integer}, which would + * flip the generated accessors to {@code int} and break the public C++ API. This retypes those + * members back to string. Self-guards on service name; idempotent when nothing needs retyping. + */ +public final class Route53Transforms implements ModelTransform { + + @Override + public boolean shouldRun(ServiceShape service) { + return "route-53".equals(ServiceNameUtil.getSmithyServiceName(service, null)); + } + + private static final Set STRING_MEMBER_NAMES = Set.of("MaxItems", "MaxResults"); + + @Override + public Model transform(Model model, ServiceShape service) { + return retypeMembersToString(model); + } + + /** + * Retargets every {@code MaxItems}/{@code MaxResults} member to the prelude {@code smithy.api#String}, + * skipping members already targeting a string shape. Idempotent: returns the model unchanged when + * nothing needs retyping. + */ + private static Model retypeMembersToString(Model model) { + ShapeId stringTarget = ShapeId.from("smithy.api#String"); + Set replacements = model.shapes(MemberShape.class) + .filter(member -> STRING_MEMBER_NAMES.contains(member.getMemberName())) + .filter(member -> !model.expectShape(member.getTarget()).isStringShape()) + .map(member -> member.toBuilder().target(stringTarget).build()) + .collect(Collectors.toSet()); + if (replacements.isEmpty()) { + return model; + } + return ModelTransformer.create().replaceShapes(model, new ArrayList<>(replacements)); + } +} diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java index 54633abffb9..42751814a1e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/CloudFrontTransformsTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.ShapeId; @@ -91,6 +92,63 @@ void noOpForOtherService() { "cloudfront-keyvaluestore is a separate service and must not run"); } + @Test + void retypesMaxItemsBackToString() { + StructureShape in = StructureShape.builder().id(NS + "#ListDistributionsRequest") + .addMember("MaxItems", ShapeId.from("smithy.api#Integer")) + .build(); + StructureShape out = StructureShape.builder().id(NS + "#ListDistributionsResult").build(); + OperationShape op = OperationShape.builder().id(NS + "#ListDistributions") + .input(in.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id(NS + "#Cloudfront2020_05_31").version("2020-05-31") + .addTrait(ServiceTrait.builder().sdkId("CloudFront").arnNamespace("cloudfront") + .cloudFormationName("CloudFront").cloudTrailEventSource("cloudfront.amazonaws.com").build()) + .addOperation(op.getId()) + .build(); + Model m = Model.assembler().addShapes(in, out, op, service).assemble().unwrap(); + + Model transformed = new CloudFrontTransforms().transform( + m, m.expectShape(ShapeId.from(NS + "#Cloudfront2020_05_31"), ServiceShape.class)); + + MemberShape maxItems = transformed.expectShape(ShapeId.from(NS + "#ListDistributionsRequest"), + StructureShape.class).getMember("MaxItems").orElseThrow(); + assertTrue(transformed.expectShape(maxItems.getTarget()).isStringShape(), + "MaxItems must be retyped to a string shape"); + } + + @Test + void doesNotRetypeMaxItemsOnNonAllowlistedShape() { + StructureShape in = StructureShape.builder().id(NS + "#ListAnycastIpListsRequest") + .addMember("MaxItems", ShapeId.from("smithy.api#Integer")) + .build(); + StructureShape out = StructureShape.builder().id(NS + "#ListAnycastIpListsResult").build(); + StructureShape distributionList = StructureShape.builder().id(NS + "#DistributionList") + .addMember("MaxItems", ShapeId.from("smithy.api#Integer")) + .build(); + OperationShape op = OperationShape.builder().id(NS + "#ListAnycastIpLists") + .input(in.getId()).output(out.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id(NS + "#Cloudfront2020_05_31").version("2020-05-31") + .addTrait(ServiceTrait.builder().sdkId("CloudFront").arnNamespace("cloudfront") + .cloudFormationName("CloudFront").cloudTrailEventSource("cloudfront.amazonaws.com").build()) + .addOperation(op.getId()) + .build(); + Model m = Model.assembler().addShapes(in, out, distributionList, op, service).assemble().unwrap(); + + Model transformed = new CloudFrontTransforms().transform( + m, m.expectShape(ShapeId.from(NS + "#Cloudfront2020_05_31"), ServiceShape.class)); + + MemberShape reqMaxItems = transformed.expectShape(ShapeId.from(NS + "#ListAnycastIpListsRequest"), + StructureShape.class).getMember("MaxItems").orElseThrow(); + assertFalse(transformed.expectShape(reqMaxItems.getTarget()).isStringShape(), + "MaxItems on a non-allowlisted request (int in C2J) must stay integer"); + MemberShape structMaxItems = transformed.expectShape(ShapeId.from(NS + "#DistributionList"), + StructureShape.class).getMember("MaxItems").orElseThrow(); + assertFalse(transformed.expectShape(structMaxItems.getTarget()).isStringShape(), + "MaxItems on a list struct (int in C2J) must stay integer"); + } + @Test void idempotentDoesNotDoubleSuffix() { Model m = cloudFrontModel("CloudFront", "2020-05-31"); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53TransformsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53TransformsTest.java new file mode 100644 index 00000000000..1803d06776c --- /dev/null +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/transforms/Route53TransformsTest.java @@ -0,0 +1,70 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package com.amazonaws.util.awsclientsmithygenerator.generators.model.transforms; + +import org.junit.jupiter.api.Test; +import software.amazon.smithy.aws.traits.ServiceTrait; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.MemberShape; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.StructureShape; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class Route53TransformsTest { + + private static final String NS = "com.amazonaws.route53"; + + // A List*Request carrying an integer MaxItems member, matching the type the Coral/Smithy model + // produces upstream (C2J ships it as Aws::String). + private static Model route53Model(String sdkId) { + StructureShape in = StructureShape.builder().id(NS + "#ListHostedZonesRequest") + .addMember("MaxItems", ShapeId.from("smithy.api#Integer")) + .build(); + OperationShape op = OperationShape.builder().id(NS + "#ListHostedZones") + .input(in.getId()).build(); + ServiceShape service = ServiceShape.builder() + .id(NS + "#Route53").version("2013-04-01") + .addTrait(ServiceTrait.builder().sdkId(sdkId).arnNamespace("route53") + .cloudFormationName("Route53").cloudTrailEventSource("route53.amazonaws.com").build()) + .addOperation(op.getId()) + .build(); + return Model.assembler().addShapes(in, op, service).assemble().unwrap(); + } + + private static ServiceShape service(Model m) { + return m.expectShape(ShapeId.from(NS + "#Route53"), ServiceShape.class); + } + + @Test + void retypesMaxItemsBackToString() { + Model m = route53Model("Route 53"); + Model out = new Route53Transforms().transform(m, service(m)); + + MemberShape maxItems = out.expectShape(ShapeId.from(NS + "#ListHostedZonesRequest"), + StructureShape.class).getMember("MaxItems").orElseThrow(); + assertTrue(out.expectShape(maxItems.getTarget()).isStringShape(), + "MaxItems must be retyped to a string shape"); + } + + @Test + void shouldRunForRoute53() { + Model m = route53Model("Route 53"); + assertTrue(new Route53Transforms().shouldRun(service(m)), + "sdkId 'Route 53' maps to smithy name 'route-53'"); + } + + @Test + void doesNotRunForOtherService() { + ServiceShape svc = ServiceShape.builder().id("com.amazonaws.other#Other").version("1") + .addTrait(ServiceTrait.builder().sdkId("Other").arnNamespace("other") + .cloudFormationName("Other").cloudTrailEventSource("other").build()).build(); + assertFalse(new Route53Transforms().shouldRun(svc), "non-route-53 service must not run"); + } +} From 41bbb2f003a9676e15638f83273d7c6cf2fbbcab Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 16:05:32 -0400 Subject: [PATCH 48/53] Smithy: delegate event-stream InitialResponse wiring to ProtocolTraits (rest-xml builds from XML root) --- .../model/protocol/CborProtocolTraits.java | 19 +++++++ .../model/protocol/JsonProtocolTraits.java | 19 +++++++ .../model/protocol/ProtocolTraits.java | 33 ++++++++++++ .../model/protocol/RestXmlProtocolTraits.java | 8 +++ .../model/renderers/EventStreamRenderer.java | 13 +++-- .../model/EventStreamRendererTest.java | 54 +++++++++++++++++-- .../protocol/CborProtocolTraitsTest.java | 18 +++++++ .../protocol/JsonProtocolTraitsTest.java | 18 +++++++ .../model/protocol/XmlProtocolTraitsTest.java | 19 +++++++ 9 files changed, 191 insertions(+), 10 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java index a406574efaf..1d6c919361d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java @@ -163,6 +163,25 @@ public void writeResultSerdeImpls(CppWriter writer, String className, StructureS }); } + @Override + public void writeInitialResponseCtorDecl(CppWriter writer, String exportMacro, String className) { + // CBOR initial responses arrive as an event message with headers. + writer.write("$L $L(const Http::HeaderValueCollection& responseHeaders);", exportMacro, className); + } + + @Override + public void writeInitialResponseCtorImpl(CppWriter writer, String className) { + // Delegate to the default ctor so all members are value-initialized before the + // header-derived ones are set (matches C2J). + writer.openBlock("$1L::$1L(const Http::HeaderValueCollection& responseHeaders) : $1L() {", "}", + className, () -> writer.write("AWS_UNREFERENCED_PARAM(responseHeaders);")); + } + + @Override + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + writer.write("$L event(GetEventHeadersAsHttpHeaders());", className); + } + @Override public void writeRequestMethodDecls(CppWriter writer, String exportMacro, StructureShape shape, OperationShape operation, Model model) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index ce9f625a145..33739db5c26 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -175,6 +175,25 @@ public boolean serializesHttpBindingMembers() { return protocol == Protocol.REST_JSON; } + @Override + public void writeInitialResponseCtorDecl(CppWriter writer, String exportMacro, String className) { + // JSON initial responses arrive as an event message with headers. + writer.write("$L $L(const Http::HeaderValueCollection& responseHeaders);", exportMacro, className); + } + + @Override + public void writeInitialResponseCtorImpl(CppWriter writer, String className) { + // Delegate to the default ctor so all members are value-initialized before the + // header-derived ones are set (matches C2J). + writer.openBlock("$1L::$1L(const Http::HeaderValueCollection& responseHeaders) : $1L() {", "}", + className, () -> writer.write("AWS_UNREFERENCED_PARAM(responseHeaders);")); + } + + @Override + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + writer.write("$L event(GetEventHeadersAsHttpHeaders());", className); + } + @Override public void writeRequestMethodDecls(CppWriter writer, String exportMacro, StructureShape shape, OperationShape operation, Model model) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index c3c375ce9e5..ebb76efdbca 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -231,6 +231,39 @@ default void writeAddQueryStringParametersImpl(CppWriter writer, String classNam // Protocol-agnostic today; kept here so callers have one place to look. // ------------------------------------------------------------------ + /** + * Emits the extra {@code InitialResponse} constructor declaration that sits before the + * body serde method, beyond the body serde ctor already emitted by + * {@link #writeSerdeMethodDecls}. JSON/CBOR initial responses arrive as an event message with + * headers, so they add a {@code (const Http::HeaderValueCollection&)} ctor; REST-XML builds its + * initial response from the XML body root via its {@code XmlNode} serde ctor and adds nothing. + * + *

Default: no extra ctor (REST-XML / query-XML). + */ + default void writeInitialResponseCtorDecl(CppWriter writer, String exportMacro, String className) { + } + + /** + * Emits the body for the extra ctor declared by {@link #writeInitialResponseCtorDecl}. + * + *

Default: nothing (protocols with no extra ctor). + */ + default void writeInitialResponseCtorImpl(CppWriter writer, String className) { + } + + /** + * Emits the statement that builds the {@code event} local in the event-stream handler's + * {@code INITIAL_RESPONSE} case. JSON/CBOR build it from the event message headers; REST-XML + * builds it from the XML body root element. + * + *

Default: throws — a protocol with event streams must define how its initial response is + * constructed. (Query-XML has no event streams, so this is never reached.) + */ + default void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + throw new UnsupportedOperationException( + "Protocol " + protocol() + " does not define event-stream initial-response construction"); + } + /** * Emits a placeholder for an event-stream event case body: a TODO marker plus a * compilable callback invocation with a default-constructed event. diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index 9522dce53d1..d10d585e94d 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -150,6 +150,14 @@ public void writeResultSerdeImpls(CppWriter writer, String className, StructureS }); } + @Override + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + // REST-XML reuses its XmlNode serde ctor: the initial response is built from the XML body + // root element (C2J addEventStreamInitialResponse), not from event headers. No extra + // header-collection ctor is emitted (writeInitialResponseCtorDecl inherits the no-op default). + writer.write("$L event(xmlDoc.GetRootElement());", className); + } + @Override public void writeRequestMethodDecls(CppWriter writer, String exportMacro, StructureShape shape, OperationShape operation, Model model) { diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java index 805134b4a40..b179333afff 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java @@ -291,7 +291,7 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.openBlock("switch ($1LEventMapper::Get$1LEventTypeForName(eventTypeHeaderIter->second.GetEventHeaderValueAsString())) {", "}", opName, () -> { writer.openBlock("case $1LEventType::INITIAL_RESPONSE: {", "}", opName, () -> { - writer.write("$1LInitialResponse event(GetEventHeadersAsHttpHeaders());", opName); + ctx.protocolTraits().writeInitialResponseHandlerConstruction(writer, opName + "InitialResponse"); writer.write("m_onInitialResponse(event, Utils::Event::InitialResponseType::ON_EVENT);"); writer.write("break;"); }); @@ -444,9 +444,10 @@ private void renderInitialResponse(CppWriterDelegator writerDelegator, String op writer.write(""); writer.openBlock("class $L {", "};", className, () -> { writer.write("public:"); - // The header-collection ctor sits before the serialize method (mainline ordering). + // Any protocol-specific extra ctor (e.g. the JSON/CBOR header-collection ctor) sits + // before the serialize method (mainline ordering); REST-XML adds none. ctx.protocolTraits().writeSerdeMethodDecls(writer, ctx.exportMacro(), className, - () -> writer.write("$1L $2L(const Http::HeaderValueCollection& responseHeaders);", ctx.exportMacro(), className)); + () -> ctx.protocolTraits().writeInitialResponseCtorDecl(writer, ctx.exportMacro(), className)); // Accessors + private section for the result's non-streaming members. A memberless // InitialResponse ends right after its serde decls (no private:), matching C2J. if (hasMembers) { @@ -481,10 +482,8 @@ private void renderInitialResponse(CppWriterDelegator writerDelegator, String op writer.write(""); ctx.protocolTraits().writeSerdeMethodImpls(writer, className); writer.write(""); - // Delegate to the default ctor so all members are value-initialized before the - // header-derived ones are set (matches C2J). - writer.openBlock("$1L::$1L(const Http::HeaderValueCollection& responseHeaders) : $1L() {", "}", - className, () -> writer.write("AWS_UNREFERENCED_PARAM(responseHeaders);")); + // Any protocol-specific extra ctor impl (JSON/CBOR header-collection ctor); REST-XML adds none. + ctx.protocolTraits().writeInitialResponseCtorImpl(writer, className); writer.write(""); }); }); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java index 82925e48bd7..23dcaee451b 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/EventStreamRendererTest.java @@ -26,6 +26,15 @@ class EventStreamRendererTest { private static Model twoEventModel() { + return twoEventModel(false); + } + + /** + * @param restXml when true, stamps the service with {@code aws.protocols#restXml} so the + * renderer resolves to REST-XML (S3 {@code SelectObjectContent} shape); otherwise the + * service has no protocol trait and resolves to JSON. + */ + private static Model twoEventModel(boolean restXml) { StringShape str = StringShape.builder().id("com.example#String").build(); StructureShape eventA = StructureShape.builder() .id("com.example#AlphaEvent") @@ -79,11 +88,14 @@ private static Model twoEventModel() { .input(input.getId()) .output(output.getId()) .build(); - ServiceShape service = ServiceShape.builder() + ServiceShape.Builder serviceBuilder = ServiceShape.builder() .id("com.example#Example") .version("2024-01-01") - .addOperation(op.getId()) - .build(); + .addOperation(op.getId()); + if (restXml) { + serviceBuilder.addTrait(software.amazon.smithy.aws.traits.protocols.RestXmlTrait.builder().build()); + } + ServiceShape service = serviceBuilder.build(); return Model.builder().addShapes(str, stream, eventA, eventB, exc, modeledExc, input, output, op, service).build(); } @@ -351,6 +363,42 @@ void nonEmptyEventBehaviorUnchanged() { "non-empty event typedef unchanged: " + out); } + @Test + void restXmlInitialResponse_omitsHeaderCollectionCtor() { + // For a REST-XML event-stream op (S3 SelectObjectContent shape), the InitialResponse is built + // from the XML body root via its XmlNode serde ctor; no HeaderValueCollection ctor is emitted. + Model model = twoEventModel(true); + String h = render(model, "DoStreamInitialResponse.h"); + assertTrue(h.contains("class DoStreamInitialResponse"), "Missing class: " + h); + assertFalse(h.contains("HeaderValueCollection"), + "REST-XML InitialResponse must not emit a header-collection ctor: " + h); + assertTrue(h.contains("XmlNode"), "REST-XML InitialResponse keeps its XmlNode serde ctor: " + h); + + String c = render(model, "DoStreamInitialResponse.cpp"); + assertFalse(c.contains("HeaderValueCollection"), + "REST-XML InitialResponse source must not emit a header-collection ctor: " + c); + + String handler = render(model, "DoStreamHandler.cpp"); + assertTrue(handler.contains("DoStreamInitialResponse event(xmlDoc.GetRootElement());"), + "REST-XML handler builds the initial response from the XML root: " + handler); + assertFalse(handler.contains("GetEventHeadersAsHttpHeaders"), handler); + } + + @Test + void jsonInitialResponse_hasHeaderCollectionCtor() { + // For a JSON event-stream op, the InitialResponse arrives as an event message with headers, + // so it carries a HeaderValueCollection ctor and header-based handler construction. + Model model = twoEventModel(false); + String h = render(model, "DoStreamInitialResponse.h"); + assertTrue(h.contains("DoStreamInitialResponse(const Http::HeaderValueCollection& responseHeaders)"), + "JSON InitialResponse must emit the header-collection ctor: " + h); + + String handler = render(model, "DoStreamHandler.cpp"); + assertTrue(handler.contains("DoStreamInitialResponse event(GetEventHeadersAsHttpHeaders());"), + "JSON handler builds the initial response from event headers: " + handler); + assertFalse(handler.contains("xmlDoc"), handler); + } + @Test void emptyEventStructHeaderNotIncluded() { // An empty event's struct is dropped by the classifier, so including its header would dangle diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java index 4a1cea49663..64e25d7c3f9 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java @@ -208,4 +208,22 @@ void noInputRequest_returnsEmptyBracesAndOmitsContentType() { assertTrue(i.contains("headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);"), i); assertTrue(i.contains("headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);"), i); } + + @Test + void initialResponse_emitsHeaderCollectionCtorAndHeaderConstruction() { + // CBOR initial responses arrive as an event message with headers, like JSON. + String decl = render(w -> cbor.writeInitialResponseCtorDecl(w, "AWS_EX_API", "DoStreamInitialResponse")); + assertTrue(decl.contains( + "AWS_EX_API DoStreamInitialResponse(const Http::HeaderValueCollection& responseHeaders);"), decl); + + String impl = render(w -> cbor.writeInitialResponseCtorImpl(w, "DoStreamInitialResponse")); + assertTrue(impl.contains( + "DoStreamInitialResponse::DoStreamInitialResponse(const Http::HeaderValueCollection& " + + "responseHeaders) : DoStreamInitialResponse() {"), impl); + assertTrue(impl.contains("AWS_UNREFERENCED_PARAM(responseHeaders);"), impl); + + String handler = render(w -> cbor.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + assertTrue(handler.contains("DoStreamInitialResponse event(GetEventHeadersAsHttpHeaders());"), handler); + assertFalse(handler.contains("xmlDoc"), handler); + } } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 1e4755a7763..32469885517 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -265,6 +265,24 @@ void withoutSupportsPresigning_omitsDumpBodyToUrlImpl() { "non-presignable request must not emit a DumpBodyToUrl impl: " + i); } + @Test + void initialResponse_emitsHeaderCollectionCtorAndHeaderConstruction() { + // JSON initial responses arrive as an event message with headers. + String decl = render(w -> json.writeInitialResponseCtorDecl(w, "AWS_EX_API", "DoStreamInitialResponse")); + assertTrue(decl.contains( + "AWS_EX_API DoStreamInitialResponse(const Http::HeaderValueCollection& responseHeaders);"), decl); + + String impl = render(w -> json.writeInitialResponseCtorImpl(w, "DoStreamInitialResponse")); + assertTrue(impl.contains( + "DoStreamInitialResponse::DoStreamInitialResponse(const Http::HeaderValueCollection& " + + "responseHeaders) : DoStreamInitialResponse() {"), impl); + assertTrue(impl.contains("AWS_UNREFERENCED_PARAM(responseHeaders);"), impl); + + String handler = render(w -> json.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + assertTrue(handler.contains("DoStreamInitialResponse event(GetEventHeadersAsHttpHeaders());"), handler); + assertFalse(handler.contains("xmlDoc"), handler); + } + @Test void payloadStubs_areProtocolAgnostic() { String event = render(w -> json.writeEventPayloadDecode(w, "ShardEvent", "m_onShardEvent")); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index a9778cae485..cf6a98aac82 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -124,6 +124,25 @@ void restXml_serdeMethodDecls_runsHookBeforeSerializeMethod() { "Hook must run before the serialize method: " + out); } + // ---------- REST_XML: event-stream initial response ---------- + + @Test + void restXml_initialResponse_omitsHeaderCollectionCtor_buildsFromXmlRoot() { + // REST-XML reuses its XmlNode serde ctor; the initial response is built from the XML body + // root element, so no (const Http::HeaderValueCollection&) ctor is emitted. + String decl = render(w -> restXml.writeInitialResponseCtorDecl(w, "AWS_EX_API", "DoStreamInitialResponse")); + assertFalse(decl.contains("HeaderValueCollection"), + "REST-XML must not emit a header-collection initial-response ctor: " + decl); + + String impl = render(w -> restXml.writeInitialResponseCtorImpl(w, "DoStreamInitialResponse")); + assertFalse(impl.contains("HeaderValueCollection"), + "REST-XML must not emit a header-collection initial-response ctor impl: " + impl); + + String handler = render(w -> restXml.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + assertTrue(handler.contains("DoStreamInitialResponse event(xmlDoc.GetRootElement());"), handler); + assertFalse(handler.contains("GetEventHeadersAsHttpHeaders"), handler); + } + // ---------- QUERY_XML / EC2: two OutputToStream overloads ---------- @ParameterizedTest From 0aa5721b1640576e021fdb56bfeace79109fa86d Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 16:12:38 -0400 Subject: [PATCH 49/53] Smithy: rest-xml event-stream initial-response emits full xmlDoc parse block --- .../model/protocol/CborProtocolTraits.java | 3 ++- .../model/protocol/JsonProtocolTraits.java | 3 ++- .../generators/model/protocol/ProtocolTraits.java | 15 +++++++++++---- .../model/protocol/RestXmlProtocolTraits.java | 13 +++++++++++-- .../model/renderers/EventStreamRenderer.java | 2 +- .../model/protocol/CborProtocolTraitsTest.java | 2 +- .../model/protocol/JsonProtocolTraitsTest.java | 2 +- .../model/protocol/XmlProtocolTraitsTest.java | 11 ++++++++++- 8 files changed, 39 insertions(+), 12 deletions(-) diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java index 1d6c919361d..4f977a4ccfc 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraits.java @@ -178,7 +178,8 @@ public void writeInitialResponseCtorImpl(CppWriter writer, String className) { } @Override - public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className, + String handlerClassTag) { writer.write("$L event(GetEventHeadersAsHttpHeaders());", className); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java index 33739db5c26..22f1ee9a73e 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraits.java @@ -190,7 +190,8 @@ public void writeInitialResponseCtorImpl(CppWriter writer, String className) { } @Override - public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className, + String handlerClassTag) { writer.write("$L event(GetEventHeadersAsHttpHeaders());", className); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java index ebb76efdbca..a0b5c4543ed 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/ProtocolTraits.java @@ -252,14 +252,21 @@ default void writeInitialResponseCtorImpl(CppWriter writer, String className) { } /** - * Emits the statement that builds the {@code event} local in the event-stream handler's - * {@code INITIAL_RESPONSE} case. JSON/CBOR build it from the event message headers; REST-XML - * builds it from the XML body root element. + * Emits the statement(s) that build the {@code event} local in the event-stream handler's + * {@code INITIAL_RESPONSE} case. JSON/CBOR build it from the event message headers in a single + * statement; REST-XML parses the event payload as an XML document first (declaring the + * {@code xmlDoc} local and guarding {@code WasParseSuccessful} with a WARN + {@code break}), + * then builds the event from the XML root element. + * + * @param handlerClassTag the handler's log-tag identifier (e.g. + * {@code SELECTOBJECTCONTENT_HANDLER_CLASS_TAG}), used by protocols that log during + * construction. Protocols that build purely from headers ignore it. * *

Default: throws — a protocol with event streams must define how its initial response is * constructed. (Query-XML has no event streams, so this is never reached.) */ - default void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + default void writeInitialResponseHandlerConstruction(CppWriter writer, String className, + String handlerClassTag) { throw new UnsupportedOperationException( "Protocol " + protocol() + " does not define event-stream initial-response construction"); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java index d10d585e94d..9bd499dac83 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/RestXmlProtocolTraits.java @@ -151,10 +151,19 @@ public void writeResultSerdeImpls(CppWriter writer, String className, StructureS } @Override - public void writeInitialResponseHandlerConstruction(CppWriter writer, String className) { + public void writeInitialResponseHandlerConstruction(CppWriter writer, String className, + String handlerClassTag) { // REST-XML reuses its XmlNode serde ctor: the initial response is built from the XML body - // root element (C2J addEventStreamInitialResponse), not from event headers. No extra + // root element (C2J addEventStreamInitialResponse), not from event headers. The payload is + // first parsed into an XmlDocument (resolved via serdeUsings(EVENT_HANDLER_SOURCE) -> + // Aws::Utils::Xml) and a failed parse warns and breaks out of the case. No extra // header-collection ctor is emitted (writeInitialResponseCtorDecl inherits the no-op default). + writer.write("auto xmlDoc = XmlDocument::CreateFromXmlString(GetEventPayloadAsString());"); + writer.openBlock("if (!xmlDoc.WasParseSuccessful()) {", "}", () -> { + writer.write("AWS_LOGSTREAM_WARN($L, \"Unable to generate a proper InitialResponse " + + "object from the response in XML format.\");", handlerClassTag); + writer.write("break;"); + }); writer.write("$L event(xmlDoc.GetRootElement());", className); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java index b179333afff..e45457002bf 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/renderers/EventStreamRenderer.java @@ -291,7 +291,7 @@ private void renderHandlerSource(CppWriterDelegator writerDelegator, String opNa }); writer.openBlock("switch ($1LEventMapper::Get$1LEventTypeForName(eventTypeHeaderIter->second.GetEventHeaderValueAsString())) {", "}", opName, () -> { writer.openBlock("case $1LEventType::INITIAL_RESPONSE: {", "}", opName, () -> { - ctx.protocolTraits().writeInitialResponseHandlerConstruction(writer, opName + "InitialResponse"); + ctx.protocolTraits().writeInitialResponseHandlerConstruction(writer, opName + "InitialResponse", tag); writer.write("m_onInitialResponse(event, Utils::Event::InitialResponseType::ON_EVENT);"); writer.write("break;"); }); diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java index 64e25d7c3f9..56bb49b0313 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/CborProtocolTraitsTest.java @@ -222,7 +222,7 @@ void initialResponse_emitsHeaderCollectionCtorAndHeaderConstruction() { + "responseHeaders) : DoStreamInitialResponse() {"), impl); assertTrue(impl.contains("AWS_UNREFERENCED_PARAM(responseHeaders);"), impl); - String handler = render(w -> cbor.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + String handler = render(w -> cbor.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse", "DOSTREAM_HANDLER_CLASS_TAG")); assertTrue(handler.contains("DoStreamInitialResponse event(GetEventHeadersAsHttpHeaders());"), handler); assertFalse(handler.contains("xmlDoc"), handler); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java index 32469885517..828d206178f 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/JsonProtocolTraitsTest.java @@ -278,7 +278,7 @@ void initialResponse_emitsHeaderCollectionCtorAndHeaderConstruction() { + "responseHeaders) : DoStreamInitialResponse() {"), impl); assertTrue(impl.contains("AWS_UNREFERENCED_PARAM(responseHeaders);"), impl); - String handler = render(w -> json.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + String handler = render(w -> json.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse", "DOSTREAM_HANDLER_CLASS_TAG")); assertTrue(handler.contains("DoStreamInitialResponse event(GetEventHeadersAsHttpHeaders());"), handler); assertFalse(handler.contains("xmlDoc"), handler); } diff --git a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java index cf6a98aac82..39ebbf25966 100644 --- a/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java +++ b/tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/protocol/XmlProtocolTraitsTest.java @@ -138,7 +138,16 @@ void restXml_initialResponse_omitsHeaderCollectionCtor_buildsFromXmlRoot() { assertFalse(impl.contains("HeaderValueCollection"), "REST-XML must not emit a header-collection initial-response ctor impl: " + impl); - String handler = render(w -> restXml.writeInitialResponseHandlerConstruction(w, "DoStreamInitialResponse")); + // The handler-construction block must declare xmlDoc, guard the parse (WARN + break), and + // then build the event from the XML root — mirroring C2J's XmlRequestEventStreamHandlerSource. + String handler = render(w -> restXml.writeInitialResponseHandlerConstruction( + w, "DoStreamInitialResponse", "DOSTREAM_HANDLER_CLASS_TAG")); + assertTrue(handler.contains( + "auto xmlDoc = XmlDocument::CreateFromXmlString(GetEventPayloadAsString());"), handler); + assertTrue(handler.contains("if (!xmlDoc.WasParseSuccessful()) {"), handler); + assertTrue(handler.contains("AWS_LOGSTREAM_WARN(DOSTREAM_HANDLER_CLASS_TAG, \"Unable to generate " + + "a proper InitialResponse object from the response in XML format.\");"), handler); + assertTrue(handler.contains("break;"), handler); assertTrue(handler.contains("DoStreamInitialResponse event(xmlDoc.GetRootElement());"), handler); assertFalse(handler.contains("GetEventHeadersAsHttpHeaders"), handler); } From 719cb252eb35d0a4fc2c193bbb671ece791cc635 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 14:48:23 -0400 Subject: [PATCH 50/53] S3 Diffs --- .../include/aws/s3/model/AbacStatus.h | 1 - .../s3/model/AbortIncompleteMultipartUpload.h | 1 - .../s3/model/AbortMultipartUploadRequest.h | 22 +- .../aws/s3/model/AccelerateConfiguration.h | 1 - .../aws/s3/model/AccessControlPolicy.h | 1 - .../aws/s3/model/AccessControlTranslation.h | 1 - .../aws/s3/model/AnalyticsAndOperator.h | 1 - .../aws/s3/model/AnalyticsConfiguration.h | 1 - .../aws/s3/model/AnalyticsExportDestination.h | 1 - .../include/aws/s3/model/AnalyticsFilter.h | 1 - .../s3/model/AnalyticsS3BucketDestination.h | 7 +- .../include/aws/s3/model/AnnotationEntry.h | 1 - .../s3/model/AnnotationTableConfiguration.h | 1 - .../AnnotationTableConfigurationResult.h | 1 - .../AnnotationTableConfigurationUpdates.h | 1 - .../aws/s3/model/BlockedEncryptionTypes.h | 7 +- .../include/aws/s3/model/Bucket.h | 7 +- .../include/aws/s3/model/BucketInfo.h | 5 +- .../s3/model/BucketLifecycleConfiguration.h | 1 - .../aws/s3/model/BucketLoggingStatus.h | 1 - .../include/aws/s3/model/CORSConfiguration.h | 1 - .../include/aws/s3/model/CORSRule.h | 1 - .../include/aws/s3/model/CSVInput.h | 1 - .../include/aws/s3/model/CSVOutput.h | 1 - .../include/aws/s3/model/Checksum.h | 1 - .../aws/s3/model/CloudFunctionConfiguration.h | 128 -------- .../include/aws/s3/model/CommonPrefix.h | 6 +- .../s3/model/CompleteMultipartUploadRequest.h | 18 +- .../s3/model/CompleteMultipartUploadResult.h | 10 +- .../aws/s3/model/CompletedMultipartUpload.h | 1 - .../include/aws/s3/model/CompletedPart.h | 1 - .../include/aws/s3/model/Condition.h | 1 - .../include/aws/s3/model/CopyObjectRequest.h | 187 ++++++----- .../include/aws/s3/model/CopyObjectResult.h | 57 ++-- .../aws/s3/model/CopyObjectResultDetails.h | 3 +- .../include/aws/s3/model/CopyPartResult.h | 1 - .../aws/s3/model/CreateBucketConfiguration.h | 13 +- ...CreateBucketMetadataConfigurationRequest.h | 6 +- ...eBucketMetadataTableConfigurationRequest.h | 6 +- .../aws/s3/model/CreateBucketRequest.h | 31 +- .../include/aws/s3/model/CreateBucketResult.h | 6 +- .../s3/model/CreateMultipartUploadRequest.h | 144 ++++----- .../s3/model/CreateMultipartUploadResult.h | 24 +- .../aws/s3/model/CreateSessionRequest.h | 8 +- .../aws/s3/model/CreateSessionResult.h | 4 +- .../include/aws/s3/model/DefaultRetention.h | 13 +- .../include/aws/s3/model/Delete.h | 1 - ...eleteBucketAnalyticsConfigurationRequest.h | 7 +- .../aws/s3/model/DeleteBucketCorsRequest.h | 8 +- .../s3/model/DeleteBucketEncryptionRequest.h | 16 +- ...etIntelligentTieringConfigurationRequest.h | 8 +- ...eleteBucketInventoryConfigurationRequest.h | 16 +- .../s3/model/DeleteBucketLifecycleRequest.h | 14 +- ...DeleteBucketMetadataConfigurationRequest.h | 7 +- ...eBucketMetadataTableConfigurationRequest.h | 7 +- .../DeleteBucketMetricsConfigurationRequest.h | 16 +- .../DeleteBucketOwnershipControlsRequest.h | 8 +- .../aws/s3/model/DeleteBucketPolicyRequest.h | 16 +- .../s3/model/DeleteBucketReplicationRequest.h | 8 +- .../aws/s3/model/DeleteBucketRequest.h | 16 +- .../aws/s3/model/DeleteBucketTaggingRequest.h | 8 +- .../aws/s3/model/DeleteBucketWebsiteRequest.h | 8 +- .../include/aws/s3/model/DeleteMarkerEntry.h | 1 - .../aws/s3/model/DeleteMarkerReplication.h | 9 +- .../s3/model/DeleteObjectAnnotationRequest.h | 7 +- .../aws/s3/model/DeleteObjectRequest.h | 32 +- .../aws/s3/model/DeleteObjectTaggingRequest.h | 8 +- .../aws/s3/model/DeleteObjectsRequest.h | 25 +- .../s3/model/DeletePublicAccessBlockRequest.h | 8 +- .../include/aws/s3/model/DeletedObject.h | 1 - .../include/aws/s3/model/Destination.h | 1 - .../include/aws/s3/model/DestinationResult.h | 1 - .../include/aws/s3/model/Encryption.h | 1 - .../aws/s3/model/EncryptionConfiguration.h | 12 +- .../include/aws/s3/model/Error.h | 15 +- .../include/aws/s3/model/ErrorDetails.h | 7 +- .../include/aws/s3/model/ErrorDocument.h | 7 +- .../aws/s3/model/EventBridgeConfiguration.h | 1 - .../aws/s3/model/ExistingObjectReplication.h | 4 +- .../include/aws/s3/model/FilterRule.h | 1 - .../aws/s3/model/GetBucketAbacRequest.h | 7 +- .../GetBucketAccelerateConfigurationRequest.h | 8 +- .../aws/s3/model/GetBucketAclRequest.h | 8 +- .../GetBucketAnalyticsConfigurationRequest.h | 8 +- .../aws/s3/model/GetBucketCorsRequest.h | 8 +- .../aws/s3/model/GetBucketEncryptionRequest.h | 16 +- ...etIntelligentTieringConfigurationRequest.h | 8 +- .../GetBucketInventoryConfigurationRequest.h | 16 +- .../GetBucketLifecycleConfigurationRequest.h | 14 +- .../GetBucketLifecycleConfigurationResult.h | 4 +- .../aws/s3/model/GetBucketLocationRequest.h | 8 +- .../aws/s3/model/GetBucketLoggingRequest.h | 8 +- .../GetBucketMetadataConfigurationRequest.h | 7 +- .../GetBucketMetadataConfigurationResult.h | 1 - ...tBucketMetadataTableConfigurationRequest.h | 7 +- ...etBucketMetadataTableConfigurationResult.h | 7 +- .../GetBucketMetricsConfigurationRequest.h | 16 +- ...etBucketNotificationConfigurationRequest.h | 8 +- .../model/GetBucketOwnershipControlsRequest.h | 8 +- .../aws/s3/model/GetBucketPolicyRequest.h | 20 +- .../aws/s3/model/GetBucketPolicyResult.h | 3 +- .../s3/model/GetBucketPolicyStatusRequest.h | 8 +- .../s3/model/GetBucketReplicationRequest.h | 8 +- .../s3/model/GetBucketRequestPaymentRequest.h | 8 +- .../aws/s3/model/GetBucketTaggingRequest.h | 8 +- .../aws/s3/model/GetBucketVersioningRequest.h | 8 +- .../aws/s3/model/GetBucketWebsiteRequest.h | 8 +- .../aws/s3/model/GetObjectAclRequest.h | 12 +- .../aws/s3/model/GetObjectAnnotationRequest.h | 7 +- .../aws/s3/model/GetObjectAnnotationResult.h | 3 - .../aws/s3/model/GetObjectAttributesParts.h | 7 +- .../aws/s3/model/GetObjectAttributesRequest.h | 29 +- .../aws/s3/model/GetObjectAttributesResult.h | 8 +- .../aws/s3/model/GetObjectLegalHoldRequest.h | 8 +- .../model/GetObjectLockConfigurationRequest.h | 8 +- .../include/aws/s3/model/GetObjectRequest.h | 41 ++- .../include/aws/s3/model/GetObjectResult.h | 108 +++---- .../aws/s3/model/GetObjectRetentionRequest.h | 8 +- .../aws/s3/model/GetObjectTaggingRequest.h | 8 +- .../aws/s3/model/GetObjectTorrentRequest.h | 7 +- .../aws/s3/model/GetObjectTorrentResult.h | 3 - .../s3/model/GetPublicAccessBlockRequest.h | 8 +- .../aws/s3/model/GlacierJobParameters.h | 1 - .../include/aws/s3/model/Grant.h | 1 - .../include/aws/s3/model/Grantee.h | 45 ++- .../include/aws/s3/model/HeadBucketRequest.h | 16 +- .../include/aws/s3/model/HeadBucketResult.h | 14 +- .../include/aws/s3/model/HeadObjectRequest.h | 31 +- .../include/aws/s3/model/HeadObjectResult.h | 52 ++- .../include/aws/s3/model/IndexDocument.h | 7 +- .../include/aws/s3/model/Initiator.h | 12 +- .../include/aws/s3/model/InputSerialization.h | 1 - .../s3/model/IntelligentTieringAndOperator.h | 1 - .../model/IntelligentTieringConfiguration.h | 1 - .../aws/s3/model/IntelligentTieringFilter.h | 7 +- .../include/aws/s3/model/InvalidObjectState.h | 1 - .../aws/s3/model/InventoryConfiguration.h | 5 +- .../aws/s3/model/InventoryDestination.h | 1 - .../aws/s3/model/InventoryEncryption.h | 1 - .../include/aws/s3/model/InventoryFilter.h | 1 - .../s3/model/InventoryS3BucketDestination.h | 7 +- .../include/aws/s3/model/InventorySchedule.h | 1 - .../s3/model/InventoryTableConfiguration.h | 1 - .../model/InventoryTableConfigurationResult.h | 1 - .../InventoryTableConfigurationUpdates.h | 1 - .../include/aws/s3/model/JSONInput.h | 1 - .../include/aws/s3/model/JSONOutput.h | 1 - .../aws/s3/model/JournalTableConfiguration.h | 1 - .../model/JournalTableConfigurationResult.h | 1 - .../model/JournalTableConfigurationUpdates.h | 1 - .../s3/model/LambdaFunctionConfiguration.h | 1 - .../aws/s3/model/LifecycleConfiguration.h | 69 ---- .../aws/s3/model/LifecycleExpiration.h | 5 +- .../include/aws/s3/model/LifecycleRule.h | 16 +- .../aws/s3/model/LifecycleRuleAndOperator.h | 1 - .../aws/s3/model/LifecycleRuleFilter.h | 10 +- ...ListBucketAnalyticsConfigurationsRequest.h | 8 +- ...tIntelligentTieringConfigurationsRequest.h | 8 +- ...ListBucketInventoryConfigurationsRequest.h | 16 +- .../ListBucketMetricsConfigurationsRequest.h | 16 +- .../include/aws/s3/model/ListBucketsRequest.h | 3 - .../s3/model/ListDirectoryBucketsRequest.h | 4 +- .../s3/model/ListMultipartUploadsRequest.h | 34 +- .../aws/s3/model/ListMultipartUploadsResult.h | 11 +- .../s3/model/ListObjectAnnotationsRequest.h | 7 +- .../aws/s3/model/ListObjectVersionsRequest.h | 13 +- .../include/aws/s3/model/ListObjectsRequest.h | 18 +- .../include/aws/s3/model/ListObjectsResult.h | 19 +- .../aws/s3/model/ListObjectsV2Request.h | 51 ++- .../aws/s3/model/ListObjectsV2Result.h | 28 +- .../include/aws/s3/model/ListPartsRequest.h | 18 +- .../include/aws/s3/model/ListPartsResult.h | 21 +- .../include/aws/s3/model/LocationInfo.h | 10 +- .../include/aws/s3/model/LoggingEnabled.h | 1 - .../aws/s3/model/MetadataConfiguration.h | 1 - .../s3/model/MetadataConfigurationResult.h | 1 - .../include/aws/s3/model/MetadataEntry.h | 1 - .../aws/s3/model/MetadataTableConfiguration.h | 7 +- .../model/MetadataTableConfigurationResult.h | 7 +- .../MetadataTableEncryptionConfiguration.h | 1 - .../include/aws/s3/model/Metrics.h | 1 - .../include/aws/s3/model/MetricsAndOperator.h | 1 - .../aws/s3/model/MetricsConfiguration.h | 4 +- .../include/aws/s3/model/MetricsFilter.h | 5 +- .../include/aws/s3/model/MultipartUpload.h | 5 +- .../s3/model/NoncurrentVersionExpiration.h | 18 +- .../s3/model/NoncurrentVersionTransition.h | 1 - .../aws/s3/model/NotificationConfiguration.h | 1 - .../NotificationConfigurationDeprecated.h | 101 ------ .../model/NotificationConfigurationFilter.h | 1 - .../include/aws/s3/model/Object.h | 9 +- .../include/aws/s3/model/ObjectEncryption.h | 1 - .../include/aws/s3/model/ObjectIdentifier.h | 16 +- .../aws/s3/model/ObjectLockConfiguration.h | 1 - .../aws/s3/model/ObjectLockLegalHold.h | 1 - .../aws/s3/model/ObjectLockRetention.h | 1 - .../include/aws/s3/model/ObjectLockRule.h | 1 - .../include/aws/s3/model/ObjectPart.h | 1 - .../include/aws/s3/model/ObjectVersion.h | 1 - .../include/aws/s3/model/OutputLocation.h | 1 - .../aws/s3/model/OutputSerialization.h | 1 - .../include/aws/s3/model/Owner.h | 3 +- .../include/aws/s3/model/OwnershipControls.h | 1 - .../aws/s3/model/OwnershipControlsRule.h | 3 +- .../include/aws/s3/model/ParquetInput.h | 1 - .../include/aws/s3/model/Part.h | 1 - .../include/aws/s3/model/PartitionedPrefix.h | 1 - .../include/aws/s3/model/PolicyStatus.h | 3 +- .../include/aws/s3/model/Progress.h | 1 - .../include/aws/s3/model/ProgressEvent.h | 1 - .../s3/model/PublicAccessBlockConfiguration.h | 1 - .../aws/s3/model/PutBucketAbacRequest.h | 7 +- .../PutBucketAccelerateConfigurationRequest.h | 8 +- .../aws/s3/model/PutBucketAclRequest.h | 7 +- .../PutBucketAnalyticsConfigurationRequest.h | 8 +- .../aws/s3/model/PutBucketCorsRequest.h | 7 +- .../aws/s3/model/PutBucketEncryptionRequest.h | 21 +- ...etIntelligentTieringConfigurationRequest.h | 8 +- .../PutBucketInventoryConfigurationRequest.h | 16 +- .../PutBucketLifecycleConfigurationRequest.h | 27 +- .../PutBucketLifecycleConfigurationResult.h | 14 +- .../aws/s3/model/PutBucketLoggingRequest.h | 7 +- .../PutBucketMetricsConfigurationRequest.h | 16 +- ...utBucketNotificationConfigurationRequest.h | 8 +- .../model/PutBucketOwnershipControlsRequest.h | 7 +- .../aws/s3/model/PutBucketPolicyRequest.h | 26 +- .../s3/model/PutBucketReplicationRequest.h | 7 +- .../s3/model/PutBucketRequestPaymentRequest.h | 7 +- .../aws/s3/model/PutBucketTaggingRequest.h | 7 +- .../aws/s3/model/PutBucketVersioningRequest.h | 13 +- .../aws/s3/model/PutBucketWebsiteRequest.h | 7 +- .../aws/s3/model/PutObjectAclRequest.h | 17 +- .../aws/s3/model/PutObjectAnnotationRequest.h | 6 +- .../aws/s3/model/PutObjectLegalHoldRequest.h | 7 +- .../model/PutObjectLockConfigurationRequest.h | 7 +- .../include/aws/s3/model/PutObjectRequest.h | 119 ++++--- .../include/aws/s3/model/PutObjectResult.h | 22 +- .../aws/s3/model/PutObjectRetentionRequest.h | 7 +- .../aws/s3/model/PutObjectTaggingRequest.h | 7 +- .../s3/model/PutPublicAccessBlockRequest.h | 7 +- .../include/aws/s3/model/QueueConfiguration.h | 1 - .../s3/model/QueueConfigurationDeprecated.h | 110 ------- .../include/aws/s3/model/RecordExpiration.h | 1 - .../include/aws/s3/model/Redirect.h | 11 +- .../aws/s3/model/RedirectAllRequestsTo.h | 1 - .../aws/s3/model/RenameObjectRequest.h | 11 +- .../aws/s3/model/ReplicaModifications.h | 1 - .../aws/s3/model/ReplicationConfiguration.h | 1 - .../include/aws/s3/model/ReplicationRule.h | 4 +- .../aws/s3/model/ReplicationRuleAndOperator.h | 1 - .../aws/s3/model/ReplicationRuleFilter.h | 9 +- .../include/aws/s3/model/ReplicationTime.h | 1 - .../aws/s3/model/ReplicationTimeValue.h | 1 - .../s3/model/RequestPaymentConfiguration.h | 1 - .../include/aws/s3/model/RequestProgress.h | 1 - .../aws/s3/model/RestoreObjectRequest.h | 8 +- .../include/aws/s3/model/RestoreRequest.h | 11 +- .../include/aws/s3/model/RestoreStatus.h | 5 +- .../include/aws/s3/model/RoutingRule.h | 1 - .../include/aws/s3/model/Rule.h | 219 ------------- .../include/aws/s3/model/S3KeyFilter.h | 1 - .../include/aws/s3/model/S3Location.h | 1 - .../aws/s3/model/S3TablesDestination.h | 7 +- .../aws/s3/model/S3TablesDestinationResult.h | 7 +- .../include/aws/s3/model/SSEKMS.h | 1 - .../include/aws/s3/model/SSEKMSEncryption.h | 7 +- .../include/aws/s3/model/SSES3.h | 1 - .../include/aws/s3/model/ScanRange.h | 10 +- .../SelectObjectContentInitialResponse.h | 1 - .../aws/s3/model/SelectObjectContentRequest.h | 37 +-- .../include/aws/s3/model/SelectParameters.h | 17 +- .../s3/model/ServerSideEncryptionByDefault.h | 22 +- .../model/ServerSideEncryptionConfiguration.h | 1 - .../aws/s3/model/ServerSideEncryptionRule.h | 25 +- .../include/aws/s3/model/SessionCredentials.h | 1 - .../include/aws/s3/model/SimplePrefix.h | 1 - .../aws/s3/model/SourceSelectionCriteria.h | 1 - .../aws/s3/model/SseKmsEncryptedObjects.h | 1 - .../include/aws/s3/model/Stats.h | 1 - .../include/aws/s3/model/StatsEvent.h | 1 - .../aws/s3/model/StorageClassAnalysis.h | 1 - .../s3/model/StorageClassAnalysisDataExport.h | 1 - .../aws-cpp-sdk-s3/include/aws/s3/model/Tag.h | 1 - .../include/aws/s3/model/Tagging.h | 1 - .../include/aws/s3/model/TargetGrant.h | 1 - .../aws/s3/model/TargetObjectKeyFormat.h | 1 - .../include/aws/s3/model/Tiering.h | 1 - .../include/aws/s3/model/TopicConfiguration.h | 1 - .../s3/model/TopicConfigurationDeprecated.h | 110 ------- .../include/aws/s3/model/Transition.h | 1 - ...adataAnnotationTableConfigurationRequest.h | 6 +- ...tadataInventoryTableConfigurationRequest.h | 6 +- ...MetadataJournalTableConfigurationRequest.h | 6 +- .../s3/model/UpdateObjectEncryptionRequest.h | 6 +- .../aws/s3/model/UploadPartCopyRequest.h | 81 +++-- .../aws/s3/model/UploadPartCopyResult.h | 16 +- .../include/aws/s3/model/UploadPartRequest.h | 28 +- .../include/aws/s3/model/UploadPartResult.h | 12 +- .../aws/s3/model/VersioningConfiguration.h | 1 - .../aws/s3/model/WebsiteConfiguration.h | 5 +- .../s3/model/WriteGetObjectResponseRequest.h | 30 +- .../source/model/AbacStatus.cpp | 28 +- .../model/AbortIncompleteMultipartUpload.cpp | 30 +- .../model/AbortMultipartUploadRequest.cpp | 61 ++-- .../model/AbortMultipartUploadResult.cpp | 26 +- .../source/model/AccelerateConfiguration.cpp | 28 +- .../source/model/AccessControlPolicy.cpp | 44 +-- .../source/model/AccessControlTranslation.cpp | 28 +- .../source/model/AnalyticsAndOperator.cpp | 43 +-- .../source/model/AnalyticsConfiguration.cpp | 45 +-- .../model/AnalyticsExportDestination.cpp | 27 +- .../source/model/AnalyticsFilter.cpp | 45 +-- .../model/AnalyticsS3BucketDestination.cpp | 56 +--- .../model/AnalyticsS3ExportFileFormat.cpp | 2 - .../model/AnnotationConfigurationState.cpp | 2 - .../source/model/AnnotationDirective.cpp | 2 - .../source/model/AnnotationEntry.cpp | 89 +----- .../model/AnnotationTableConfiguration.cpp | 46 +-- .../AnnotationTableConfigurationResult.cpp | 76 +---- .../AnnotationTableConfigurationUpdates.cpp | 46 +-- .../source/model/ArchiveStatus.cpp | 2 - .../source/model/BlockedEncryptionTypes.cpp | 37 +-- .../aws-cpp-sdk-s3/source/model/Bucket.cpp | 56 +--- .../source/model/BucketAbacStatus.cpp | 2 - .../source/model/BucketAccelerateStatus.cpp | 2 - .../source/model/BucketCannedACL.cpp | 2 - .../source/model/BucketInfo.cpp | 38 +-- .../model/BucketLifecycleConfiguration.cpp | 35 +- .../source/model/BucketLocationConstraint.cpp | 2 - .../source/model/BucketLoggingStatus.cpp | 27 +- .../source/model/BucketLogsPermission.cpp | 2 - .../source/model/BucketNamespace.cpp | 2 - .../source/model/BucketType.cpp | 2 - .../source/model/BucketVersioningStatus.cpp | 2 - .../source/model/CORSConfiguration.cpp | 35 +- .../aws-cpp-sdk-s3/source/model/CORSRule.cpp | 110 +------ .../aws-cpp-sdk-s3/source/model/CSVInput.cpp | 89 +----- .../aws-cpp-sdk-s3/source/model/CSVOutput.cpp | 66 +--- .../aws-cpp-sdk-s3/source/model/Checksum.cpp | 126 +------- .../source/model/ChecksumAlgorithm.cpp | 2 - .../source/model/ChecksumMode.cpp | 2 - .../source/model/ChecksumType.cpp | 2 - .../model/CloudFunctionConfiguration.cpp | 84 ----- .../source/model/CommonPrefix.cpp | 27 +- .../model/CompleteMultipartUploadRequest.cpp | 111 +++---- .../model/CompleteMultipartUploadResult.cpp | 128 +------- .../source/model/CompletedMultipartUpload.cpp | 35 +- .../source/model/CompletedPart.cpp | 138 +------- .../source/model/CompressionType.cpp | 2 - .../aws-cpp-sdk-s3/source/model/Condition.cpp | 37 +-- .../source/model/CopyObjectRequest.cpp | 109 ++----- .../source/model/CopyObjectResult.cpp | 82 +---- .../source/model/CopyObjectResultDetails.cpp | 147 +-------- .../source/model/CopyPartResult.cpp | 136 +------- .../model/CreateBucketConfiguration.cpp | 65 +--- ...eateBucketMetadataConfigurationRequest.cpp | 70 ++-- ...ucketMetadataTableConfigurationRequest.cpp | 72 ++--- .../source/model/CreateBucketRequest.cpp | 92 ++---- .../source/model/CreateBucketResult.cpp | 32 +- .../model/CreateMultipartUploadRequest.cpp | 96 ++---- .../model/CreateMultipartUploadResult.cpp | 101 +----- .../source/model/CreateSessionRequest.cpp | 72 ++--- .../source/model/CreateSessionResult.cpp | 49 +-- .../source/model/DataRedundancy.cpp | 2 - .../source/model/DefaultRetention.cpp | 50 +-- .../aws-cpp-sdk-s3/source/model/Delete.cpp | 45 +-- ...eteBucketAnalyticsConfigurationRequest.cpp | 30 +- .../source/model/DeleteBucketCorsRequest.cpp | 50 ++- .../model/DeleteBucketEncryptionRequest.cpp | 50 ++- ...IntelligentTieringConfigurationRequest.cpp | 53 ++-- ...eteBucketInventoryConfigurationRequest.cpp | 53 ++-- .../model/DeleteBucketLifecycleRequest.cpp | 50 ++- ...leteBucketMetadataConfigurationRequest.cpp | 29 +- ...ucketMetadataTableConfigurationRequest.cpp | 29 +- ...eleteBucketMetricsConfigurationRequest.cpp | 51 ++- .../DeleteBucketOwnershipControlsRequest.cpp | 50 ++- .../model/DeleteBucketPolicyRequest.cpp | 50 ++- .../model/DeleteBucketReplicationRequest.cpp | 50 ++- .../source/model/DeleteBucketRequest.cpp | 50 ++- .../model/DeleteBucketTaggingRequest.cpp | 50 ++- .../model/DeleteBucketWebsiteRequest.cpp | 50 ++- .../source/model/DeleteMarkerEntry.cpp | 69 +--- .../source/model/DeleteMarkerReplication.cpp | 28 +- .../model/DeleteMarkerReplicationStatus.cpp | 2 - .../model/DeleteObjectAnnotationRequest.cpp | 49 ++- .../model/DeleteObjectAnnotationResult.cpp | 28 +- .../source/model/DeleteObjectRequest.cpp | 85 +++-- .../source/model/DeleteObjectResult.cpp | 38 +-- .../model/DeleteObjectTaggingRequest.cpp | 51 ++- .../model/DeleteObjectTaggingResult.cpp | 26 +- .../source/model/DeleteObjectsRequest.cpp | 97 +++--- .../source/model/DeleteObjectsResult.cpp | 48 +-- .../model/DeletePublicAccessBlockRequest.cpp | 50 ++- .../source/model/DeletedObject.cpp | 58 +--- .../source/model/Destination.cpp | 86 +---- .../source/model/DestinationResult.cpp | 46 +-- .../source/model/EncodingType.cpp | 2 - .../source/model/Encryption.cpp | 46 +-- .../source/model/EncryptionConfiguration.cpp | 27 +- .../source/model/EncryptionType.cpp | 2 - .../src/aws-cpp-sdk-s3/source/model/Error.cpp | 55 +--- .../source/model/ErrorDetails.cpp | 37 +-- .../source/model/ErrorDocument.cpp | 27 +- .../src/aws-cpp-sdk-s3/source/model/Event.cpp | 2 - .../source/model/EventBridgeConfiguration.cpp | 17 +- .../model/ExistingObjectReplication.cpp | 28 +- .../model/ExistingObjectReplicationStatus.cpp | 2 - .../source/model/ExpirationState.cpp | 2 - .../source/model/ExpirationStatus.cpp | 2 - .../source/model/ExpressionType.cpp | 2 - .../source/model/FileHeaderInfo.cpp | 2 - .../source/model/FilterRule.cpp | 38 +-- .../source/model/FilterRuleName.cpp | 2 - .../source/model/GetBucketAbacRequest.cpp | 29 +- .../source/model/GetBucketAbacResult.cpp | 22 +- ...etBucketAccelerateConfigurationRequest.cpp | 53 ++-- ...GetBucketAccelerateConfigurationResult.cpp | 28 +- .../source/model/GetBucketAclRequest.cpp | 50 ++- .../source/model/GetBucketAclResult.cpp | 36 +-- ...GetBucketAnalyticsConfigurationRequest.cpp | 51 ++- .../GetBucketAnalyticsConfigurationResult.cpp | 18 +- .../source/model/GetBucketCorsRequest.cpp | 50 ++- .../source/model/GetBucketCorsResult.cpp | 31 +- .../model/GetBucketEncryptionRequest.cpp | 50 ++- .../model/GetBucketEncryptionResult.cpp | 22 +- ...IntelligentTieringConfigurationRequest.cpp | 53 ++-- ...tIntelligentTieringConfigurationResult.cpp | 18 +- ...GetBucketInventoryConfigurationRequest.cpp | 51 ++- .../GetBucketInventoryConfigurationResult.cpp | 18 +- ...GetBucketLifecycleConfigurationRequest.cpp | 50 ++- .../GetBucketLifecycleConfigurationResult.cpp | 34 +- .../source/model/GetBucketLocationRequest.cpp | 50 ++- .../source/model/GetBucketLocationResult.cpp | 20 +- .../source/model/GetBucketLoggingRequest.cpp | 50 ++- .../source/model/GetBucketLoggingResult.cpp | 25 +- .../GetBucketMetadataConfigurationRequest.cpp | 29 +- .../GetBucketMetadataConfigurationResult.cpp | 27 +- ...etBucketMetadataConfigurationSdkResult.cpp | 18 +- ...ucketMetadataTableConfigurationRequest.cpp | 29 +- ...BucketMetadataTableConfigurationResult.cpp | 45 +-- ...ketMetadataTableConfigurationSdkResult.cpp | 18 +- .../GetBucketMetricsConfigurationRequest.cpp | 51 ++- .../GetBucketMetricsConfigurationResult.cpp | 18 +- ...BucketNotificationConfigurationRequest.cpp | 52 ++- ...tBucketNotificationConfigurationResult.cpp | 54 +--- .../GetBucketOwnershipControlsRequest.cpp | 50 ++- .../GetBucketOwnershipControlsResult.cpp | 18 +- .../source/model/GetBucketPolicyRequest.cpp | 50 ++- .../source/model/GetBucketPolicyResult.cpp | 12 +- .../model/GetBucketPolicyStatusRequest.cpp | 50 ++- .../model/GetBucketPolicyStatusResult.cpp | 18 +- .../model/GetBucketReplicationRequest.cpp | 50 ++- .../model/GetBucketReplicationResult.cpp | 22 +- .../model/GetBucketRequestPaymentRequest.cpp | 50 ++- .../model/GetBucketRequestPaymentResult.cpp | 21 +- .../source/model/GetBucketTaggingRequest.cpp | 50 ++- .../source/model/GetBucketTaggingResult.cpp | 31 +- .../model/GetBucketVersioningRequest.cpp | 50 ++- .../model/GetBucketVersioningResult.cpp | 32 +- .../source/model/GetBucketWebsiteRequest.cpp | 50 ++- .../source/model/GetBucketWebsiteResult.cpp | 46 +-- .../source/model/GetObjectAclRequest.cpp | 54 ++-- .../source/model/GetObjectAclResult.cpp | 42 +-- .../model/GetObjectAnnotationRequest.cpp | 69 ++-- .../model/GetObjectAnnotationResult.cpp | 123 +------ .../source/model/GetObjectAttributesParts.cpp | 98 +----- .../model/GetObjectAttributesRequest.cpp | 87 +++-- .../model/GetObjectAttributesResult.cpp | 75 +---- .../model/GetObjectLegalHoldRequest.cpp | 54 ++-- .../source/model/GetObjectLegalHoldResult.cpp | 22 +- .../GetObjectLockConfigurationRequest.cpp | 50 ++- .../GetObjectLockConfigurationResult.cpp | 18 +- .../source/model/GetObjectRequest.cpp | 151 ++++----- .../source/model/GetObjectResult.cpp | 291 +---------------- .../model/GetObjectRetentionRequest.cpp | 54 ++-- .../source/model/GetObjectRetentionResult.cpp | 22 +- .../source/model/GetObjectTaggingRequest.cpp | 54 ++-- .../source/model/GetObjectTaggingResult.cpp | 37 +-- .../source/model/GetObjectTorrentRequest.cpp | 36 +-- .../source/model/GetObjectTorrentResult.cpp | 17 +- .../model/GetPublicAccessBlockRequest.cpp | 50 ++- .../model/GetPublicAccessBlockResult.cpp | 22 +- .../source/model/GlacierJobParameters.cpp | 27 +- .../src/aws-cpp-sdk-s3/source/model/Grant.cpp | 38 +-- .../aws-cpp-sdk-s3/source/model/Grantee.cpp | 65 +--- .../source/model/HeadBucketRequest.cpp | 50 ++- .../source/model/HeadBucketResult.cpp | 50 +-- .../source/model/HeadObjectRequest.cpp | 148 ++++----- .../source/model/HeadObjectResult.cpp | 300 +----------------- .../source/model/IndexDocument.cpp | 27 +- .../aws-cpp-sdk-s3/source/model/Initiator.cpp | 37 +-- .../source/model/InputSerialization.cpp | 56 +--- .../model/IntelligentTieringAccessTier.cpp | 2 - .../model/IntelligentTieringAndOperator.cpp | 43 +-- .../model/IntelligentTieringConfiguration.cpp | 64 +--- .../source/model/IntelligentTieringFilter.cpp | 45 +-- .../source/model/IntelligentTieringStatus.cpp | 2 - .../source/model/InvalidObjectState.cpp | 39 +-- .../source/model/InventoryConfiguration.cpp | 100 +----- .../model/InventoryConfigurationState.cpp | 2 - .../source/model/InventoryDestination.cpp | 27 +- .../source/model/InventoryEncryption.cpp | 37 +-- .../source/model/InventoryFilter.cpp | 27 +- .../source/model/InventoryFormat.cpp | 2 - .../source/model/InventoryFrequency.cpp | 2 - .../model/InventoryIncludedObjectVersions.cpp | 2 - .../source/model/InventoryOptionalField.cpp | 2 - .../model/InventoryS3BucketDestination.cpp | 66 +--- .../source/model/InventorySchedule.cpp | 28 +- .../model/InventoryTableConfiguration.cpp | 38 +-- .../InventoryTableConfigurationResult.cpp | 66 +--- .../InventoryTableConfigurationUpdates.cpp | 38 +-- .../aws-cpp-sdk-s3/source/model/JSONInput.cpp | 27 +- .../source/model/JSONOutput.cpp | 27 +- .../aws-cpp-sdk-s3/source/model/JSONType.cpp | 2 - .../model/JournalTableConfiguration.cpp | 37 +-- .../model/JournalTableConfigurationResult.cpp | 65 +--- .../JournalTableConfigurationUpdates.cpp | 27 +- .../model/LambdaFunctionConfiguration.cpp | 63 +--- .../source/model/LifecycleConfiguration.cpp | 54 ---- .../source/model/LifecycleExpiration.cpp | 51 +-- .../source/model/LifecycleRule.cpp | 112 +------ .../source/model/LifecycleRuleAndOperator.cpp | 69 +--- .../source/model/LifecycleRuleFilter.cpp | 71 +---- ...stBucketAnalyticsConfigurationsRequest.cpp | 51 ++- ...istBucketAnalyticsConfigurationsResult.cpp | 43 +-- ...ntelligentTieringConfigurationsRequest.cpp | 53 ++-- ...IntelligentTieringConfigurationsResult.cpp | 43 +-- ...stBucketInventoryConfigurationsRequest.cpp | 51 ++- ...istBucketInventoryConfigurationsResult.cpp | 43 +-- ...ListBucketMetricsConfigurationsRequest.cpp | 51 ++- .../ListBucketMetricsConfigurationsResult.cpp | 43 +-- .../source/model/ListBucketsRequest.cpp | 41 ++- .../source/model/ListBucketsResult.cpp | 46 +-- .../model/ListDirectoryBucketsRequest.cpp | 39 ++- .../model/ListDirectoryBucketsResult.cpp | 36 +-- .../model/ListMultipartUploadsRequest.cpp | 59 ++-- .../model/ListMultipartUploadsResult.cpp | 101 +----- .../model/ListObjectAnnotationsRequest.cpp | 40 ++- .../model/ListObjectAnnotationsResult.cpp | 76 +---- .../model/ListObjectVersionsRequest.cpp | 77 ++--- .../source/model/ListObjectVersionsResult.cpp | 112 +------ .../source/model/ListObjectsRequest.cpp | 76 ++--- .../source/model/ListObjectsResult.cpp | 91 +----- .../source/model/ListObjectsV2Request.cpp | 78 ++--- .../source/model/ListObjectsV2Result.cpp | 102 +----- .../source/model/ListPartsRequest.cpp | 89 +++--- .../source/model/ListPartsResult.cpp | 120 +------ .../source/model/LocationInfo.cpp | 38 +-- .../source/model/LocationType.cpp | 2 - .../source/model/LoggingEnabled.cpp | 64 +--- .../aws-cpp-sdk-s3/source/model/MFADelete.cpp | 2 - .../source/model/MFADeleteStatus.cpp | 2 - .../source/model/MetadataConfiguration.cpp | 45 +-- .../model/MetadataConfigurationResult.cpp | 55 +--- .../source/model/MetadataDirective.cpp | 2 - .../source/model/MetadataEntry.cpp | 37 +-- .../model/MetadataTableConfiguration.cpp | 27 +- .../MetadataTableConfigurationResult.cpp | 27 +- .../MetadataTableEncryptionConfiguration.cpp | 38 +-- .../aws-cpp-sdk-s3/source/model/Metrics.cpp | 38 +-- .../source/model/MetricsAndOperator.cpp | 53 +--- .../source/model/MetricsConfiguration.cpp | 37 +-- .../source/model/MetricsFilter.cpp | 55 +--- .../source/model/MetricsStatus.cpp | 2 - .../source/model/MultipartUpload.cpp | 99 +----- .../model/NoncurrentVersionExpiration.cpp | 43 +-- .../model/NoncurrentVersionTransition.cpp | 52 +-- .../model/NotificationConfiguration.cpp | 79 +---- .../NotificationConfigurationDeprecated.cpp | 66 ---- .../model/NotificationConfigurationFilter.cpp | 27 +- .../aws-cpp-sdk-s3/source/model/Object.cpp | 120 +------ .../source/model/ObjectAttributes.cpp | 2 - .../source/model/ObjectCannedACL.cpp | 2 - .../source/model/ObjectEncryption.cpp | 27 +- .../source/model/ObjectIdentifier.cpp | 69 +--- .../source/model/ObjectLockConfiguration.cpp | 38 +-- .../source/model/ObjectLockEnabled.cpp | 2 - .../source/model/ObjectLockLegalHold.cpp | 28 +- .../model/ObjectLockLegalHoldStatus.cpp | 2 - .../source/model/ObjectLockMode.cpp | 2 - .../source/model/ObjectLockRetention.cpp | 39 +-- .../source/model/ObjectLockRetentionMode.cpp | 2 - .../source/model/ObjectLockRule.cpp | 27 +- .../source/model/ObjectOwnership.cpp | 2 - .../source/model/ObjectPart.cpp | 140 +------- .../source/model/ObjectStorageClass.cpp | 2 - .../source/model/ObjectVersion.cpp | 143 +-------- .../model/ObjectVersionStorageClass.cpp | 2 - .../source/model/OptionalObjectAttributes.cpp | 2 - .../source/model/OutputLocation.cpp | 27 +- .../source/model/OutputSerialization.cpp | 37 +-- .../src/aws-cpp-sdk-s3/source/model/Owner.cpp | 37 +-- .../source/model/OwnerOverride.cpp | 2 - .../source/model/OwnershipControls.cpp | 35 +- .../source/model/OwnershipControlsRule.cpp | 28 +- .../source/model/ParquetInput.cpp | 17 +- .../src/aws-cpp-sdk-s3/source/model/Part.cpp | 161 +--------- .../source/model/PartitionDateSource.cpp | 2 - .../source/model/PartitionedPrefix.cpp | 28 +- .../src/aws-cpp-sdk-s3/source/model/Payer.cpp | 2 - .../source/model/Permission.cpp | 2 - .../source/model/PolicyStatus.cpp | 30 +- .../aws-cpp-sdk-s3/source/model/Progress.cpp | 54 +--- .../source/model/ProgressEvent.cpp | 27 +- .../aws-cpp-sdk-s3/source/model/Protocol.cpp | 2 - .../model/PublicAccessBlockConfiguration.cpp | 67 +--- .../source/model/PutBucketAbacRequest.cpp | 66 ++-- ...utBucketAccelerateConfigurationRequest.cpp | 84 ++--- .../source/model/PutBucketAclRequest.cpp | 107 +++---- ...PutBucketAnalyticsConfigurationRequest.cpp | 63 ++-- .../source/model/PutBucketCorsRequest.cpp | 91 +++--- .../model/PutBucketEncryptionRequest.cpp | 91 +++--- ...IntelligentTieringConfigurationRequest.cpp | 65 ++-- ...PutBucketInventoryConfigurationRequest.cpp | 63 ++-- ...PutBucketLifecycleConfigurationRequest.cpp | 93 +++--- .../PutBucketLifecycleConfigurationResult.cpp | 23 +- .../source/model/PutBucketLoggingRequest.cpp | 91 +++--- .../PutBucketMetricsConfigurationRequest.cpp | 63 ++-- ...BucketNotificationConfigurationRequest.cpp | 52 ++- .../PutBucketOwnershipControlsRequest.cpp | 91 +++--- .../source/model/PutBucketPolicyRequest.cpp | 66 ++-- .../model/PutBucketReplicationRequest.cpp | 102 +++--- .../model/PutBucketRequestPaymentRequest.cpp | 91 +++--- .../source/model/PutBucketTaggingRequest.cpp | 91 +++--- .../model/PutBucketVersioningRequest.cpp | 102 +++--- .../source/model/PutBucketWebsiteRequest.cpp | 91 +++--- .../source/model/PutObjectAclRequest.cpp | 117 +++---- .../source/model/PutObjectAclResult.cpp | 26 +- .../model/PutObjectAnnotationRequest.cpp | 89 ++---- .../model/PutObjectAnnotationResult.cpp | 120 +------ .../model/PutObjectLegalHoldRequest.cpp | 99 +++--- .../source/model/PutObjectLegalHoldResult.cpp | 26 +- .../PutObjectLockConfigurationRequest.cpp | 97 +++--- .../PutObjectLockConfigurationResult.cpp | 22 +- .../source/model/PutObjectRequest.cpp | 103 ++---- .../source/model/PutObjectResult.cpp | 152 +-------- .../model/PutObjectRetentionRequest.cpp | 108 +++---- .../source/model/PutObjectRetentionResult.cpp | 26 +- .../source/model/PutObjectTaggingRequest.cpp | 99 +++--- .../source/model/PutObjectTaggingResult.cpp | 26 +- .../model/PutPublicAccessBlockRequest.cpp | 91 +++--- .../source/model/QueueConfiguration.cpp | 63 +--- .../model/QueueConfigurationDeprecated.cpp | 74 ----- .../source/model/QuoteFields.cpp | 2 - .../source/model/RecordExpiration.cpp | 40 +-- .../aws-cpp-sdk-s3/source/model/Redirect.cpp | 66 +--- .../source/model/RedirectAllRequestsTo.cpp | 38 +-- .../source/model/RenameObjectRequest.cpp | 46 ++- .../source/model/RenameObjectResult.cpp | 20 +- .../source/model/ReplicaModifications.cpp | 28 +- .../model/ReplicaModificationsStatus.cpp | 2 - .../source/model/ReplicationConfiguration.cpp | 43 +-- .../source/model/ReplicationRule.cpp | 99 +----- .../model/ReplicationRuleAndOperator.cpp | 43 +-- .../source/model/ReplicationRuleFilter.cpp | 45 +-- .../source/model/ReplicationRuleStatus.cpp | 2 - .../source/model/ReplicationStatus.cpp | 2 - .../source/model/ReplicationTime.cpp | 38 +-- .../source/model/ReplicationTimeStatus.cpp | 2 - .../source/model/ReplicationTimeValue.cpp | 30 +- .../source/model/RequestCharged.cpp | 2 - .../source/model/RequestPayer.cpp | 2 - .../model/RequestPaymentConfiguration.cpp | 27 +- .../source/model/RequestProgress.cpp | 30 +- .../source/model/RestoreObjectRequest.cpp | 88 ++--- .../source/model/RestoreObjectResult.cpp | 32 +- .../source/model/RestoreRequest.cpp | 88 +---- .../source/model/RestoreRequestType.cpp | 2 - .../source/model/RestoreStatus.cpp | 42 +-- .../source/model/RoutingRule.cpp | 37 +-- .../src/aws-cpp-sdk-s3/source/model/Rule.cpp | 117 ------- .../source/model/S3KeyFilter.cpp | 35 +- .../source/model/S3Location.cpp | 115 +------ .../source/model/S3TablesBucketType.cpp | 2 - .../source/model/S3TablesDestination.cpp | 37 +-- .../model/S3TablesDestinationResult.cpp | 55 +--- .../aws-cpp-sdk-s3/source/model/SSEKMS.cpp | 27 +- .../source/model/SSEKMSEncryption.cpp | 40 +-- .../src/aws-cpp-sdk-s3/source/model/SSES3.cpp | 17 +- .../aws-cpp-sdk-s3/source/model/ScanRange.cpp | 41 +-- .../model/SelectObjectContentHandler.cpp | 61 ++-- .../SelectObjectContentInitialResponse.cpp | 16 +- .../model/SelectObjectContentRequest.cpp | 111 ++----- .../source/model/SelectParameters.cpp | 56 +--- .../source/model/ServerSideEncryption.cpp | 2 - .../model/ServerSideEncryptionByDefault.cpp | 38 +-- .../ServerSideEncryptionConfiguration.cpp | 35 +- .../source/model/ServerSideEncryptionRule.cpp | 48 +-- .../source/model/SessionCredentials.cpp | 56 +--- .../source/model/SessionMode.cpp | 2 - .../source/model/SimplePrefix.cpp | 17 +- .../source/model/SourceSelectionCriteria.cpp | 37 +-- .../source/model/SseKmsEncryptedObjects.cpp | 28 +- .../model/SseKmsEncryptedObjectsStatus.cpp | 2 - .../src/aws-cpp-sdk-s3/source/model/Stats.cpp | 54 +--- .../source/model/StatsEvent.cpp | 27 +- .../source/model/StorageClass.cpp | 2 - .../source/model/StorageClassAnalysis.cpp | 27 +- .../model/StorageClassAnalysisDataExport.cpp | 39 +-- .../StorageClassAnalysisSchemaVersion.cpp | 2 - .../source/model/TableSseAlgorithm.cpp | 2 - .../src/aws-cpp-sdk-s3/source/model/Tag.cpp | 37 +-- .../aws-cpp-sdk-s3/source/model/Tagging.cpp | 36 +-- .../source/model/TaggingDirective.cpp | 2 - .../source/model/TargetGrant.cpp | 38 +-- .../source/model/TargetObjectKeyFormat.cpp | 37 +-- .../src/aws-cpp-sdk-s3/source/model/Tier.cpp | 2 - .../aws-cpp-sdk-s3/source/model/Tiering.cpp | 40 +-- .../source/model/TopicConfiguration.cpp | 63 +--- .../model/TopicConfigurationDeprecated.cpp | 74 ----- .../source/model/Transition.cpp | 49 +-- .../TransitionDefaultMinimumObjectSize.cpp | 2 - .../source/model/TransitionStorageClass.cpp | 2 - .../src/aws-cpp-sdk-s3/source/model/Type.cpp | 2 - ...ataAnnotationTableConfigurationRequest.cpp | 72 ++--- ...dataInventoryTableConfigurationRequest.cpp | 72 ++--- ...tadataJournalTableConfigurationRequest.cpp | 72 ++--- .../model/UpdateObjectEncryptionRequest.cpp | 78 ++--- .../model/UpdateObjectEncryptionResult.cpp | 22 +- .../source/model/UploadPartCopyRequest.cpp | 104 +++--- .../source/model/UploadPartCopyResult.cpp | 64 +--- .../source/model/UploadPartRequest.cpp | 101 +++--- .../source/model/UploadPartResult.cpp | 122 +------ .../source/model/VersioningConfiguration.cpp | 39 +-- .../source/model/WebsiteConfiguration.cpp | 64 +--- .../model/WriteGetObjectResponseRequest.cpp | 86 +---- .../tests/s3-gen-tests/S3IncludeTests.cpp | 6 - 728 files changed, 5347 insertions(+), 18314 deletions(-) delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CloudFunctionConfiguration.h delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleConfiguration.h delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/NotificationConfigurationDeprecated.h delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfigurationDeprecated.h delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Rule.h delete mode 100644 generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfigurationDeprecated.h delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/CloudFunctionConfiguration.cpp delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/LifecycleConfiguration.cpp delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationDeprecated.cpp delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/QueueConfigurationDeprecated.cpp delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/Rule.cpp delete mode 100644 generated/src/aws-cpp-sdk-s3/source/model/TopicConfigurationDeprecated.cpp diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbacStatus.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbacStatus.h index 7004d4df1d2..618b942059a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbacStatus.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbacStatus.h @@ -34,7 +34,6 @@ class AbacStatus { AWS_S3_API AbacStatus() = default; AWS_S3_API AbacStatus(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AbacStatus& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortIncompleteMultipartUpload.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortIncompleteMultipartUpload.h index 0f4738ea08d..c15e0fea14d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortIncompleteMultipartUpload.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortIncompleteMultipartUpload.h @@ -30,7 +30,6 @@ class AbortIncompleteMultipartUpload { AWS_S3_API AbortIncompleteMultipartUpload() = default; AWS_S3_API AbortIncompleteMultipartUpload(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AbortIncompleteMultipartUpload& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortMultipartUploadRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortMultipartUploadRequest.h index b6b0e8f4a46..44170f72d92 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortMultipartUploadRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AbortMultipartUploadRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,11 +31,12 @@ class AbortMultipartUploadRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -68,11 +66,11 @@ class AbortMultipartUploadRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

Object - * Lambda access points are not supported by directory buckets.

- * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

Object Lambda + * access points are not supported by directory buckets.

S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -171,8 +169,8 @@ class AbortMultipartUploadRequest : public S3Request { * upload does not match the provided value, the operation returns a 412 * Precondition Failed error. If the initiated timestamp matches or if the * multipart upload doesn’t exist, the operation returns a 204 Success (No - * Content) response.

This functionality is only supported - * for directory buckets.

+ * Content)
response.

This functionality is only supported for + * directory buckets.

*/ inline const Aws::Utils::DateTime& GetIfMatchInitiatedTime() const { return m_ifMatchInitiatedTime; } inline bool IfMatchInitiatedTimeHasBeenSet() const { return m_ifMatchInitiatedTimeHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccelerateConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccelerateConfiguration.h index 49c84eb8980..f93fa14da95 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccelerateConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccelerateConfiguration.h @@ -32,7 +32,6 @@ class AccelerateConfiguration { AWS_S3_API AccelerateConfiguration() = default; AWS_S3_API AccelerateConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AccelerateConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlPolicy.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlPolicy.h index c4b459ab2c7..bb0511ac412 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlPolicy.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlPolicy.h @@ -31,7 +31,6 @@ class AccessControlPolicy { AWS_S3_API AccessControlPolicy() = default; AWS_S3_API AccessControlPolicy(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AccessControlPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlTranslation.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlTranslation.h index 655afea22e6..5811cb953ff 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlTranslation.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AccessControlTranslation.h @@ -29,7 +29,6 @@ class AccessControlTranslation { AWS_S3_API AccessControlTranslation() = default; AWS_S3_API AccessControlTranslation(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AccessControlTranslation& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsAndOperator.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsAndOperator.h index 896fa665454..de8b6b1b377 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsAndOperator.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsAndOperator.h @@ -33,7 +33,6 @@ class AnalyticsAndOperator { AWS_S3_API AnalyticsAndOperator() = default; AWS_S3_API AnalyticsAndOperator(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnalyticsAndOperator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsConfiguration.h index f11cd6e2c37..e8ab5c01f40 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsConfiguration.h @@ -31,7 +31,6 @@ class AnalyticsConfiguration { AWS_S3_API AnalyticsConfiguration() = default; AWS_S3_API AnalyticsConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnalyticsConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsExportDestination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsExportDestination.h index 974af3ea42f..d7a86685e73 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsExportDestination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsExportDestination.h @@ -28,7 +28,6 @@ class AnalyticsExportDestination { AWS_S3_API AnalyticsExportDestination() = default; AWS_S3_API AnalyticsExportDestination(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnalyticsExportDestination& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsFilter.h index 79cb393f13f..cd67fb6394a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsFilter.h @@ -33,7 +33,6 @@ class AnalyticsFilter { AWS_S3_API AnalyticsFilter() = default; AWS_S3_API AnalyticsFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnalyticsFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsS3BucketDestination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsS3BucketDestination.h index bc901d240cc..692099e142c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsS3BucketDestination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnalyticsS3BucketDestination.h @@ -30,7 +30,6 @@ class AnalyticsS3BucketDestination { AWS_S3_API AnalyticsS3BucketDestination() = default; AWS_S3_API AnalyticsS3BucketDestination(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnalyticsS3BucketDestination& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -52,9 +51,9 @@ class AnalyticsS3BucketDestination { ///@{ /** *

The account ID that owns the destination S3 bucket. If no account ID is - * provided, the owner is not validated before exporting data.

- * Although this value is optional, we strongly recommend that you set it to help - * prevent problems if the destination bucket ownership changes.

+ * provided, the owner is not validated before exporting data.

Although + * this value is optional, we strongly recommend that you set it to help prevent + * problems if the destination bucket ownership changes.

*/ inline const Aws::String& GetBucketAccountId() const { return m_bucketAccountId; } inline bool BucketAccountIdHasBeenSet() const { return m_bucketAccountIdHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationEntry.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationEntry.h index 8e2d8997d32..3ed50512edd 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationEntry.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationEntry.h @@ -35,7 +35,6 @@ class AnnotationEntry { AWS_S3_API AnnotationEntry() = default; AWS_S3_API AnnotationEntry(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnnotationEntry& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfiguration.h index e8c5631b845..f266aabe967 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfiguration.h @@ -33,7 +33,6 @@ class AnnotationTableConfiguration { AWS_S3_API AnnotationTableConfiguration() = default; AWS_S3_API AnnotationTableConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnnotationTableConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationResult.h index d43a1809176..9a29c8f6688 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationResult.h @@ -32,7 +32,6 @@ class AnnotationTableConfigurationResult { AWS_S3_API AnnotationTableConfigurationResult() = default; AWS_S3_API AnnotationTableConfigurationResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnnotationTableConfigurationResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationUpdates.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationUpdates.h index 7f3148fab17..2432165db08 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationUpdates.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/AnnotationTableConfigurationUpdates.h @@ -33,7 +33,6 @@ class AnnotationTableConfigurationUpdates { AWS_S3_API AnnotationTableConfigurationUpdates() = default; AWS_S3_API AnnotationTableConfigurationUpdates(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API AnnotationTableConfigurationUpdates& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BlockedEncryptionTypes.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BlockedEncryptionTypes.h index 584133948d2..cfe985b1e09 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BlockedEncryptionTypes.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BlockedEncryptionTypes.h @@ -49,15 +49,14 @@ class BlockedEncryptionTypes { AWS_S3_API BlockedEncryptionTypes() = default; AWS_S3_API BlockedEncryptionTypes(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API BlockedEncryptionTypes& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

The object encryption type that you want to block or unblock for an Amazon S3 - * general purpose bucket.

Currently, this parameter only supports - * blocking or unblocking server side encryption with customer-provided keys - * (SSE-C). For more information about SSE-C, see

Currently, this parameter only supports blocking + * or unblocking server side encryption with customer-provided keys (SSE-C). For + * more information about SSE-C, see Using * server-side encryption with customer-provided keys (SSE-C).

*/ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Bucket.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Bucket.h index cbd5bf0c8b1..bfe4373f4d9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Bucket.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Bucket.h @@ -30,7 +30,6 @@ class Bucket { AWS_S3_API Bucket() = default; AWS_S3_API Bucket(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Bucket& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -93,9 +92,9 @@ class Bucket { ///@{ /** *

The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify - * Amazon Web Services resources across all of Amazon Web Services.

- *

This parameter is only supported for S3 directory buckets. For more - * information, see

This + * parameter is only supported for S3 directory buckets. For more information, see + * Using * tags with directory buckets.

*/ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketInfo.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketInfo.h index 0fa27272d0a..c8c657ed3d1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketInfo.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketInfo.h @@ -23,8 +23,8 @@ namespace Model { *

Specifies the information about the bucket that will be created. For more * information about directory buckets, see Directory - * buckets in the Amazon S3 User Guide.

This functionality - * is only supported by directory buckets.

See Also:

in the Amazon S3 User Guide.

This functionality is + * only supported by directory buckets.

See Also:

AWS API * Reference

*/ @@ -33,7 +33,6 @@ class BucketInfo { AWS_S3_API BucketInfo() = default; AWS_S3_API BucketInfo(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API BucketInfo& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLifecycleConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLifecycleConfiguration.h index bc209616b5c..9114ab1a73e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLifecycleConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLifecycleConfiguration.h @@ -33,7 +33,6 @@ class BucketLifecycleConfiguration { AWS_S3_API BucketLifecycleConfiguration() = default; AWS_S3_API BucketLifecycleConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API BucketLifecycleConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLoggingStatus.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLoggingStatus.h index 45f300f3885..e6a15e0db38 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLoggingStatus.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/BucketLoggingStatus.h @@ -28,7 +28,6 @@ class BucketLoggingStatus { AWS_S3_API BucketLoggingStatus() = default; AWS_S3_API BucketLoggingStatus(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API BucketLoggingStatus& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSConfiguration.h index aaa5d9d42e9..3887ee94548 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSConfiguration.h @@ -33,7 +33,6 @@ class CORSConfiguration { AWS_S3_API CORSConfiguration() = default; AWS_S3_API CORSConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CORSConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSRule.h index 8b712953be8..5cb2cb76237 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CORSRule.h @@ -30,7 +30,6 @@ class CORSRule { AWS_S3_API CORSRule() = default; AWS_S3_API CORSRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CORSRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVInput.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVInput.h index b3d3ddcc379..c92dd320e51 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVInput.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVInput.h @@ -30,7 +30,6 @@ class CSVInput { AWS_S3_API CSVInput() = default; AWS_S3_API CSVInput(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CSVInput& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVOutput.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVOutput.h index 4107e92523e..ddbb9f7b977 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVOutput.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CSVOutput.h @@ -30,7 +30,6 @@ class CSVOutput { AWS_S3_API CSVOutput() = default; AWS_S3_API CSVOutput(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CSVOutput& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Checksum.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Checksum.h index b5ba59bd696..979ba901aa1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Checksum.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Checksum.h @@ -30,7 +30,6 @@ class Checksum { AWS_S3_API Checksum() = default; AWS_S3_API Checksum(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Checksum& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CloudFunctionConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CloudFunctionConfiguration.h deleted file mode 100644 index b04f5351e1d..00000000000 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CloudFunctionConfiguration.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once -#include -#include -#include -#include - -#include - -namespace Aws { -namespace Utils { -namespace Xml { -class XmlNode; -} // namespace Xml -} // namespace Utils -namespace S3 { -namespace Model { - -/** - *

Container for specifying the Lambda notification configuration.

See - * Also:

AWS - * API Reference

- */ -class CloudFunctionConfiguration { - public: - AWS_S3_API CloudFunctionConfiguration() = default; - AWS_S3_API CloudFunctionConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API CloudFunctionConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; - - ///@{ - - inline const Aws::String& GetId() const { return m_id; } - inline bool IdHasBeenSet() const { return m_idHasBeenSet; } - template - void SetId(IdT&& value) { - m_idHasBeenSet = true; - m_id = std::forward(value); - } - template - CloudFunctionConfiguration& WithId(IdT&& value) { - SetId(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

Bucket events for which to send notifications.

- */ - inline const Aws::Vector& GetEvents() const { return m_events; } - inline bool EventsHasBeenSet() const { return m_eventsHasBeenSet; } - template > - void SetEvents(EventsT&& value) { - m_eventsHasBeenSet = true; - m_events = std::forward(value); - } - template > - CloudFunctionConfiguration& WithEvents(EventsT&& value) { - SetEvents(std::forward(value)); - return *this; - } - inline CloudFunctionConfiguration& AddEvents(Event value) { - m_eventsHasBeenSet = true; - m_events.push_back(value); - return *this; - } - ///@} - - ///@{ - /** - *

Lambda cloud function ARN that Amazon S3 can invoke when it detects events of - * the specified type.

- */ - inline const Aws::String& GetCloudFunction() const { return m_cloudFunction; } - inline bool CloudFunctionHasBeenSet() const { return m_cloudFunctionHasBeenSet; } - template - void SetCloudFunction(CloudFunctionT&& value) { - m_cloudFunctionHasBeenSet = true; - m_cloudFunction = std::forward(value); - } - template - CloudFunctionConfiguration& WithCloudFunction(CloudFunctionT&& value) { - SetCloudFunction(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

The role supporting the invocation of the Lambda function

- */ - inline const Aws::String& GetInvocationRole() const { return m_invocationRole; } - inline bool InvocationRoleHasBeenSet() const { return m_invocationRoleHasBeenSet; } - template - void SetInvocationRole(InvocationRoleT&& value) { - m_invocationRoleHasBeenSet = true; - m_invocationRole = std::forward(value); - } - template - CloudFunctionConfiguration& WithInvocationRole(InvocationRoleT&& value) { - SetInvocationRole(std::forward(value)); - return *this; - } - ///@} - private: - Aws::String m_id; - - Aws::Vector m_events; - - Aws::String m_cloudFunction; - - Aws::String m_invocationRole; - bool m_idHasBeenSet = false; - bool m_eventsHasBeenSet = false; - bool m_cloudFunctionHasBeenSet = false; - bool m_invocationRoleHasBeenSet = false; -}; - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CommonPrefix.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CommonPrefix.h index 4d285a71cd8..97d28501b0a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CommonPrefix.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CommonPrefix.h @@ -24,15 +24,15 @@ namespace Model { * that act like subdirectories in the directory specified by Prefix. For example, * if the prefix is notes/ and the delimiter is a slash (/) as in * notes/summer/july, the common prefix is notes/summer/.

See Also:

- * AWS - * API Reference

+ * AWS API + * Reference

*/ class CommonPrefix { public: AWS_S3_API CommonPrefix() = default; AWS_S3_API CommonPrefix(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CommonPrefix& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h index e2e8ee947a3..b061cf3ba17 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,11 +32,12 @@ class CompleteMultipartUploadRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -69,11 +67,11 @@ class CompleteMultipartUploadRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

Object - * Lambda access points are not supported by directory buckets.

- * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

Object Lambda + * access points are not supported by directory buckets.

S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadResult.h index f019a429a48..bcc3b733344 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadResult.h @@ -50,8 +50,8 @@ class CompleteMultipartUploadResult { ///@{ /** *

The name of the bucket that contains the newly created object. Does not - * return the access point ARN or access point alias if used.

Access - * points are not supported by directory buckets.

+ * return the access point ARN or access point alias if used.

Access points + * are not supported by directory buckets.

*/ inline const Aws::String& GetBucket() const { return m_bucket; } template @@ -87,8 +87,8 @@ class CompleteMultipartUploadResult { /** *

If the object expiration is configured, this will contain the expiration date * (expiry-date) and rule ID (rule-id). The value of - * rule-id is URL-encoded.

This functionality is not - * supported for directory buckets.

+ * rule-id is URL-encoded.

This functionality is not supported + * for directory buckets.

*/ inline const Aws::String& GetExpiration() const { return m_expiration; } template @@ -373,7 +373,7 @@ class CompleteMultipartUploadResult { *

The server-side encryption algorithm used when storing this object in Amazon * S3.

When accessing data stored in Amazon FSx file systems using S3 * access points, the only valid server side encryption option is - * aws:fsx.

+ * aws:fsx.

*/ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedMultipartUpload.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedMultipartUpload.h index 02c34cbbdce..f6ee74f2932 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedMultipartUpload.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedMultipartUpload.h @@ -30,7 +30,6 @@ class CompletedMultipartUpload { AWS_S3_API CompletedMultipartUpload() = default; AWS_S3_API CompletedMultipartUpload(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CompletedMultipartUpload& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedPart.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedPart.h index a641b2d3d7d..aec8a897eaf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedPart.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CompletedPart.h @@ -28,7 +28,6 @@ class CompletedPart { AWS_S3_API CompletedPart() = default; AWS_S3_API CompletedPart(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CompletedPart& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Condition.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Condition.h index 50db7fd1728..75ec53116b6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Condition.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Condition.h @@ -32,7 +32,6 @@ class Condition { AWS_S3_API Condition() = default; AWS_S3_API Condition(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Condition& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectRequest.h index f37a635719c..26f9c0ccbb6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectRequest.h @@ -23,9 +23,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -43,11 +40,12 @@ class CopyObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -70,12 +68,11 @@ class CopyObjectRequest : public S3Request { * ACL expressed in the XML format. For more information, see Controlling * ownership of objects and disabling ACLs in the Amazon S3 User - * Guide.

  • If your destination bucket uses the bucket - * owner enforced setting for Object Ownership, all objects written to the bucket - * by any account will be owned by the bucket owner.

  • This - * functionality is not supported for directory buckets.

  • This - * functionality is not supported for Amazon S3 on Outposts.

- * + * Guide.

  • If your destination bucket uses the bucket owner + * enforced setting for Object Ownership, all objects written to the bucket by any + * account will be owned by the bucket owner.

  • This functionality + * is not supported for directory buckets.

  • This functionality is + * not supported for Amazon S3 on Outposts.

*/ inline ObjectCannedACL GetACL() const { return m_aCL; } inline bool ACLHasBeenSet() const { return m_aCLHasBeenSet; } @@ -101,31 +98,31 @@ class CopyObjectRequest : public S3Request { * amzn-s3-demo-bucket--usw2-az1--x-s3). For * information about bucket naming restrictions, see Directory - * bucket naming rules in the Amazon S3 User Guide.

- *

Copying objects across different Amazon Web Services Regions isn't supported - * when the source or destination bucket is in Amazon Web Services Local Zones. The - * source and destination buckets must have the same parent Amazon Web Services - * Region. Otherwise, you get an HTTP 400 Bad Request error with the - * error code InvalidRequest.

Access points - - * When you use this action with an access point for general purpose buckets, you - * must provide the alias of the access point in place of the bucket name or - * specify the access point ARN. When you use this action with an access point for - * directory buckets, you must provide the access point name in place of the bucket - * name. When using the access point ARN, you must direct requests to the access - * point hostname. The access point hostname takes the form + * bucket naming rules in the Amazon S3 User Guide.

Copying + * objects across different Amazon Web Services Regions isn't supported when the + * source or destination bucket is in Amazon Web Services Local Zones. The source + * and destination buckets must have the same parent Amazon Web Services Region. + * Otherwise, you get an HTTP 400 Bad Request error with the error + * code InvalidRequest.

Access points - When you use + * this action with an access point for general purpose buckets, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When you use this action with an access point for directory buckets, + * you must provide the access point name in place of the bucket name. When using + * the access point ARN, you must direct requests to the access point hostname. The + * access point hostname takes the form * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. * When using this action with an access point through the Amazon Web Services * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

Object - * Lambda access points are not supported by directory buckets.

- * S3 on Outposts - When you use this action with S3 on Outposts, you must - * use the Outpost bucket access point ARN or the access point alias for the - * destination bucket. You can only copy objects within the same Outpost bucket. - * It's not supported to copy objects across different Amazon Web Services - * Outposts, between buckets on the same Outposts, or between Outposts buckets and - * any other bucket types. For more information about S3 on Outposts, see in the Amazon S3 User Guide.

Object Lambda + * access points are not supported by directory buckets.

S3 on + * Outposts - When you use this action with S3 on Outposts, you must use the + * Outpost bucket access point ARN or the access point alias for the destination + * bucket. You can only copy objects within the same Outpost bucket. It's not + * supported to copy objects across different Amazon Web Services Outposts, between + * buckets on the same Outposts, or between Outposts buckets and any other bucket + * types. For more information about S3 on Outposts, see What * is S3 on Outposts? in the S3 on Outposts guide. When you use this * action with S3 on Outposts through the REST API, you must direct requests to the @@ -179,9 +176,9 @@ class CopyObjectRequest : public S3Request { * it's present on the source object). You can optionally specify a different * checksum algorithm to use with the x-amz-checksum-algorithm header. * Unrecognized or unsupported values will respond with the HTTP status code - * 400 Bad Request.

For directory buckets, when you use - * Amazon Web Services SDKs, CRC32 is the default checksum algorithm - * that's used for performance.

+ * 400 Bad Request.

For directory buckets, when you use Amazon + * Web Services SDKs, CRC32 is the default checksum algorithm that's + * used for performance.

*/ inline ChecksumAlgorithm GetChecksumAlgorithm() const { return m_checksumAlgorithm; } inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; } @@ -293,7 +290,7 @@ class CopyObjectRequest : public S3Request { * must be URL-encoded.

  • For objects accessed through access * points, specify the Amazon Resource Name (ARN) of the object as accessed through * the access point, in the format - * arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>. + * arn:aws:s3:::accesspoint//object/. * For example, to copy the object reports/january.pdf through access * point my-access-point owned by account 123456789012 in * Region us-west-2, use the URL encoding of @@ -301,10 +298,10 @@ class CopyObjectRequest : public S3Request { * The value must be URL encoded.

    • Amazon S3 supports copy * operations using Access points only when the source and destination buckets are * in the same Amazon Web Services Region.

    • Access points are not - * supported by directory buckets.

    Alternatively, for - * objects accessed through Amazon S3 on Outposts, specify the ARN of the object as + * supported by directory buckets.

  • Alternatively, for objects + * accessed through Amazon S3 on Outposts, specify the ARN of the object as * accessed in the format - * arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>. + * arn:aws:s3-outposts:::outpost//object/. * For example, to copy the object reports/january.pdf through outpost * my-outpost owned by account 123456789012 in Region * us-west-2, use the URL encoding of @@ -314,7 +311,7 @@ class CopyObjectRequest : public S3Request { * identifies the current version of an object to copy. If the current version is a * delete marker, Amazon S3 behaves as if the object was deleted. To copy a * different version, use the versionId query parameter. Specifically, - * append ?versionId=<version-id> to the value (for example, + * append ?versionId= to the value (for example, * awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). * If you don't specify a version ID, Amazon S3 copies the latest version of the * source object.

    If you enable versioning on the destination bucket, Amazon @@ -462,9 +459,9 @@ class CopyObjectRequest : public S3Request { ///@{ /** *

    Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the - * object.

    • This functionality is not supported for - * directory buckets.

    • This functionality is not supported for - * Amazon S3 on Outposts.

    + * object.

    • This functionality is not supported for directory + * buckets.

    • This functionality is not supported for Amazon S3 on + * Outposts.

    */ inline const Aws::String& GetGrantFullControl() const { return m_grantFullControl; } inline bool GrantFullControlHasBeenSet() const { return m_grantFullControlHasBeenSet; } @@ -503,10 +500,9 @@ class CopyObjectRequest : public S3Request { ///@{ /** - *

    Allows grantee to read the object ACL.

    • This - * functionality is not supported for directory buckets.

    • This - * functionality is not supported for Amazon S3 on Outposts.

    - * + *

    Allows grantee to read the object ACL.

    • This functionality + * is not supported for directory buckets.

    • This functionality is + * not supported for Amazon S3 on Outposts.

    */ inline const Aws::String& GetGrantReadACP() const { return m_grantReadACP; } inline bool GrantReadACPHasBeenSet() const { return m_grantReadACPHasBeenSet; } @@ -524,9 +520,9 @@ class CopyObjectRequest : public S3Request { ///@{ /** - *

    Allows grantee to write the ACL for the applicable object.

      - *
    • This functionality is not supported for directory buckets.

    • - *
    • This functionality is not supported for Amazon S3 on Outposts.

    • + *

      Allows grantee to write the ACL for the applicable object.

      • + *

        This functionality is not supported for directory buckets.

      • + *

        This functionality is not supported for Amazon S3 on Outposts.

      • *
      */ inline const Aws::String& GetGrantWriteACP() const { return m_grantWriteACP; } @@ -667,9 +663,9 @@ class CopyObjectRequest : public S3Request { /** *

      Specifies whether the object tag-set is copied from the source object or * replaced with the tag-set that's provided in the request.

      The default - * value is COPY.

      Directory buckets - For - * directory buckets in a CopyObject operation, only the empty tag-set - * is supported. Any requests that attempt to write non-empty tags into directory + * value is COPY.

      Directory buckets - For directory + * buckets in a CopyObject operation, only the empty tag-set is + * supported. Any requests that attempt to write non-empty tags into directory * buckets will receive a 501 Not Implemented status code. When the * destination bucket is a directory bucket, you will receive a 501 Not * Implemented response in any of the following situations:

      • @@ -720,18 +716,18 @@ class CopyObjectRequest : public S3Request { * s3:PutObjectAnnotation permission on the destination. Each * annotation copied is billed as a separate PUT request. If annotations on the * source are modified during the copy, Amazon S3 returns a retryable error.

        - *

        For directory buckets, annotations are not supported. Use + *

        For directory buckets, annotations are not supported. Use * EXCLUDE to copy objects to directory buckets without errors. If you * specify COPY for a directory bucket, the request returns HTTP 501 - * (Not Implemented).

        When you copy objects using multipart - * upload (for example, when the Amazon Web Services CLI or Amazon Web Services - * SDKs use Transfer Manager for objects larger than approximately 8 MB), - * annotations are not copied by default. To include annotations, specify - * --copy-props default in the Amazon Web Services CLI or the - * equivalent SDK configuration. With this opt-in, the SDK reads source - * annotations, completes the multipart upload, and then writes each annotation to - * the destination. Between the upload completion and the last annotation write, - * the destination object exists without all its annotations.

        + * (Not Implemented).

        When you copy objects using multipart upload (for + * example, when the Amazon Web Services CLI or Amazon Web Services SDKs use + * Transfer Manager for objects larger than approximately 8 MB), annotations are + * not copied by default. To include annotations, specify --copy-props + * default in the Amazon Web Services CLI or the equivalent SDK + * configuration. With this opt-in, the SDK reads source annotations, completes the + * multipart upload, and then writes each annotation to the destination. Between + * the upload completion and the last annotation write, the destination object + * exists without all its annotations.

        */ inline AnnotationDirective GetAnnotationDirective() const { return m_annotationDirective; } inline bool AnnotationDirectiveHasBeenSet() const { return m_annotationDirectiveHasBeenSet; } @@ -833,15 +829,15 @@ class CopyObjectRequest : public S3Request { * will be stored in the STANDARD Storage Class by default. The * STANDARD storage class provides high durability and high * availability. Depending on performance needs, you can specify a different - * Storage Class.

        • Directory buckets - Directory - * buckets only support EXPRESS_ONEZONE (the S3 Express One Zone - * storage class) in Availability Zones and ONEZONE_IA (the S3 One + * Storage Class.

          • Directory buckets - Directory buckets + * only support EXPRESS_ONEZONE (the S3 Express One Zone storage + * class) in Availability Zones and ONEZONE_IA (the S3 One * Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported * storage class values won't write a destination object and will respond with the * HTTP status code 400 Bad Request.

          • Amazon S3 * on Outposts - S3 on Outposts only uses the OUTPOSTS Storage - * Class.

          You can use the CopyObject action - * to change the storage class of an object that is already stored in Amazon S3 by + * Class.

        You can use the CopyObject action to + * change the storage class of an object that is already stored in Amazon S3 by * using the x-amz-storage-class header. For more information, see Storage * Classes in the Amazon S3 User Guide.

        Before using an object as @@ -878,8 +874,7 @@ class CopyObjectRequest : public S3Request { * unique to each object and is not copied when using the * x-amz-metadata-directive header. Instead, you may opt to provide * this header in combination with the x-amz-metadata-directive - * header.

        This functionality is not supported for directory - * buckets.

        + * header.

        This functionality is not supported for directory buckets.

        */ inline const Aws::String& GetWebsiteRedirectLocation() const { return m_websiteRedirectLocation; } inline bool WebsiteRedirectLocationHasBeenSet() const { return m_websiteRedirectLocationHasBeenSet; } @@ -904,9 +899,8 @@ class CopyObjectRequest : public S3Request { * the target object with an Amazon S3 managed key, a KMS key, or a * customer-provided key. If the encryption setting in your request is different * from the default encryption configuration of the destination bucket, the - * encryption setting in your request takes precedence.

        This - * functionality is not supported when the destination bucket is a directory - * bucket.

        + * encryption setting in your request takes precedence.

        This functionality + * is not supported when the destination bucket is a directory bucket.

        */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -950,8 +944,8 @@ class CopyObjectRequest : public S3Request { /** *

        Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

        This functionality - * is not supported when the destination bucket is a directory bucket.

        + * encryption key was transmitted without error.

        This functionality is not + * supported when the destination bucket is a directory bucket.

        */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } @@ -1070,8 +1064,8 @@ class CopyObjectRequest : public S3Request { * example, AES256).

        If the source object for the copy is * stored in Amazon S3 using SSE-C, you must provide the necessary encryption * information in your request so that Amazon S3 can decrypt the object for - * copying.

        This functionality is not supported when the source - * object is in a directory bucket.

        + * copying.

        This functionality is not supported when the source object is + * in a directory bucket.

        */ inline const Aws::String& GetCopySourceSSECustomerAlgorithm() const { return m_copySourceSSECustomerAlgorithm; } inline bool CopySourceSSECustomerAlgorithmHasBeenSet() const { return m_copySourceSSECustomerAlgorithmHasBeenSet; } @@ -1094,8 +1088,8 @@ class CopyObjectRequest : public S3Request { * the same one that was used when the source object was created.

        If the * source object for the copy is stored in Amazon S3 using SSE-C, you must provide * the necessary encryption information in your request so that Amazon S3 can - * decrypt the object for copying.

        This functionality is not - * supported when the source object is in a directory bucket.

        + * decrypt the object for copying.

        This functionality is not supported when + * the source object is in a directory bucket.

        */ inline const Aws::String& GetCopySourceSSECustomerKey() const { return m_copySourceSSECustomerKey; } inline bool CopySourceSSECustomerKeyHasBeenSet() const { return m_copySourceSSECustomerKeyHasBeenSet; } @@ -1118,8 +1112,8 @@ class CopyObjectRequest : public S3Request { * encryption key was transmitted without error.

        If the source object for * the copy is stored in Amazon S3 using SSE-C, you must provide the necessary * encryption information in your request so that Amazon S3 can decrypt the object - * for copying.

        This functionality is not supported when the source - * object is in a directory bucket.

        + * for copying.

        This functionality is not supported when the source object + * is in a directory bucket.

        */ inline const Aws::String& GetCopySourceSSECustomerKeyMD5() const { return m_copySourceSSECustomerKeyMD5; } inline bool CopySourceSSECustomerKeyMD5HasBeenSet() const { return m_copySourceSSECustomerKeyMD5HasBeenSet; } @@ -1157,18 +1151,18 @@ class CopyObjectRequest : public S3Request { * COPY for the x-amz-tagging-directive, you don't need * to set the x-amz-tagging header, because the tag-set will be copied * from the source object directly. The tag-set must be encoded as URL Query - * parameters.

        The default value is the empty value.

        - * Directory buckets - For directory buckets in a CopyObject - * operation, only the empty tag-set is supported. Any requests that attempt to - * write non-empty tags into directory buckets will receive a 501 Not - * Implemented status code. When the destination bucket is a directory - * bucket, you will receive a 501 Not Implemented response in any of - * the following situations:

        • When you attempt to COPY - * the tag-set from an S3 source object that has non-empty tags.

        • - *

          When you attempt to REPLACE the tag-set of a source object and - * set a non-empty value to x-amz-tagging.

        • When you - * don't set the x-amz-tagging-directive header and the source object - * has non-empty tags. This is because the default value of + * parameters.

          The default value is the empty value.

          Directory + * buckets - For directory buckets in a CopyObject operation, only + * the empty tag-set is supported. Any requests that attempt to write non-empty + * tags into directory buckets will receive a 501 Not Implemented + * status code. When the destination bucket is a directory bucket, you will receive + * a 501 Not Implemented response in any of the following + * situations:

          • When you attempt to COPY the tag-set + * from an S3 source object that has non-empty tags.

          • When you + * attempt to REPLACE the tag-set of a source object and set a + * non-empty value to x-amz-tagging.

          • When you don't + * set the x-amz-tagging-directive header and the source object has + * non-empty tags. This is because the default value of * x-amz-tagging-directive is COPY.

          *

          Because only the empty tag-set is supported for directory buckets in a * CopyObject operation, the following situations are allowed:

          @@ -1201,8 +1195,8 @@ class CopyObjectRequest : public S3Request { ///@{ /** - *

          The Object Lock mode that you want to apply to the object copy.

          - *

          This functionality is not supported for directory buckets.

          + *

          The Object Lock mode that you want to apply to the object copy.

          This + * functionality is not supported for directory buckets.

          */ inline ObjectLockMode GetObjectLockMode() const { return m_objectLockMode; } inline bool ObjectLockModeHasBeenSet() const { return m_objectLockModeHasBeenSet; } @@ -1219,8 +1213,7 @@ class CopyObjectRequest : public S3Request { ///@{ /** *

          The date and time when you want the Object Lock of the object copy to - * expire.

          This functionality is not supported for directory - * buckets.

          + * expire.

          This functionality is not supported for directory buckets.

          */ inline const Aws::Utils::DateTime& GetObjectLockRetainUntilDate() const { return m_objectLockRetainUntilDate; } inline bool ObjectLockRetainUntilDateHasBeenSet() const { return m_objectLockRetainUntilDateHasBeenSet; } @@ -1239,7 +1232,7 @@ class CopyObjectRequest : public S3Request { ///@{ /** *

          Specifies whether you want to apply a legal hold to the object copy.

          - *

          This functionality is not supported for directory buckets.

          + *

          This functionality is not supported for directory buckets.

          */ inline ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatus() const { return m_objectLockLegalHoldStatus; } inline bool ObjectLockLegalHoldStatusHasBeenSet() const { return m_objectLockLegalHoldStatusHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResult.h index 4bb09acdd82..6952b2d4b18 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResult.h @@ -30,6 +30,23 @@ class CopyObjectResult { AWS_S3_API CopyObjectResult(const Aws::AmazonWebServiceResult& result); AWS_S3_API CopyObjectResult& operator=(const Aws::AmazonWebServiceResult& result); + ///@{ + /** + *

          Container for all response elements.

          + */ + inline const CopyObjectResultDetails& GetCopyObjectResultDetails() const { return m_copyObjectResultDetails; } + template + void SetCopyObjectResultDetails(CopyObjectResultDetailsT&& value) { + m_copyObjectResultDetailsHasBeenSet = true; + m_copyObjectResultDetails = std::forward(value); + } + template + CopyObjectResult& WithCopyObjectResultDetails(CopyObjectResultDetailsT&& value) { + SetCopyObjectResultDetails(std::forward(value)); + return *this; + } + ///@} + ///@{ /** *

          If the object expiration is configured, the response includes this @@ -52,9 +69,8 @@ class CopyObjectResult { ///@{ /** - *

          Version ID of the source object that was copied.

          This - * functionality is not supported when the source object is in a directory - * bucket.

          + *

          Version ID of the source object that was copied.

          This functionality + * is not supported when the source object is in a directory bucket.

          */ inline const Aws::String& GetCopySourceVersionId() const { return m_copySourceVersionId; } template @@ -90,9 +106,9 @@ class CopyObjectResult { ///@{ /** *

          The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

          When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

          + * Amazon S3 or Amazon FSx.

          When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

          */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -109,8 +125,8 @@ class CopyObjectResult { /** *

          If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

          This functionality is not supported for - * directory buckets.

          + * algorithm that's used.

          This functionality is not supported for directory + * buckets.

          */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -130,7 +146,7 @@ class CopyObjectResult { *

          If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

          - *

          This functionality is not supported for directory buckets.

          + *

          This functionality is not supported for directory buckets.

          */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template @@ -211,23 +227,6 @@ class CopyObjectResult { } ///@} - ///@{ - /** - *

          Container for all response elements.

          - */ - inline const CopyObjectResultDetails& GetCopyObjectResultDetails() const { return m_copyObjectResultDetails; } - template - void SetCopyObjectResultDetails(CopyObjectResultDetailsT&& value) { - m_copyObjectResultDetailsHasBeenSet = true; - m_copyObjectResultDetails = std::forward(value); - } - template - CopyObjectResult& WithCopyObjectResultDetails(CopyObjectResultDetailsT&& value) { - SetCopyObjectResultDetails(std::forward(value)); - return *this; - } - ///@} - ///@{ inline const Aws::String& GetRequestId() const { return m_requestId; } @@ -245,6 +244,8 @@ class CopyObjectResult { inline Aws::Http::HttpResponseCode GetHttpResponseCode() const { return m_HttpResponseCode; } private: + CopyObjectResultDetails m_copyObjectResultDetails; + Aws::String m_expiration; Aws::String m_copySourceVersionId; @@ -265,10 +266,9 @@ class CopyObjectResult { RequestCharged m_requestCharged{RequestCharged::NOT_SET}; - CopyObjectResultDetails m_copyObjectResultDetails; - Aws::String m_requestId; Aws::Http::HttpResponseCode m_HttpResponseCode; + bool m_copyObjectResultDetailsHasBeenSet = false; bool m_expirationHasBeenSet = false; bool m_copySourceVersionIdHasBeenSet = false; bool m_versionIdHasBeenSet = false; @@ -279,7 +279,6 @@ class CopyObjectResult { bool m_sSEKMSEncryptionContextHasBeenSet = false; bool m_bucketKeyEnabledHasBeenSet = false; bool m_requestChargedHasBeenSet = false; - bool m_copyObjectResultDetailsHasBeenSet = false; bool m_requestIdHasBeenSet = false; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResultDetails.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResultDetails.h index ce4e0a0e1f5..f92394a813c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResultDetails.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyObjectResultDetails.h @@ -22,7 +22,7 @@ namespace Model { /** *

          Container for all response elements.

          See Also:

          AWS + * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectResultDetails">AWS * API Reference

          */ class CopyObjectResultDetails { @@ -30,7 +30,6 @@ class CopyObjectResultDetails { AWS_S3_API CopyObjectResultDetails() = default; AWS_S3_API CopyObjectResultDetails(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CopyObjectResultDetails& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyPartResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyPartResult.h index 4e76745ac71..a4b9f86fb09 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyPartResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CopyPartResult.h @@ -29,7 +29,6 @@ class CopyPartResult { AWS_S3_API CopyPartResult() = default; AWS_S3_API CopyPartResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CopyPartResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketConfiguration.h index a0e88abc14b..b8bb68f091e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketConfiguration.h @@ -32,7 +32,6 @@ class CreateBucketConfiguration { AWS_S3_API CreateBucketConfiguration() = default; AWS_S3_API CreateBucketConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API CreateBucketConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -46,8 +45,8 @@ class CreateBucketConfiguration { * eu-west-1.

          For a list of the valid values for all of the * Amazon Web Services Regions, see Regions - * and Endpoints.

          This functionality is not supported for - * directory buckets.

          + * and Endpoints.

          This functionality is not supported for directory + * buckets.

          */ inline BucketLocationConstraint GetLocationConstraint() const { return m_locationConstraint; } inline bool LocationConstraintHasBeenSet() const { return m_locationConstraintHasBeenSet; } @@ -69,8 +68,8 @@ class CreateBucketConfiguration { * Otherwise, you get an HTTP 403 Forbidden error with the error code * AccessDenied. To learn more, see Enable - * accounts for Local Zones in the Amazon S3 User Guide.

          - *

          This functionality is only supported by directory buckets.

          + * accounts for Local Zones in the Amazon S3 User Guide.

          This + * functionality is only supported by directory buckets.

          */ inline const LocationInfo& GetLocation() const { return m_location; } inline bool LocationHasBeenSet() const { return m_locationHasBeenSet; } @@ -88,8 +87,8 @@ class CreateBucketConfiguration { ///@{ /** - *

          Specifies the information about the bucket that will be created.

          - *

          This functionality is only supported by directory buckets.

          + *

          Specifies the information about the bucket that will be created.

          This + * functionality is only supported by directory buckets.

          */ inline const BucketInfo& GetBucket() const { return m_bucket; } inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataConfigurationRequest.h index 70b8510f374..10c8b812e88 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,9 @@ class CreateBucketMetadataConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataTableConfigurationRequest.h index eeff0e041cd..daf282c45ef 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketMetadataTableConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,9 @@ class CreateBucketMetadataTableConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h index e355e53c135..f4e4e7e6457 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h @@ -16,9 +16,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -36,11 +33,12 @@ class CreateBucketRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -48,8 +46,8 @@ class CreateBucketRequest : public S3Request { ///@{ /** - *

          The canned ACL to apply to the bucket.

          This functionality is - * not supported for directory buckets.

          + *

          The canned ACL to apply to the bucket.

          This functionality is not + * supported for directory buckets.

          */ inline BucketCannedACL GetACL() const { return m_aCL; } inline bool ACLHasBeenSet() const { return m_aCLHasBeenSet; } @@ -116,8 +114,7 @@ class CreateBucketRequest : public S3Request { ///@{ /** *

          Allows grantee the read, write, read ACP, and write ACP permissions on the - * bucket.

          This functionality is not supported for directory - * buckets.

          + * bucket.

          This functionality is not supported for directory buckets.

          */ inline const Aws::String& GetGrantFullControl() const { return m_grantFullControl; } inline bool GrantFullControlHasBeenSet() const { return m_grantFullControlHasBeenSet; } @@ -135,8 +132,8 @@ class CreateBucketRequest : public S3Request { ///@{ /** - *

          Allows grantee to list the objects in the bucket.

          This - * functionality is not supported for directory buckets.

          + *

          Allows grantee to list the objects in the bucket.

          This functionality + * is not supported for directory buckets.

          */ inline const Aws::String& GetGrantRead() const { return m_grantRead; } inline bool GrantReadHasBeenSet() const { return m_grantReadHasBeenSet; } @@ -154,8 +151,8 @@ class CreateBucketRequest : public S3Request { ///@{ /** - *

          Allows grantee to read the bucket ACL.

          This functionality is - * not supported for directory buckets.

          + *

          Allows grantee to read the bucket ACL.

          This functionality is not + * supported for directory buckets.

          */ inline const Aws::String& GetGrantReadACP() const { return m_grantReadACP; } inline bool GrantReadACPHasBeenSet() const { return m_grantReadACPHasBeenSet; } @@ -175,8 +172,7 @@ class CreateBucketRequest : public S3Request { /** *

          Allows grantee to create new objects in the bucket.

          For the bucket and * object owners of existing objects, also allows deletions and overwrites of those - * objects.

          This functionality is not supported for directory - * buckets.

          + * objects.

          This functionality is not supported for directory buckets.

          */ inline const Aws::String& GetGrantWrite() const { return m_grantWrite; } inline bool GrantWriteHasBeenSet() const { return m_grantWriteHasBeenSet; } @@ -214,8 +210,7 @@ class CreateBucketRequest : public S3Request { ///@{ /** *

          Specifies whether you want S3 Object Lock to be enabled for the new - * bucket.

          This functionality is not supported for directory - * buckets.

          + * bucket.

          This functionality is not supported for directory buckets.

          */ inline bool GetObjectLockEnabledForBucket() const { return m_objectLockEnabledForBucket; } inline bool ObjectLockEnabledForBucketHasBeenSet() const { return m_objectLockEnabledForBucketHasBeenSet; } @@ -262,7 +257,7 @@ class CreateBucketRequest : public S3Request { * about bucket naming restrictions, see Account * regional namespace naming rules in the Amazon S3 User Guide.

          - *

          This functionality is not supported for directory buckets.

          + *

          This functionality is not supported for directory buckets.

          */ inline BucketNamespace GetBucketNamespace() const { return m_bucketNamespace; } inline bool BucketNamespaceHasBeenSet() const { return m_bucketNamespaceHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketResult.h index a6ff4fa5981..54553092a08 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketResult.h @@ -52,9 +52,9 @@ class CreateBucketResult { ///@{ /** *

          The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify - * Amazon Web Services resources across all of Amazon Web Services.

          - *

          This parameter is only supported for S3 directory buckets. For more - * information, see

          This + * parameter is only supported for S3 directory buckets. For more information, see + * Using * tags with directory buckets.

          */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadRequest.h index a3ff365b8cb..b4acc034c2c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadRequest.h @@ -21,9 +21,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -41,11 +38,12 @@ class CreateMultipartUploadRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -64,10 +62,10 @@ class CreateMultipartUploadRequest : public S3Request { * access control list (ACL) on the new object. For more information, see Using * ACLs. One way to grant the permissions using the request headers is to - * specify a canned ACL with the x-amz-acl request header.

          - *
          • This functionality is not supported for directory buckets.

            - *
          • This functionality is not supported for Amazon S3 on Outposts.

            - *
          + * specify a canned ACL with the x-amz-acl request header.

            + *
          • This functionality is not supported for directory buckets.

          • + *
          • This functionality is not supported for Amazon S3 on Outposts.

          • + *
          */ inline ObjectCannedACL GetACL() const { return m_aCL; } inline bool ACLHasBeenSet() const { return m_aCLHasBeenSet; } @@ -106,11 +104,11 @@ class CreateMultipartUploadRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

          Object - * Lambda access points are not supported by directory buckets.

          - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

          Object Lambda + * access points are not supported by directory buckets.

          S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -267,14 +265,13 @@ class CreateMultipartUploadRequest : public S3Request { * America (São Paulo)

        For a list of all the Amazon S3 supported * Regions and endpoints, see Regions - * and Endpoints in the Amazon Web Services General Reference.

        - *

      For example, the following x-amz-grant-read header - * grants the Amazon Web Services accounts identified by account IDs permissions to - * read object data and its metadata:

      x-amz-grant-read: - * id="11112222333", id="444455556666"

      • This - * functionality is not supported for directory buckets.

      • This - * functionality is not supported for Amazon S3 on Outposts.

      - * + * and Endpoints in the Amazon Web Services General Reference.

    + *

    For example, the following x-amz-grant-read header grants the + * Amazon Web Services accounts identified by account IDs permissions to read + * object data and its metadata:

    x-amz-grant-read: id="11112222333", + * id="444455556666"

    • This functionality is not supported + * for directory buckets.

    • This functionality is not supported for + * Amazon S3 on Outposts.

    */ inline const Aws::String& GetGrantFullControl() const { return m_grantFullControl; } inline bool GrantFullControlHasBeenSet() const { return m_grantFullControlHasBeenSet; } @@ -314,14 +311,13 @@ class CreateMultipartUploadRequest : public S3Request { * America (São Paulo)

    For a list of all the Amazon S3 supported * Regions and endpoints, see Regions - * and Endpoints in the Amazon Web Services General Reference.

    - *

    For example, the following x-amz-grant-read header - * grants the Amazon Web Services accounts identified by account IDs permissions to - * read object data and its metadata:

    x-amz-grant-read: - * id="11112222333", id="444455556666"

    • This - * functionality is not supported for directory buckets.

    • This - * functionality is not supported for Amazon S3 on Outposts.

    - * + * and Endpoints in the Amazon Web Services General Reference.

    + *

    For example, the following x-amz-grant-read header grants the + * Amazon Web Services accounts identified by account IDs permissions to read + * object data and its metadata:

    x-amz-grant-read: id="11112222333", + * id="444455556666"

    • This functionality is not supported + * for directory buckets.

    • This functionality is not supported for + * Amazon S3 on Outposts.

    */ inline const Aws::String& GetGrantRead() const { return m_grantRead; } inline bool GrantReadHasBeenSet() const { return m_grantReadHasBeenSet; } @@ -361,14 +357,13 @@ class CreateMultipartUploadRequest : public S3Request { * America (São Paulo)

    For a list of all the Amazon S3 supported * Regions and endpoints, see Regions - * and Endpoints in the Amazon Web Services General Reference.

    - *

    For example, the following x-amz-grant-read header - * grants the Amazon Web Services accounts identified by account IDs permissions to - * read object data and its metadata:

    x-amz-grant-read: - * id="11112222333", id="444455556666"

    • This - * functionality is not supported for directory buckets.

    • This - * functionality is not supported for Amazon S3 on Outposts.

    - * + * and Endpoints in the Amazon Web Services General Reference.

    + *

    For example, the following x-amz-grant-read header grants the + * Amazon Web Services accounts identified by account IDs permissions to read + * object data and its metadata:

    x-amz-grant-read: id="11112222333", + * id="444455556666"

    • This functionality is not supported + * for directory buckets.

    • This functionality is not supported for + * Amazon S3 on Outposts.

    */ inline const Aws::String& GetGrantReadACP() const { return m_grantReadACP; } inline bool GrantReadACPHasBeenSet() const { return m_grantReadACPHasBeenSet; } @@ -408,14 +403,13 @@ class CreateMultipartUploadRequest : public S3Request { * America (São Paulo)

    For a list of all the Amazon S3 supported * Regions and endpoints, see Regions - * and Endpoints in the Amazon Web Services General Reference.

    - *

    For example, the following x-amz-grant-read header - * grants the Amazon Web Services accounts identified by account IDs permissions to - * read object data and its metadata:

    x-amz-grant-read: - * id="11112222333", id="444455556666"

    • This - * functionality is not supported for directory buckets.

    • This - * functionality is not supported for Amazon S3 on Outposts.

    - * + * and Endpoints in the Amazon Web Services General Reference.

    + *

    For example, the following x-amz-grant-read header grants the + * Amazon Web Services accounts identified by account IDs permissions to read + * object data and its metadata:

    x-amz-grant-read: id="11112222333", + * id="444455556666"

    • This functionality is not supported + * for directory buckets.

    • This functionality is not supported for + * Amazon S3 on Outposts.

    */ inline const Aws::String& GetGrantWriteACP() const { return m_grantWriteACP; } inline bool GrantWriteACPHasBeenSet() const { return m_grantWriteACPHasBeenSet; } @@ -505,25 +499,24 @@ class CreateMultipartUploadRequest : public S3Request { * in the CreateSession request. You don't need to explicitly specify * these encryption settings values in Zonal endpoint API calls, and Amazon S3 will * use the encryption settings values from the CreateSession request - * to protect new objects in the directory bucket.

    When you use the - * CLI or the Amazon Web Services SDKs, for CreateSession, the session - * token refreshes automatically to avoid service interruptions when a session - * expires. The CLI or the Amazon Web Services SDKs use the bucket's default - * encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the - * CreateSession request. So in the Zonal endpoint API calls (except - *

    When you use the CLI or + * the Amazon Web Services SDKs, for CreateSession, the session token + * refreshes automatically to avoid service interruptions when a session expires. + * The CLI or the Amazon Web Services SDKs use the bucket's default encryption + * configuration for the CreateSession request. It's not supported to + * override the encryption settings values in the CreateSession + * request. So in the Zonal endpoint API calls (except CopyObject * and UploadPartCopy), * the encryption request headers must match the default encryption configuration - * of the directory bucket.

  • S3 access points for - * Amazon FSx - When accessing data stored in Amazon FSx file systems using S3 - * access points, the only valid server side encryption option is - * aws:fsx. All Amazon FSx file systems have encryption configured by - * default and are encrypted at rest. Data is automatically encrypted before being - * written to the file system, and automatically decrypted as it is read. These - * processes are handled transparently by Amazon FSx.

  • + * of the directory bucket.

  • S3 access points for Amazon FSx + * - When accessing data stored in Amazon FSx file systems using S3 access + * points, the only valid server side encryption option is aws:fsx. + * All Amazon FSx file systems have encryption configured by default and are + * encrypted at rest. Data is automatically encrypted before being written to the + * file system, and automatically decrypted as it is read. These processes are + * handled transparently by Amazon FSx.

  • */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline bool ServerSideEncryptionHasBeenSet() const { return m_serverSideEncryptionHasBeenSet; } @@ -544,12 +537,11 @@ class CreateMultipartUploadRequest : public S3Request { * availability. Depending on performance needs, you can specify a different * Storage Class. For more information, see Storage - * Classes in the Amazon S3 User Guide.

    • - *

      Directory buckets only support EXPRESS_ONEZONE (the S3 Express - * One Zone storage class) in Availability Zones and ONEZONE_IA (the - * S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.

    • - *
    • Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.

    • - *
    + * Classes in the Amazon S3 User Guide.

    • Directory + * buckets only support EXPRESS_ONEZONE (the S3 Express One Zone + * storage class) in Availability Zones and ONEZONE_IA (the S3 One + * Zone-Infrequent Access storage class) in Dedicated Local Zones.

    • + *

      Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.

    */ inline StorageClass GetStorageClass() const { return m_storageClass; } inline bool StorageClassHasBeenSet() const { return m_storageClassHasBeenSet; } @@ -567,8 +559,8 @@ class CreateMultipartUploadRequest : public S3Request { /** *

    If the bucket is configured as a website, redirects requests for this object * to another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata.

    This functionality is - * not supported for directory buckets.

    + * value of this header in the object metadata.

    This functionality is not + * supported for directory buckets.

    */ inline const Aws::String& GetWebsiteRedirectLocation() const { return m_websiteRedirectLocation; } inline bool WebsiteRedirectLocationHasBeenSet() const { return m_websiteRedirectLocationHasBeenSet; } @@ -587,8 +579,7 @@ class CreateMultipartUploadRequest : public S3Request { ///@{ /** *

    Specifies the algorithm to use when encrypting the object (for example, - * AES256).

    This functionality is not supported for directory - * buckets.

    + * AES256).

    This functionality is not supported for directory buckets.

    */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -631,8 +622,8 @@ class CreateMultipartUploadRequest : public S3Request { /** *

    Specifies the 128-bit MD5 digest of the customer-provided encryption key * according to RFC 1321. Amazon S3 uses this header for a message integrity check - * to ensure that the encryption key was transmitted without error.

    - *

    This functionality is not supported for directory buckets.

    + * to ensure that the encryption key was transmitted without error.

    This + * functionality is not supported for directory buckets.

    */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } @@ -784,8 +775,7 @@ class CreateMultipartUploadRequest : public S3Request { ///@{ /** *

    Specifies the Object Lock mode that you want to apply to the uploaded - * object.

    This functionality is not supported for directory - * buckets.

    + * object.

    This functionality is not supported for directory buckets.

    */ inline ObjectLockMode GetObjectLockMode() const { return m_objectLockMode; } inline bool ObjectLockModeHasBeenSet() const { return m_objectLockModeHasBeenSet; } @@ -802,7 +792,7 @@ class CreateMultipartUploadRequest : public S3Request { ///@{ /** *

    Specifies the date and time when you want the Object Lock to expire.

    - *

    This functionality is not supported for directory buckets.

    + *

    This functionality is not supported for directory buckets.

    */ inline const Aws::Utils::DateTime& GetObjectLockRetainUntilDate() const { return m_objectLockRetainUntilDate; } inline bool ObjectLockRetainUntilDateHasBeenSet() const { return m_objectLockRetainUntilDateHasBeenSet; } @@ -821,7 +811,7 @@ class CreateMultipartUploadRequest : public S3Request { ///@{ /** *

    Specifies whether you want to apply a legal hold to the uploaded object.

    - *

    This functionality is not supported for directory buckets.

    + *

    This functionality is not supported for directory buckets.

    */ inline ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatus() const { return m_objectLockLegalHoldStatus; } inline bool ObjectLockLegalHoldStatusHasBeenSet() const { return m_objectLockLegalHoldStatusHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadResult.h index 8edb8211a9c..77e89487056 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateMultipartUploadResult.h @@ -43,8 +43,8 @@ class CreateMultipartUploadResult { * Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration * in the Amazon S3 User Guide.

    The response also includes the * x-amz-abort-rule-id header that provides the ID of the lifecycle - * configuration rule that defines the abort action.

    This - * functionality is not supported for directory buckets.

    + * configuration rule that defines the abort action.

    This functionality is + * not supported for directory buckets.

    */ inline const Aws::Utils::DateTime& GetAbortDate() const { return m_abortDate; } template @@ -63,8 +63,8 @@ class CreateMultipartUploadResult { /** *

    This header is returned along with the x-amz-abort-date header. * It identifies the applicable lifecycle configuration rule that defines the - * action to abort incomplete multipart uploads.

    This functionality - * is not supported for directory buckets.

    + * action to abort incomplete multipart uploads.

    This functionality is not + * supported for directory buckets.

    */ inline const Aws::String& GetAbortRuleId() const { return m_abortRuleId; } template @@ -82,8 +82,8 @@ class CreateMultipartUploadResult { ///@{ /** *

    The name of the bucket to which the multipart upload was initiated. Does not - * return the access point ARN or access point alias if used.

    Access - * points are not supported by directory buckets.

    + * return the access point ARN or access point alias if used.

    Access points + * are not supported by directory buckets.

    */ inline const Aws::String& GetBucket() const { return m_bucket; } template @@ -135,9 +135,9 @@ class CreateMultipartUploadResult { ///@{ /** *

    The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

    When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

    + * Amazon S3 or Amazon FSx.

    When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

    */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -154,8 +154,8 @@ class CreateMultipartUploadResult { /** *

    If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

    This functionality is not supported for - * directory buckets.

    + * algorithm that's used.

    This functionality is not supported for directory + * buckets.

    */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -175,7 +175,7 @@ class CreateMultipartUploadResult { *

    If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

    - *

    This functionality is not supported for directory buckets.

    + *

    This functionality is not supported for directory buckets.

    */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionRequest.h index ca85b58ca56..5810bc2a2b0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,11 +31,12 @@ class CreateSessionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionResult.h index 81c6d1380c3..743bc673ca0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/CreateSessionResult.h @@ -32,8 +32,8 @@ class CreateSessionResult { ///@{ /** *

    The server-side encryption algorithm used when you store objects in the - * directory bucket.

    When accessing data stored in Amazon FSx file - * systems using S3 access points, the only valid server side encryption option is + * directory bucket.

    When accessing data stored in Amazon FSx file systems + * using S3 access points, the only valid server side encryption option is * aws:fsx.

    */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DefaultRetention.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DefaultRetention.h index b18d4bc39b6..19b93464f79 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DefaultRetention.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DefaultRetention.h @@ -20,12 +20,12 @@ namespace Model { /** *

    The container element for optionally specifying the default Object Lock - * retention settings for new objects placed in the specified bucket.

    - *
    • The DefaultRetention settings require both a mode and - * a period.

    • The DefaultRetention period can be - * either Days or Years but you must select one. You - * cannot specify Days and Years at the same time.

      - *

    See Also:

      + *
    • The DefaultRetention settings require both a mode and a + * period.

    • The DefaultRetention period can be either + * Days or Years but you must select one. You cannot + * specify Days and Years at the same time.

    • + *

    See Also:

    AWS * API Reference

    */ @@ -34,7 +34,6 @@ class DefaultRetention { AWS_S3_API DefaultRetention() = default; AWS_S3_API DefaultRetention(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API DefaultRetention& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Delete.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Delete.h index e06c667a232..175bac2a8a6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Delete.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Delete.h @@ -29,7 +29,6 @@ class Delete { AWS_S3_API Delete() = default; AWS_S3_API Delete(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Delete& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketAnalyticsConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketAnalyticsConfigurationRequest.h index c4a1f42d136..3d5a029cef0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketAnalyticsConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketAnalyticsConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class DeleteBucketAnalyticsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketCorsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketCorsRequest.h index 35567992ac0..e788cd7db3e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketCorsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketCorsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketCorsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketEncryptionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketEncryptionRequest.h index 152150c520b..19f58db1b61 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketEncryptionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketEncryptionRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketEncryptionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -75,10 +73,10 @@ class DeleteBucketEncryptionRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketIntelligentTieringConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketIntelligentTieringConfigurationRequest.h index 9f5aea021a3..09ba84e7347 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketIntelligentTieringConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketIntelligentTieringConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketIntelligentTieringConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketInventoryConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketInventoryConfigurationRequest.h index 66df4169551..66cf5ca47fb 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketInventoryConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketInventoryConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketInventoryConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -93,10 +91,10 @@ class DeleteBucketInventoryConfigurationRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketLifecycleRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketLifecycleRequest.h index 51cd932670b..a07d7cf7da1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketLifecycleRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketLifecycleRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketLifecycleRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -64,9 +62,9 @@ class DeleteBucketLifecycleRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    This parameter applies to general purpose buckets only. It is not supported - * for directory bucket lifecycle configurations.

    + * the HTTP status code 403 Forbidden (access denied).

    This + * parameter applies to general purpose buckets only. It is not supported for + * directory bucket lifecycle configurations.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataConfigurationRequest.h index a64b00c0fa4..23498d4e490 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class DeleteBucketMetadataConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataTableConfigurationRequest.h index 5a8edfb2b65..e871003fe77 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetadataTableConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class DeleteBucketMetadataTableConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetricsConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetricsConfigurationRequest.h index a9398fd88bc..9023b2a5655 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetricsConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketMetricsConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketMetricsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -95,10 +93,10 @@ class DeleteBucketMetricsConfigurationRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketOwnershipControlsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketOwnershipControlsRequest.h index f56fada9f38..91c8b0c2701 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketOwnershipControlsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketOwnershipControlsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketOwnershipControlsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketPolicyRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketPolicyRequest.h index bf046d06e13..c4d7540b2d7 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketPolicyRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketPolicyRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketPolicyRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -75,10 +73,10 @@ class DeleteBucketPolicyRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketReplicationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketReplicationRequest.h index 2123b3aced1..1b910e975ab 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketReplicationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketReplicationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketReplicationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketRequest.h index 043ee7b5369..1c8608d9ace 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -75,10 +73,10 @@ class DeleteBucketRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketTaggingRequest.h index bf8b8701192..f476282546f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketTaggingRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketWebsiteRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketWebsiteRequest.h index ace414563f2..ed2effe6e18 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketWebsiteRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteBucketWebsiteRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteBucketWebsiteRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerEntry.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerEntry.h index aae43dab107..b0d774c8527 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerEntry.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerEntry.h @@ -30,7 +30,6 @@ class DeleteMarkerEntry { AWS_S3_API DeleteMarkerEntry() = default; AWS_S3_API DeleteMarkerEntry(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API DeleteMarkerEntry& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerReplication.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerReplication.h index d0a990a28e9..7ad93d8a2a5 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerReplication.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteMarkerReplication.h @@ -30,8 +30,8 @@ namespace Model { * Rule Configuration.

    For more information about delete marker * replication, see Basic - * Rule Configuration.

    If you are using an earlier version of - * the replication configuration, Amazon S3 handles replication of delete markers + * Rule Configuration.

    If you are using an earlier version of the + * replication configuration, Amazon S3 handles replication of delete markers * differently. For more information, see Backward * Compatibility.

    See Also:

    Indicates whether to replicate delete markers.

    Indicates - * whether to replicate delete markers.

    + *

    Indicates whether to replicate delete markers.

    Indicates whether to + * replicate delete markers.

    */ inline DeleteMarkerReplicationStatus GetStatus() const { return m_status; } inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectAnnotationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectAnnotationRequest.h index bcbae097d8b..6fab0429331 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectAnnotationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectAnnotationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,10 +30,10 @@ class DeleteObjectAnnotationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectRequest.h index b0f9589a7ff..41940c0bb27 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,11 +31,12 @@ class DeleteObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -68,11 +66,11 @@ class DeleteObjectRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see
    Using - * access points in the Amazon S3 User Guide.

    Object - * Lambda access points are not supported by directory buckets.

    - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

    Object Lambda + * access points are not supported by directory buckets.

    S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -136,9 +134,9 @@ class DeleteObjectRequest : public S3Request { ///@{ /** - *

    Version ID used to reference a specific version of the object.

    - *

    For directory buckets in this API operation, only the null value - * of the version ID is supported.

    + *

    Version ID used to reference a specific version of the object.

    For + * directory buckets in this API operation, only the null value of the + * version ID is supported.

    */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } @@ -172,8 +170,8 @@ class DeleteObjectRequest : public S3Request { /** *

    Indicates whether S3 Object Lock should bypass Governance-mode restrictions * to process this operation. To use this header, you must have the - * s3:BypassGovernanceRetention permission.

    This - * functionality is not supported for directory buckets.

    + * s3:BypassGovernanceRetention permission.

    This functionality + * is not supported for directory buckets.

    */ inline bool GetBypassGovernanceRetention() const { return m_bypassGovernanceRetention; } inline bool BypassGovernanceRetentionHasBeenSet() const { return m_bypassGovernanceRetentionHasBeenSet; } @@ -261,8 +259,8 @@ class DeleteObjectRequest : public S3Request { * 412 Precondition Failed error. If the Size matches or * if the object doesn’t exist, the operation returns a 204 Success (No * Content) response.

    This functionality is only supported for - * directory buckets.

    You can use the - * If-Match, x-amz-if-match-last-modified-time and + * directory buckets.

    You can use the If-Match, + * x-amz-if-match-last-modified-time and * x-amz-if-match-size conditional headers in conjunction with * each-other or individually.

    */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectTaggingRequest.h index 55763277cbc..08d431e9a2f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectTaggingRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeleteObjectTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectsRequest.h index 8c3237d141d..becca9dcb83 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeleteObjectsRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class DeleteObjectsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; @@ -73,11 +70,11 @@ class DeleteObjectsRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

    Object - * Lambda access points are not supported by directory buckets.

    - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

    Object Lambda + * access points are not supported by directory buckets.

    S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -130,8 +127,8 @@ class DeleteObjectsRequest : public S3Request { * are versioned object keys in the request or not, the entire Multi-Object Delete * request will fail. For information about MFA Delete, see - * MFA Delete in the Amazon S3 User Guide.

    This - * functionality is not supported for directory buckets.

    + * MFA Delete in the Amazon S3 User Guide.

    This functionality is + * not supported for directory buckets.

    */ inline const Aws::String& GetMFA() const { return m_mFA; } inline bool MFAHasBeenSet() const { return m_mFAHasBeenSet; } @@ -165,8 +162,8 @@ class DeleteObjectsRequest : public S3Request { /** *

    Specifies whether you want to delete this object even if it has a * Governance-type Object Lock in place. To use this header, you must have the - * s3:BypassGovernanceRetention permission.

    This - * functionality is not supported for directory buckets.

    + * s3:BypassGovernanceRetention permission.

    This functionality + * is not supported for directory buckets.

    */ inline bool GetBypassGovernanceRetention() const { return m_bypassGovernanceRetention; } inline bool BypassGovernanceRetentionHasBeenSet() const { return m_bypassGovernanceRetentionHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletePublicAccessBlockRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletePublicAccessBlockRequest.h index 34b000c7d70..507f5327d28 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletePublicAccessBlockRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletePublicAccessBlockRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class DeletePublicAccessBlockRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletedObject.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletedObject.h index 2c7bb122459..1b26a92ee29 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletedObject.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DeletedObject.h @@ -28,7 +28,6 @@ class DeletedObject { AWS_S3_API DeletedObject() = default; AWS_S3_API DeletedObject(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API DeletedObject& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Destination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Destination.h index fffd49a8ce2..7324fa38f8a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Destination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Destination.h @@ -35,7 +35,6 @@ class Destination { AWS_S3_API Destination() = default; AWS_S3_API Destination(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Destination& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DestinationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DestinationResult.h index ba08e8fc3ed..bbb7d0c70d1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DestinationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/DestinationResult.h @@ -30,7 +30,6 @@ class DestinationResult { AWS_S3_API DestinationResult() = default; AWS_S3_API DestinationResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API DestinationResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Encryption.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Encryption.h index e4f0a34a0d6..18ae753d691 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Encryption.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Encryption.h @@ -29,7 +29,6 @@ class Encryption { AWS_S3_API Encryption() = default; AWS_S3_API Encryption(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Encryption& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EncryptionConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EncryptionConfiguration.h index 6195ae5e330..2db22561673 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EncryptionConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EncryptionConfiguration.h @@ -20,12 +20,11 @@ namespace Model { /** *

    Specifies encryption-related information for an Amazon S3 bucket that is a - * destination for replicated objects.

    If you're specifying a - * customer managed KMS key, we recommend using a fully qualified KMS key ARN. If - * you use a KMS key alias instead, then KMS resolves the key within the - * requester’s account. This behavior can result in data that's encrypted with a - * KMS key that belongs to the requester, and not the bucket owner.

    - *

    See Also:

    If you're specifying a customer + * managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a + * KMS key alias instead, then KMS resolves the key within the requester’s account. + * This behavior can result in data that's encrypted with a KMS key that belongs to + * the requester, and not the bucket owner.

    See Also:

    AWS * API Reference

    */ @@ -34,7 +33,6 @@ class EncryptionConfiguration { AWS_S3_API EncryptionConfiguration() = default; AWS_S3_API EncryptionConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API EncryptionConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Error.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Error.h index d914b0ed802..ad806ac5e08 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Error.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Error.h @@ -19,11 +19,11 @@ namespace S3 { namespace Model { /** - *

    For information about using the Amazon S3 API—including error - * handling—see the For information about using the Amazon S3 API—including error handling—see + * the Amazon - * S3 Developer Guide.

    Container for all error - * elements.

    See Also:

    .

    Container for all error elements.

    See + * Also:

    AWS API * Reference

    */ @@ -32,7 +32,6 @@ class Error { AWS_S3_API Error() = default; AWS_S3_API Error(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Error& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -55,8 +54,8 @@ class Error { ///@{ /** - *

    The version ID of the error.

    This functionality is not - * supported for directory buckets.

    + *

    The version ID of the error.

    This functionality is not supported for + * directory buckets.

    */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } @@ -436,7 +435,7 @@ class Error { * must contain the specified field name. If it is specified, check the order of * the fields.

  • HTTP Status Code: 400 Bad Request

    *
  • SOAP Fault Code Prefix: Client

  • - *

    + *

    */ inline const Aws::String& GetCode() const { return m_code; } inline bool CodeHasBeenSet() const { return m_codeHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ErrorDetails.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ErrorDetails.h index ad9c8091f30..4924278977a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ErrorDetails.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ErrorDetails.h @@ -22,9 +22,9 @@ namespace Model { *

    If an S3 Metadata V1 CreateBucketMetadataTableConfiguration or * V2 CreateBucketMetadataConfiguration request succeeds, but S3 * Metadata was unable to create the table, this structure contains the error code - * and error message.

    If you created your S3 Metadata configuration - * before July 15, 2025, we recommend that you delete and re-create your - * configuration by using

    If you created your S3 Metadata configuration before + * July 15, 2025, we recommend that you delete and re-create your configuration by + * using CreateBucketMetadataConfiguration * so that you can expire journal table records and create a live inventory * table.

    See Also:

    The object key name to use when a 4XX class error occurs.

    - *

    Replacement must be made for object keys containing special characters (such - * as carriage returns) when using XML requests. For more information, see The object key name to use when a 4XX class error occurs.

    Replacement + * must be made for object keys containing special characters (such as carriage + * returns) when using XML requests. For more information, see * XML related object key constraints.

    */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EventBridgeConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EventBridgeConfiguration.h index b4e2441f253..b0be5a64468 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EventBridgeConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/EventBridgeConfiguration.h @@ -26,7 +26,6 @@ class EventBridgeConfiguration { AWS_S3_API EventBridgeConfiguration() = default; AWS_S3_API EventBridgeConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API EventBridgeConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ExistingObjectReplication.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ExistingObjectReplication.h index deb6c102f6e..f13e304b2f1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ExistingObjectReplication.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ExistingObjectReplication.h @@ -20,8 +20,7 @@ namespace Model { /** *

    Optional configuration to replicate existing source bucket objects.

    - *

    This parameter is no longer supported. To replicate existing objects, - * see This parameter is no longer supported. To replicate existing objects, see Replicating * existing objects with S3 Batch Replication in the Amazon S3 User * Guide.

    See Also:

    namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class GetBucketAbacRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAccelerateConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAccelerateConfigurationRequest.h index c960be4d1de..7a3d1147e02 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAccelerateConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAccelerateConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class GetBucketAccelerateConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAclRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAclRequest.h index 3254c90760b..c679c127303 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAclRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAclRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketAclRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAnalyticsConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAnalyticsConfigurationRequest.h index f0429cd03be..6265358c11d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAnalyticsConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketAnalyticsConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketAnalyticsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketCorsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketCorsRequest.h index 9b403efd917..87198e512c3 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketCorsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketCorsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketCorsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketEncryptionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketEncryptionRequest.h index d38df9bae30..17a4680c021 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketEncryptionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketEncryptionRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketEncryptionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -75,10 +73,10 @@ class GetBucketEncryptionRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketIntelligentTieringConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketIntelligentTieringConfigurationRequest.h index ef2dba5f1de..bb5653ce080 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketIntelligentTieringConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketIntelligentTieringConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketIntelligentTieringConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketInventoryConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketInventoryConfigurationRequest.h index 56f4e374f07..cfab9772ec6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketInventoryConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketInventoryConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketInventoryConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -93,10 +91,10 @@ class GetBucketInventoryConfigurationRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

    + * the HTTP status code 403 Forbidden (access denied).

    For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationRequest.h index 23da0a9f4b1..e12db81fe69 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketLifecycleConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -64,9 +62,9 @@ class GetBucketLifecycleConfigurationRequest : public S3Request { /** *

    The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

    - *

    This parameter applies to general purpose buckets only. It is not supported - * for directory bucket lifecycle configurations.

    + * the HTTP status code 403 Forbidden (access denied).

    This + * parameter applies to general purpose buckets only. It is not supported for + * directory bucket lifecycle configurations.

    */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationResult.h index 079ecc84b59..abb53d089f4 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLifecycleConfigurationResult.h @@ -58,8 +58,8 @@ class GetBucketLifecycleConfigurationResult { *

    Indicates which default minimum object size behavior is applied to the * lifecycle configuration.

    This parameter applies to general purpose * buckets only. It isn't supported for directory bucket lifecycle - * configurations.

    • all_storage_classes_128K - * - Objects smaller than 128 KB will not transition to any storage class by + * configurations.

      • all_storage_classes_128K - + * Objects smaller than 128 KB will not transition to any storage class by * default.

      • varies_by_storage_class - Objects * smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier * Deep Archive storage classes. By default, all other storage classes will prevent diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLocationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLocationRequest.h index 216871a9264..2f9dd725883 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLocationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLocationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketLocationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLoggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLoggingRequest.h index 7f6e5346fc6..ecb87d40cf4 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLoggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketLoggingRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketLoggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationRequest.h index b47e22d9127..542754b796c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class GetBucketMetadataConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationResult.h index 8e270704e57..17434058a05 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataConfigurationResult.h @@ -29,7 +29,6 @@ class GetBucketMetadataConfigurationResult { AWS_S3_API GetBucketMetadataConfigurationResult() = default; AWS_S3_API GetBucketMetadataConfigurationResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API GetBucketMetadataConfigurationResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationRequest.h index fe1a7100cbc..aea14c63580 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,10 +29,10 @@ class GetBucketMetadataTableConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationResult.h index b4cb3005a45..0940066f4df 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketMetadataTableConfigurationResult.h @@ -21,9 +21,9 @@ namespace S3 { namespace Model { /** - *

        The V1 S3 Metadata configuration for a general purpose bucket.

        - *

        If you created your S3 Metadata configuration before July 15, 2025, we - * recommend that you delete and re-create your configuration by using The V1 S3 Metadata configuration for a general purpose bucket.

        If + * you created your S3 Metadata configuration before July 15, 2025, we recommend + * that you delete and re-create your configuration by using CreateBucketMetadataConfiguration * so that you can expire journal table records and create a live inventory * table.

        See Also:

        namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketMetricsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -95,10 +93,10 @@ class GetBucketMetricsConfigurationRequest : public S3Request { /** *

        The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

        - *

        For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

        + * the HTTP status code 403 Forbidden (access denied).

        For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

        */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketNotificationConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketNotificationConfigurationRequest.h index 740c8ce9f5a..eb29653c44b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketNotificationConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketNotificationConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketNotificationConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketOwnershipControlsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketOwnershipControlsRequest.h index c3d39af5d00..97ef35df507 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketOwnershipControlsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketOwnershipControlsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketOwnershipControlsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyRequest.h index 0e4e1c6f512..af4e4ef47b7 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketPolicyRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -64,8 +62,8 @@ class GetBucketPolicyRequest : public S3Request { * the error code InvalidAccessPointAliasError is returned. For more * information about InvalidAccessPointAliasError, see
        List - * of Error Codes.

        Object Lambda access points are not supported - * by directory buckets.

        + * of Error Codes.

        Object Lambda access points are not supported by + * directory buckets.

        */ inline const Aws::String& GetBucket() const { return m_bucket; } inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; } @@ -85,10 +83,10 @@ class GetBucketPolicyRequest : public S3Request { /** *

        The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

        - *

        For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

        + * the HTTP status code 403 Forbidden (access denied).

        For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

        */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyResult.h index cb502ce0e5a..82ba4584717 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyResult.h @@ -36,7 +36,6 @@ class GetBucketPolicyResult { */ inline Aws::IOStream& GetPolicy() const { return m_policy.GetUnderlyingStream(); } inline void ReplaceBody(Aws::IOStream* body) { m_policy = Aws::Utils::Stream::ResponseStream(body); } - ///@} ///@{ @@ -56,7 +55,7 @@ class GetBucketPolicyResult { inline Aws::Http::HttpResponseCode GetHttpResponseCode() const { return m_HttpResponseCode; } private: - Aws::Utils::Stream::ResponseStream m_policy; + Aws::Utils::Stream::ResponseStream m_policy{}; Aws::String m_requestId; Aws::Http::HttpResponseCode m_HttpResponseCode; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyStatusRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyStatusRequest.h index eb3c8dab1b0..8d56e46b10e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyStatusRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketPolicyStatusRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketPolicyStatusRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketReplicationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketReplicationRequest.h index 78c0f1d2dcf..d75c45cf4cf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketReplicationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketReplicationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketReplicationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketRequestPaymentRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketRequestPaymentRequest.h index 52b9b2e5159..bc1ad3070d2 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketRequestPaymentRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketRequestPaymentRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketRequestPaymentRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketTaggingRequest.h index 336a26e9bf2..79cbc23b4b8 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketTaggingRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketVersioningRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketVersioningRequest.h index 896a7d66719..a19ff95dc66 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketVersioningRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketVersioningRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketVersioningRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketWebsiteRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketWebsiteRequest.h index ba2614c050a..b3af75e48d4 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketWebsiteRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetBucketWebsiteRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetBucketWebsiteRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAclRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAclRequest.h index 75cdae67af5..093c4f209ad 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAclRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAclRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class GetObjectAclRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -94,8 +92,8 @@ class GetObjectAclRequest : public S3Request { ///@{ /** - *

        Version ID used to reference a specific version of the object.

        - *

        This functionality is not supported for directory buckets.

        + *

        Version ID used to reference a specific version of the object.

        This + * functionality is not supported for directory buckets.

        */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationRequest.h index a77b84b46cc..59f20169706 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,12 +31,10 @@ class GetObjectAnnotationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API bool ShouldValidateResponseChecksum() const override; - AWS_S3_API Aws::Vector GetResponseChecksumAlgorithmNames() const override; /** diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationResult.h index fe11cff8454..54fc0061184 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAnnotationResult.h @@ -42,9 +42,7 @@ class GetObjectAnnotationResult { */ inline Aws::IOStream& GetAnnotationPayload() const { return m_annotationPayload.GetUnderlyingStream(); } inline void ReplaceBody(Aws::IOStream* body) { m_annotationPayload = Aws::Utils::Stream::ResponseStream(body); } - ///@} - ///@{ /** *

        The version ID of the object that the annotation is attached to.

        @@ -359,7 +357,6 @@ class GetObjectAnnotationResult { private: Aws::Utils::Stream::ResponseStream m_annotationPayload{}; - Aws::String m_objectVersionId; Aws::Utils::DateTime m_lastModified{}; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesParts.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesParts.h index 5f1dc7311ac..b97d1d2107a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesParts.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesParts.h @@ -30,7 +30,6 @@ class GetObjectAttributesParts { AWS_S3_API GetObjectAttributesParts() = default; AWS_S3_API GetObjectAttributesParts(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API GetObjectAttributesParts& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -121,9 +120,9 @@ class GetObjectAttributesParts { ///@{ /** *

        A container for elements related to a particular part. A response can contain - * zero or more Parts elements.

        • General - * purpose buckets - For GetObjectAttributes, if an additional - * checksum (including x-amz-checksum-crc32, + * zero or more Parts elements.

          • General purpose + * buckets - For GetObjectAttributes, if an additional checksum + * (including x-amz-checksum-crc32, * x-amz-checksum-crc32c, x-amz-checksum-sha1, or * x-amz-checksum-sha256) isn't applied to the object specified in the * request, the response doesn't return the Part element.

          • diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesRequest.h index a5fcaa753b3..5c7aefca818 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,11 +32,12 @@ class GetObjectAttributesRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -69,11 +67,11 @@ class GetObjectAttributesRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

            Object - * Lambda access points are not supported by directory buckets.

            - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

            Object Lambda + * access points are not supported by directory buckets.

            S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -115,8 +113,8 @@ class GetObjectAttributesRequest : public S3Request { ///@{ /** - *

            The version ID used to reference a specific version of the object.

            - *

            S3 Versioning isn't enabled and supported for directory buckets. For this API + *

            The version ID used to reference a specific version of the object.

            S3 + * Versioning isn't enabled and supported for directory buckets. For this API * operation, only the null value of the version ID is supported by * directory buckets. You can only specify null to the * versionId query parameter in the request.

            @@ -177,8 +175,7 @@ class GetObjectAttributesRequest : public S3Request { ///@{ /** *

            Specifies the algorithm to use when encrypting the object (for example, - * AES256).

            This functionality is not supported for directory - * buckets.

            + * AES256).

            This functionality is not supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -221,8 +218,8 @@ class GetObjectAttributesRequest : public S3Request { /** *

            Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

            This functionality - * is not supported for directory buckets.

            + * encryption key was transmitted without error.

            This functionality is not + * supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesResult.h index 84e9dd4965a..cddc11bc14f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectAttributesResult.h @@ -72,8 +72,8 @@ class GetObjectAttributesResult { ///@{ /** - *

            The version ID of the object.

            This functionality is not - * supported for directory buckets.

            + *

            The version ID of the object.

            This functionality is not supported for + * directory buckets.

            */ inline const Aws::String& GetVersionId() const { return m_versionId; } template @@ -159,8 +159,8 @@ class GetObjectAttributesResult { * header for all objects except for S3 Standard storage class objects.

            For * more information, see Storage - * Classes.

            Directory buckets - Directory buckets only - * support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in + * Classes.

            Directory buckets - Directory buckets only support + * EXPRESS_ONEZONE (the S3 Express One Zone storage class) in * Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent * Access storage class) in Dedicated Local Zones.

            */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLegalHoldRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLegalHoldRequest.h index 16a071d8bad..18f40b17b22 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLegalHoldRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLegalHoldRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class GetObjectLegalHoldRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLockConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLockConfigurationRequest.h index e76295586d5..db124701296 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLockConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectLockConfigurationRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetObjectLockConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRequest.h index 20563125fdb..7afc469bd6e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,12 +32,10 @@ class GetObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API bool ShouldValidateResponseChecksum() const override; - AWS_S3_API Aws::Vector GetResponseChecksumAlgorithmNames() const override; /** @@ -77,10 +72,10 @@ class GetObjectRequest : public S3Request { * you must direct requests to the Object Lambda access point hostname. The Object * Lambda access point hostname takes the form * AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com.

            - *

            Object Lambda access points are not supported by directory - * buckets.

            S3 on Outposts - When you use this action with - * S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 - * on Outposts hostname takes the form + *

            Object Lambda access points are not supported by directory buckets.

            + * S3 on Outposts - When you use this action with S3 on Outposts, you must + * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + * takes the form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -357,19 +352,19 @@ class GetObjectRequest : public S3Request { *

            Version ID used to reference a specific version of the object.

            By * default, the GetObject operation returns the current version of an * object. To return a different version, use the versionId - * subresource.

            • If you include a versionId in - * your request header, you must have the s3:GetObjectVersion - * permission to access a specific version of an object. The - * s3:GetObject permission is not required in this scenario.

            • - *
            • If you request the current version of an object without a specific - * versionId in the request header, only the s3:GetObject - * permission is required. The s3:GetObjectVersion permission is not - * required in this scenario.

            • Directory buckets - S3 - * Versioning isn't enabled and supported for directory buckets. For this API - * operation, only the null value of the version ID is supported by - * directory buckets. You can only specify null to the - * versionId query parameter in the request.

            - *

            For more information about versioning, see

            For more information about versioning, see + * PutBucketVersioning.

            */ inline const Aws::String& GetVersionId() const { return m_versionId; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectResult.h index 974581311e7..37f2a87e5d3 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectResult.h @@ -46,19 +46,17 @@ class GetObjectResult { */ inline Aws::IOStream& GetBody() const { return m_body.GetUnderlyingStream(); } inline void ReplaceBody(Aws::IOStream* body) { m_body = Aws::Utils::Stream::ResponseStream(body); } - ///@} - ///@{ /** *

            Indicates whether the object retrieved was (true) or was not (false) a Delete * Marker. If false, this response header does not appear in the response.

            - *
            • If the current version of the object is a delete marker, - * Amazon S3 behaves as if the object was deleted and includes - * x-amz-delete-marker: true in the response.

            • If the - * specified version in the request is a delete marker, the response returns a - * 405 Method Not Allowed error and the Last-Modified: - * timestamp response header.

            + *
            • If the current version of the object is a delete marker, Amazon S3 + * behaves as if the object was deleted and includes x-amz-delete-marker: + * true in the response.

            • If the specified version in the + * request is a delete marker, the response returns a 405 Method Not + * Allowed error and the Last-Modified: timestamp response + * header.

            */ inline bool GetDeleteMarker() const { return m_deleteMarker; } inline void SetDeleteMarker(bool value) { @@ -95,10 +93,9 @@ class GetObjectResult { * PutBucketLifecycleConfiguration ), the response includes this * header. It includes the expiry-date and rule-id * key-value pairs providing object expiration information. The value of the - * rule-id is URL-encoded.

            Object expiration information - * is not returned in directory buckets and this header returns the value + * rule-id is URL-encoded.

            Object expiration information is + * not returned in directory buckets and this header returns the value * "NotImplemented" in all responses for directory buckets.

            - * */ inline const Aws::String& GetExpiration() const { return m_expiration; } template @@ -420,8 +417,8 @@ class GetObjectResult { * that are prefixed with x-amz-meta-. This can happen if you create * metadata using an API like SOAP that supports more flexible metadata than the * REST API. For example, using SOAP, you can create metadata whose values are not - * legal HTTP headers.

            This functionality is not supported for - * directory buckets.

            + * legal HTTP headers.

            This functionality is not supported for directory + * buckets.

            */ inline int GetMissingMeta() const { return m_missingMeta; } inline void SetMissingMeta(int value) { @@ -436,8 +433,8 @@ class GetObjectResult { ///@{ /** - *

            Version ID of the object.

            This functionality is not supported - * for directory buckets.

            + *

            Version ID of the object.

            This functionality is not supported for + * directory buckets.

            */ inline const Aws::String& GetVersionId() const { return m_versionId; } template @@ -558,8 +555,8 @@ class GetObjectResult { ///@{ /** - * Deprecated: Please use ExpiresString instead. - *

            The date and time at which the object is no longer cacheable.

            + * Deprecated: Please use ExpiresString instead. *

            The date and time at which + * the object is no longer cacheable.

            */ inline const Aws::Utils::DateTime& GetExpires() const { return m_expires; } template @@ -578,8 +575,8 @@ class GetObjectResult { /** *

            If the bucket is configured as a website, redirects requests for this object * to another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata.

            This functionality is - * not supported for directory buckets.

            + * value of this header in the object metadata.

            This functionality is not + * supported for directory buckets.

            */ inline const Aws::String& GetWebsiteRedirectLocation() const { return m_websiteRedirectLocation; } template @@ -597,9 +594,9 @@ class GetObjectResult { ///@{ /** *

            The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

            When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

            + * Amazon S3 or Amazon FSx.

            When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

            */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -639,8 +636,8 @@ class GetObjectResult { /** *

            If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

            This functionality is not supported for - * directory buckets.

            + * algorithm that's used.

            This functionality is not supported for directory + * buckets.

            */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -660,7 +657,7 @@ class GetObjectResult { *

            If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

            - *

            This functionality is not supported for directory buckets.

            + *

            This functionality is not supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template @@ -712,8 +709,8 @@ class GetObjectResult { ///@{ /** *

            Provides storage class information of the object. Amazon S3 returns this - * header for all objects except for S3 Standard storage class objects.

            - *

            Directory buckets - Directory buckets only support + * header for all objects except for S3 Standard storage class objects.

            + * Directory buckets - Directory buckets only support * EXPRESS_ONEZONE (the S3 Express One Zone storage class) in * Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent * Access storage class) in Dedicated Local Zones.

            @@ -745,8 +742,8 @@ class GetObjectResult { ///@{ /** *

            Amazon S3 can return this if your request involves a bucket that is either a - * source or destination in a replication rule.

            This functionality is - * not supported for directory buckets.

            + * source or destination in a replication rule.

            This functionality is not + * supported for directory buckets.

            */ inline ReplicationStatus GetReplicationStatus() const { return m_replicationStatus; } inline void SetReplicationStatus(ReplicationStatus value) { @@ -781,8 +778,8 @@ class GetObjectResult { *

            The number of tags, if any, on the object, when you have the relevant * permission to read object tags.

            You can use GetObjectTagging - * to retrieve the tag set associated with an object.

            This - * functionality is not supported for directory buckets.

            + * to retrieve the tag set associated with an object.

            This functionality is + * not supported for directory buckets.

            */ inline int GetTagCount() const { return m_tagCount; } inline void SetTagCount(int value) { @@ -797,8 +794,8 @@ class GetObjectResult { ///@{ /** - *

            The Object Lock mode that's currently in place for this object.

            - *

            This functionality is not supported for directory buckets.

            + *

            The Object Lock mode that's currently in place for this object.

            This + * functionality is not supported for directory buckets.

            */ inline ObjectLockMode GetObjectLockMode() const { return m_objectLockMode; } inline void SetObjectLockMode(ObjectLockMode value) { @@ -813,8 +810,8 @@ class GetObjectResult { ///@{ /** - *

            The date and time when this object's Object Lock will expire.

            - *

            This functionality is not supported for directory buckets.

            + *

            The date and time when this object's Object Lock will expire.

            This + * functionality is not supported for directory buckets.

            */ inline const Aws::Utils::DateTime& GetObjectLockRetainUntilDate() const { return m_objectLockRetainUntilDate; } template @@ -833,7 +830,7 @@ class GetObjectResult { /** *

            Indicates whether this object has an active legal hold. This field is only * returned if you have permission to view an object's legal hold status.

            - *

            This functionality is not supported for directory buckets.

            + *

            This functionality is not supported for directory buckets.

            */ inline ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatus() const { return m_objectLockLegalHoldStatus; } inline void SetObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus value) { @@ -848,6 +845,21 @@ class GetObjectResult { ///@{ + inline const Aws::String& GetExpiresString() const { return m_expiresString; } + template + void SetExpiresString(ExpiresStringT&& value) { + m_expiresStringHasBeenSet = true; + m_expiresString = std::forward(value); + } + template + GetObjectResult& WithExpiresString(ExpiresStringT&& value) { + SetExpiresString(std::forward(value)); + return *this; + } + ///@} + + ///@{ + inline const Aws::String& GetId2() const { return m_id2; } template void SetId2(Id2T&& value) { @@ -875,28 +887,10 @@ class GetObjectResult { return *this; } ///@} - - ///@{ - /** - *

            The date and time at which the object is no longer cacheable.

            - */ - inline const Aws::String& GetExpiresString() const { return m_expiresString; } - template - void SetExpiresString(ExpiresStringT&& value) { - m_expiresStringHasBeenSet = true; - m_expiresString = std::forward(value); - } - template - GetObjectResult& WithExpiresString(ExpiresStringT&& value) { - SetExpiresString(std::forward(value)); - return *this; - } - ///@} inline Aws::Http::HttpResponseCode GetHttpResponseCode() const { return m_HttpResponseCode; } private: Aws::Utils::Stream::ResponseStream m_body{}; - bool m_deleteMarker{false}; Aws::String m_acceptRanges; @@ -981,11 +975,11 @@ class GetObjectResult { ObjectLockLegalHoldStatus m_objectLockLegalHoldStatus{ObjectLockLegalHoldStatus::NOT_SET}; + Aws::String m_expiresString; + Aws::String m_id2; Aws::String m_requestId; - - Aws::String m_expiresString; Aws::Http::HttpResponseCode m_HttpResponseCode; bool m_bodyHasBeenSet = false; bool m_deleteMarkerHasBeenSet = false; @@ -1030,9 +1024,9 @@ class GetObjectResult { bool m_objectLockModeHasBeenSet = false; bool m_objectLockRetainUntilDateHasBeenSet = false; bool m_objectLockLegalHoldStatusHasBeenSet = false; + bool m_expiresStringHasBeenSet = false; bool m_id2HasBeenSet = false; bool m_requestIdHasBeenSet = false; - bool m_expiresStringHasBeenSet = false; }; } // namespace Model diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRetentionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRetentionRequest.h index a21ffd57fd2..9fd938cd373 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRetentionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectRetentionRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class GetObjectRetentionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTaggingRequest.h index 2cf6a88192e..f85232f7ba0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTaggingRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class GetObjectTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentRequest.h index 30fef4fff39..09780a941ac 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,10 +30,10 @@ class GetObjectTorrentRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentResult.h index 02851f59524..058d403e64e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetObjectTorrentResult.h @@ -38,9 +38,7 @@ class GetObjectTorrentResult { */ inline Aws::IOStream& GetBody() const { return m_body.GetUnderlyingStream(); } inline void ReplaceBody(Aws::IOStream* body) { m_body = Aws::Utils::Stream::ResponseStream(body); } - ///@} - ///@{ inline RequestCharged GetRequestCharged() const { return m_requestCharged; } @@ -72,7 +70,6 @@ class GetObjectTorrentResult { private: Aws::Utils::Stream::ResponseStream m_body{}; - RequestCharged m_requestCharged{RequestCharged::NOT_SET}; Aws::String m_requestId; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetPublicAccessBlockRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetPublicAccessBlockRequest.h index b9dcdd62f4c..3b1057f64fb 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetPublicAccessBlockRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GetPublicAccessBlockRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class GetPublicAccessBlockRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GlacierJobParameters.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GlacierJobParameters.h index 0323bb389d5..a61ee9f630e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GlacierJobParameters.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/GlacierJobParameters.h @@ -28,7 +28,6 @@ class GlacierJobParameters { AWS_S3_API GlacierJobParameters() = default; AWS_S3_API GlacierJobParameters(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API GlacierJobParameters& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grant.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grant.h index 9a6945daf60..dd2c0b8fe25 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grant.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grant.h @@ -29,7 +29,6 @@ class Grant { AWS_S3_API Grant() = default; AWS_S3_API Grant(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Grant& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grantee.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grantee.h index 9d0e14e7c61..272f15f5009 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grantee.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Grantee.h @@ -21,7 +21,7 @@ namespace Model { /** *

            Container for the person being granted permissions.

            See Also:

            - * AWS API + * AWS API * Reference

            */ class Grantee { @@ -29,12 +29,11 @@ class Grantee { AWS_S3_API Grantee() = default; AWS_S3_API Grantee(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Grantee& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** - *

            + *

            */ inline const Aws::String& GetDisplayName() const { return m_displayName; } inline bool DisplayNameHasBeenSet() const { return m_displayNameHasBeenSet; } @@ -52,7 +51,7 @@ class Grantee { ///@{ /** - *

            + *

            */ inline const Aws::String& GetEmailAddress() const { return m_emailAddress; } inline bool EmailAddressHasBeenSet() const { return m_emailAddressHasBeenSet; } @@ -86,22 +85,6 @@ class Grantee { } ///@} - ///@{ - /** - *

            Type of grantee

            - */ - inline Type GetType() const { return m_type; } - inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } - inline void SetType(Type value) { - m_typeHasBeenSet = true; - m_type = value; - } - inline Grantee& WithType(Type value) { - SetType(value); - return *this; - } - ///@} - ///@{ /** *

            URI of the grantee group.

            @@ -119,6 +102,22 @@ class Grantee { return *this; } ///@} + + ///@{ + /** + *

            Type of grantee

            + */ + inline Type GetType() const { return m_type; } + inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } + inline void SetType(Type value) { + m_typeHasBeenSet = true; + m_type = value; + } + inline Grantee& WithType(Type value) { + SetType(value); + return *this; + } + ///@} private: Aws::String m_displayName; @@ -126,14 +125,14 @@ class Grantee { Aws::String m_iD; - Type m_type{Type::NOT_SET}; - Aws::String m_uRI; + + Type m_type{Type::NOT_SET}; bool m_displayNameHasBeenSet = false; bool m_emailAddressHasBeenSet = false; bool m_iDHasBeenSet = false; - bool m_typeHasBeenSet = false; bool m_uRIHasBeenSet = false; + bool m_typeHasBeenSet = false; }; } // namespace Model diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketRequest.h index 0e9a0a364a8..263955edbe1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class HeadBucketRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -73,10 +71,10 @@ class HeadBucketRequest : public S3Request { * the error code InvalidAccessPointAliasError is returned. For more * information about InvalidAccessPointAliasError, see List - * of Error Codes.

            Object Lambda access points are not supported - * by directory buckets.

            S3 on Outposts - When you use this - * action with S3 on Outposts, you must direct requests to the S3 on Outposts - * hostname. The S3 on Outposts hostname takes the form + * of Error Codes.

            Object Lambda access points are not supported by + * directory buckets.

            S3 on Outposts - When you use this action + * with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. + * The S3 on Outposts hostname takes the form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h index 76d511da374..34ee6808e72 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h @@ -31,9 +31,9 @@ class HeadBucketResult { ///@{ /** *

            The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify - * Amazon Web Services resources across all of Amazon Web Services.

            - *

            This parameter is only supported for S3 directory buckets. For more - * information, see

            This + * parameter is only supported for S3 directory buckets. For more information, see + * Using * tags with directory buckets.

            */ @@ -52,8 +52,8 @@ class HeadBucketResult { ///@{ /** - *

            The type of location where the bucket is created.

            This - * functionality is only supported by directory buckets.

            + *

            The type of location where the bucket is created.

            This functionality + * is only supported by directory buckets.

            */ inline LocationType GetBucketLocationType() const { return m_bucketLocationType; } inline void SetBucketLocationType(LocationType value) { @@ -71,8 +71,8 @@ class HeadBucketResult { *

            The name of the location where the bucket will be created.

            For * directory buckets, the Zone ID of the Availability Zone or the Local Zone where * the bucket is created. An example Zone ID value for an Availability Zone is - * usw2-az1.

            This functionality is only supported by - * directory buckets.

            + * usw2-az1.

            This functionality is only supported by directory + * buckets.

            */ inline const Aws::String& GetBucketLocationName() const { return m_bucketLocationName; } template diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectRequest.h index e773e00ab44..a57da9de82a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,11 +32,12 @@ class HeadObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -69,11 +67,11 @@ class HeadObjectRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

            Object - * Lambda access points are not supported by directory buckets.

            - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

            Object Lambda + * access points are not supported by directory buckets.

            S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -348,9 +346,9 @@ class HeadObjectRequest : public S3Request { ///@{ /** - *

            Version ID used to reference a specific version of the object.

            - *

            For directory buckets in this API operation, only the null value - * of the version ID is supported.

            + *

            Version ID used to reference a specific version of the object.

            For + * directory buckets in this API operation, only the null value of the + * version ID is supported.

            */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } @@ -369,8 +367,7 @@ class HeadObjectRequest : public S3Request { ///@{ /** *

            Specifies the algorithm to use when encrypting the object (for example, - * AES256).

            This functionality is not supported for directory - * buckets.

            + * AES256).

            This functionality is not supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -413,8 +410,8 @@ class HeadObjectRequest : public S3Request { /** *

            Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

            This functionality - * is not supported for directory buckets.

            + * encryption key was transmitted without error.

            This functionality is not + * supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectResult.h index 1117e1045c1..179a37c8749 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/HeadObjectResult.h @@ -41,7 +41,7 @@ class HeadObjectResult { /** *

            Specifies whether the object retrieved was (true) or was not (false) a Delete * Marker. If false, this response header does not appear in the response.

            - *

            This functionality is not supported for directory buckets.

            + *

            This functionality is not supported for directory buckets.

            */ inline bool GetDeleteMarker() const { return m_deleteMarker; } inline void SetDeleteMarker(bool value) { @@ -78,10 +78,9 @@ class HeadObjectResult { * PutBucketLifecycleConfiguration ), the response includes this * header. It includes the expiry-date and rule-id * key-value pairs providing object expiration information. The value of the - * rule-id is URL-encoded.

            Object expiration information - * is not returned in directory buckets and this header returns the value + * rule-id is URL-encoded.

            Object expiration information is + * not returned in directory buckets and this header returns the value * "NotImplemented" in all responses for directory buckets.

            - * */ inline const Aws::String& GetExpiration() const { return m_expiration; } template @@ -110,8 +109,8 @@ class HeadObjectResult { * ongoing-request="true".

            For more information about archiving * objects, see Transitioning - * Objects: General Considerations.

            This functionality is not - * supported for directory buckets. Directory buckets only support + * Objects: General Considerations.

            This functionality is not supported + * for directory buckets. Directory buckets only support * EXPRESS_ONEZONE (the S3 Express One Zone storage class) in * Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent * Access storage class) in Dedicated Local Zones.

            @@ -438,8 +437,7 @@ class HeadObjectResult { * x-amz-meta headers. This can happen if you create metadata using an * API like SOAP that supports more flexible metadata than the REST API. For * example, using SOAP, you can create metadata whose values are not legal HTTP - * headers.

            This functionality is not supported for directory - * buckets.

            + * headers.

            This functionality is not supported for directory buckets.

            */ inline int GetMissingMeta() const { return m_missingMeta; } inline void SetMissingMeta(int value) { @@ -454,8 +452,8 @@ class HeadObjectResult { ///@{ /** - *

            Version ID of the object.

            This functionality is not supported - * for directory buckets.

            + *

            Version ID of the object.

            This functionality is not supported for + * directory buckets.

            */ inline const Aws::String& GetVersionId() const { return m_versionId; } template @@ -577,7 +575,8 @@ class HeadObjectResult { ///@{ /** - *

            The date and time at which the object is no longer cacheable.

            + * Deprecated: Please use ExpiresString instead. *

            The date and time at which + * the object is no longer cacheable.

            */ inline const Aws::Utils::DateTime& GetExpires() const { return m_expires; } template @@ -596,8 +595,8 @@ class HeadObjectResult { /** *

            If the bucket is configured as a website, redirects requests for this object * to another object in the same bucket or to an external URL. Amazon S3 stores the - * value of this header in the object metadata.

            This functionality is - * not supported for directory buckets.

            + * value of this header in the object metadata.

            This functionality is not + * supported for directory buckets.

            */ inline const Aws::String& GetWebsiteRedirectLocation() const { return m_websiteRedirectLocation; } template @@ -615,9 +614,9 @@ class HeadObjectResult { ///@{ /** *

            The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

            When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

            + * Amazon S3 or Amazon FSx.

            When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

            */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -657,8 +656,8 @@ class HeadObjectResult { /** *

            If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

            This functionality is not supported for - * directory buckets.

            + * algorithm that's used.

            This functionality is not supported for directory + * buckets.

            */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -678,7 +677,7 @@ class HeadObjectResult { *

            If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

            - *

            This functionality is not supported for directory buckets.

            + *

            This functionality is not supported for directory buckets.

            */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template @@ -733,8 +732,8 @@ class HeadObjectResult { * header for all objects except for S3 Standard storage class objects.

            For * more information, see Storage - * Classes.

            Directory buckets - Directory buckets only - * support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in + * Classes.

            Directory buckets - Directory buckets only support + * EXPRESS_ONEZONE (the S3 Express One Zone storage class) in * Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent * Access storage class) in Dedicated Local Zones.

            */ @@ -828,8 +827,8 @@ class HeadObjectResult { *

            The number of tags, if any, on the object, when you have the relevant * permission to read object tags.

            You can use GetObjectTagging - * to retrieve the tag set associated with an object.

            This - * functionality is not supported for directory buckets.

            + * to retrieve the tag set associated with an object.

            This functionality is + * not supported for directory buckets.

            */ inline int GetTagCount() const { return m_tagCount; } inline void SetTagCount(int value) { @@ -890,8 +889,7 @@ class HeadObjectResult { * has never had a legal hold applied. For more information about S3 Object Lock, * see Object - * Lock.

            This functionality is not supported for directory - * buckets.

            + * Lock.

            This functionality is not supported for directory buckets.

            */ inline ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatus() const { return m_objectLockLegalHoldStatus; } inline void SetObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus value) { @@ -905,9 +903,7 @@ class HeadObjectResult { ///@} ///@{ - /** - *

            The date and time at which the object is no longer cacheable.

            - */ + inline const Aws::String& GetExpiresString() const { return m_expiresString; } template void SetExpiresString(ExpiresStringT&& value) { diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IndexDocument.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IndexDocument.h index 4e134677668..acf9e9acf08 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IndexDocument.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IndexDocument.h @@ -28,7 +28,6 @@ class IndexDocument { AWS_S3_API IndexDocument() = default; AWS_S3_API IndexDocument(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API IndexDocument& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -37,9 +36,9 @@ class IndexDocument { * endpoint. (For example, if the suffix is index.html and you make a * request to samplebucket/images/, the data that is returned will be * for the object with the key name images/index.html.) The suffix - * must not be empty and must not include a slash character.

            - *

            Replacement must be made for object keys containing special characters (such - * as carriage returns) when using XML requests. For more information, see

            Replacement + * must be made for object keys containing special characters (such as carriage + * returns) when using XML requests. For more information, see * XML related object key constraints.

            */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Initiator.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Initiator.h index b4d04d7a138..2bf663c5e31 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Initiator.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Initiator.h @@ -29,16 +29,15 @@ class Initiator { AWS_S3_API Initiator() = default; AWS_S3_API Initiator(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Initiator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

            If the principal is an Amazon Web Services account, it provides the Canonical - * User ID. If the principal is an IAM User, it provides a user ARN value.

            - *

            Directory buckets - If the principal is an Amazon Web Services - * account, it provides the Amazon Web Services account ID. If the principal is an - * IAM User, it provides a user ARN value.

            + * User ID. If the principal is an IAM User, it provides a user ARN value.

            + * Directory buckets - If the principal is an Amazon Web Services account, + * it provides the Amazon Web Services account ID. If the principal is an IAM User, + * it provides a user ARN value.

            */ inline const Aws::String& GetID() const { return m_iD; } inline bool IDHasBeenSet() const { return m_iDHasBeenSet; } @@ -56,8 +55,7 @@ class Initiator { ///@{ /** - *

            This functionality is not supported for directory buckets.

            - * + *

            This functionality is not supported for directory buckets.

            */ inline const Aws::String& GetDisplayName() const { return m_displayName; } inline bool DisplayNameHasBeenSet() const { return m_displayNameHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InputSerialization.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InputSerialization.h index d10f965d0a4..49918ae49d7 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InputSerialization.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InputSerialization.h @@ -32,7 +32,6 @@ class InputSerialization { AWS_S3_API InputSerialization() = default; AWS_S3_API InputSerialization(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InputSerialization& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringAndOperator.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringAndOperator.h index 8c8d34e3a28..fb514e1cd29 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringAndOperator.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringAndOperator.h @@ -32,7 +32,6 @@ class IntelligentTieringAndOperator { AWS_S3_API IntelligentTieringAndOperator() = default; AWS_S3_API IntelligentTieringAndOperator(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API IntelligentTieringAndOperator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringConfiguration.h index 3a37b670090..2e8b0a3f7b9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringConfiguration.h @@ -37,7 +37,6 @@ class IntelligentTieringConfiguration { AWS_S3_API IntelligentTieringConfiguration() = default; AWS_S3_API IntelligentTieringConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API IntelligentTieringConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringFilter.h index 32611b2b512..5de5a6c7f65 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/IntelligentTieringFilter.h @@ -31,15 +31,14 @@ class IntelligentTieringFilter { AWS_S3_API IntelligentTieringFilter() = default; AWS_S3_API IntelligentTieringFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API IntelligentTieringFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

            An object key name prefix that identifies the subset of objects to which the - * rule applies.

            Replacement must be made for object keys - * containing special characters (such as carriage returns) when using XML - * requests. For more information, see

            Replacement must be made for object keys containing + * special characters (such as carriage returns) when using XML requests. For more + * information, see * XML related object key constraints.

            */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InvalidObjectState.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InvalidObjectState.h index fd00eb0e0d7..df921eecfb2 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InvalidObjectState.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InvalidObjectState.h @@ -39,7 +39,6 @@ class InvalidObjectState { AWS_S3_API InvalidObjectState() = default; AWS_S3_API InvalidObjectState(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InvalidObjectState& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryConfiguration.h index cc04c3f42c1..394ae8c8949 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryConfiguration.h @@ -38,7 +38,6 @@ class InventoryConfiguration { AWS_S3_API InventoryConfiguration() = default; AWS_S3_API InventoryConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -137,8 +136,8 @@ class InventoryConfiguration { ///@{ /** *

            Contains the optional fields that are included in the inventory results.

            - *

            The following optional fields are supported for directory buckets - * Size | LastModifiedDate | StorageClass | ETag | IsMultipartUploaded | + *

            The following optional fields are supported for directory buckets Size + * | LastModifiedDate | StorageClass | ETag | IsMultipartUploaded | * EncryptionStatus | BucketKeyStatus | ChecksumAlgorithm | * LifecycleExpirationDate. Throws MalformedXML error if unsupported * optional field is provided.

            diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryDestination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryDestination.h index 5e48e77dee9..4840071774b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryDestination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryDestination.h @@ -29,7 +29,6 @@ class InventoryDestination { AWS_S3_API InventoryDestination() = default; AWS_S3_API InventoryDestination(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryDestination& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryEncryption.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryEncryption.h index f98f42d4820..99e861652f1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryEncryption.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryEncryption.h @@ -30,7 +30,6 @@ class InventoryEncryption { AWS_S3_API InventoryEncryption() = default; AWS_S3_API InventoryEncryption(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryEncryption& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryFilter.h index 0609fea4887..6954eb3df89 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryFilter.h @@ -29,7 +29,6 @@ class InventoryFilter { AWS_S3_API InventoryFilter() = default; AWS_S3_API InventoryFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryS3BucketDestination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryS3BucketDestination.h index 0b74e031f6b..09953692a9f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryS3BucketDestination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryS3BucketDestination.h @@ -32,15 +32,14 @@ class InventoryS3BucketDestination { AWS_S3_API InventoryS3BucketDestination() = default; AWS_S3_API InventoryS3BucketDestination(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryS3BucketDestination& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

            The account ID that owns the destination S3 bucket. If no account ID is - * provided, the owner is not validated before exporting data.

            - * Although this value is optional, we strongly recommend that you set it to help - * prevent problems if the destination bucket ownership changes.

            + * provided, the owner is not validated before exporting data.

            Although + * this value is optional, we strongly recommend that you set it to help prevent + * problems if the destination bucket ownership changes.

            */ inline const Aws::String& GetAccountId() const { return m_accountId; } inline bool AccountIdHasBeenSet() const { return m_accountIdHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventorySchedule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventorySchedule.h index 254a099b8d9..057a64a1265 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventorySchedule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventorySchedule.h @@ -29,7 +29,6 @@ class InventorySchedule { AWS_S3_API InventorySchedule() = default; AWS_S3_API InventorySchedule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventorySchedule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfiguration.h index 2a88333d550..83265ebd044 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfiguration.h @@ -30,7 +30,6 @@ class InventoryTableConfiguration { AWS_S3_API InventoryTableConfiguration() = default; AWS_S3_API InventoryTableConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryTableConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationResult.h index 7592cca6cc9..3906a0ae846 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationResult.h @@ -31,7 +31,6 @@ class InventoryTableConfigurationResult { AWS_S3_API InventoryTableConfigurationResult() = default; AWS_S3_API InventoryTableConfigurationResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryTableConfigurationResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationUpdates.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationUpdates.h index 2b03705bf63..fc6035d3807 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationUpdates.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/InventoryTableConfigurationUpdates.h @@ -30,7 +30,6 @@ class InventoryTableConfigurationUpdates { AWS_S3_API InventoryTableConfigurationUpdates() = default; AWS_S3_API InventoryTableConfigurationUpdates(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API InventoryTableConfigurationUpdates& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONInput.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONInput.h index 1de88251394..f71edd8753a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONInput.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONInput.h @@ -29,7 +29,6 @@ class JSONInput { AWS_S3_API JSONInput() = default; AWS_S3_API JSONInput(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API JSONInput& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONOutput.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONOutput.h index 029f1c74911..1f65f72c482 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONOutput.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JSONOutput.h @@ -29,7 +29,6 @@ class JSONOutput { AWS_S3_API JSONOutput() = default; AWS_S3_API JSONOutput(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API JSONOutput& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfiguration.h index e935f694f68..cf5b50c29dc 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfiguration.h @@ -30,7 +30,6 @@ class JournalTableConfiguration { AWS_S3_API JournalTableConfiguration() = default; AWS_S3_API JournalTableConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API JournalTableConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationResult.h index 4cc79631b78..f1cb6bbebef 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationResult.h @@ -31,7 +31,6 @@ class JournalTableConfigurationResult { AWS_S3_API JournalTableConfigurationResult() = default; AWS_S3_API JournalTableConfigurationResult(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API JournalTableConfigurationResult& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationUpdates.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationUpdates.h index d05c8b4d6db..8650e303c72 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationUpdates.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/JournalTableConfigurationUpdates.h @@ -29,7 +29,6 @@ class JournalTableConfigurationUpdates { AWS_S3_API JournalTableConfigurationUpdates() = default; AWS_S3_API JournalTableConfigurationUpdates(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API JournalTableConfigurationUpdates& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LambdaFunctionConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LambdaFunctionConfiguration.h index ec0f65a588e..9c7bb9e5539 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LambdaFunctionConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LambdaFunctionConfiguration.h @@ -32,7 +32,6 @@ class LambdaFunctionConfiguration { AWS_S3_API LambdaFunctionConfiguration() = default; AWS_S3_API LambdaFunctionConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API LambdaFunctionConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleConfiguration.h deleted file mode 100644 index a5202b7b7fd..00000000000 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleConfiguration.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once -#include -#include -#include - -#include - -namespace Aws { -namespace Utils { -namespace Xml { -class XmlNode; -} // namespace Xml -} // namespace Utils -namespace S3 { -namespace Model { - -/** - *

            Container for lifecycle rules. You can add as many as 1000 rules.

            For - * more information see, Managing - * your storage lifecycle in the Amazon S3 User Guide.

            See - * Also:

            AWS - * API Reference

            - */ -class LifecycleConfiguration { - public: - AWS_S3_API LifecycleConfiguration() = default; - AWS_S3_API LifecycleConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API LifecycleConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; - - ///@{ - /** - *

            Specifies lifecycle configuration rules for an Amazon S3 bucket.

            - */ - inline const Aws::Vector& GetRules() const { return m_rules; } - inline bool RulesHasBeenSet() const { return m_rulesHasBeenSet; } - template > - void SetRules(RulesT&& value) { - m_rulesHasBeenSet = true; - m_rules = std::forward(value); - } - template > - LifecycleConfiguration& WithRules(RulesT&& value) { - SetRules(std::forward(value)); - return *this; - } - template - LifecycleConfiguration& AddRules(RulesT&& value) { - m_rulesHasBeenSet = true; - m_rules.emplace_back(std::forward(value)); - return *this; - } - ///@} - private: - Aws::Vector m_rules; - bool m_rulesHasBeenSet = false; -}; - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleExpiration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleExpiration.h index 7d9997edf39..75cb2ffa3f2 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleExpiration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleExpiration.h @@ -32,7 +32,6 @@ class LifecycleExpiration { AWS_S3_API LifecycleExpiration() = default; AWS_S3_API LifecycleExpiration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API LifecycleExpiration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -78,8 +77,8 @@ class LifecycleExpiration { *

            Indicates whether Amazon S3 will remove a delete marker with no noncurrent * versions. If set to true, the delete marker will be expired; if set to false the * policy takes no action. This cannot be specified with Days or Date in a - * Lifecycle Expiration Policy.

            This parameter applies to general - * purpose buckets only. It is not supported for directory bucket lifecycle + * Lifecycle Expiration Policy.

            This parameter applies to general purpose + * buckets only. It is not supported for directory bucket lifecycle * configurations.

            */ inline bool GetExpiredObjectDeleteMarker() const { return m_expiredObjectDeleteMarker; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRule.h index 7904b0f5a16..f6f30b26b8a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRule.h @@ -40,7 +40,6 @@ class LifecycleRule { AWS_S3_API LifecycleRule() = default; AWS_S3_API LifecycleRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API LifecycleRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -91,9 +90,8 @@ class LifecycleRule { * contain a Prefix element.

            For more information about * Tag filters, see Adding - * filters to Lifecycle rules in the Amazon S3 User Guide.

            - *

            Tag filters are not supported for directory buckets.

            - * + * filters to Lifecycle rules in the Amazon S3 User Guide.

            + * Tag filters are not supported for directory buckets.

            */ inline const LifecycleRuleFilter& GetFilter() const { return m_filter; } inline bool FilterHasBeenSet() const { return m_filterHasBeenSet; } @@ -129,8 +127,8 @@ class LifecycleRule { ///@{ /** *

            Specifies when an Amazon S3 object transitions to a specified storage - * class.

            This parameter applies to general purpose buckets only. It - * is not supported for directory bucket lifecycle configurations.

            + * class.

            This parameter applies to general purpose buckets only. It is not + * supported for directory bucket lifecycle configurations.

            */ inline const Aws::Vector& GetTransitions() const { return m_transitions; } inline bool TransitionsHasBeenSet() const { return m_transitionsHasBeenSet; } @@ -158,9 +156,9 @@ class LifecycleRule { * noncurrent objects transition to a specific storage class. If your bucket is * versioning-enabled (or versioning is suspended), you can set this action to * request that Amazon S3 transition noncurrent object versions to a specific - * storage class at a set period in the object's lifetime.

            This - * parameter applies to general purpose buckets only. It is not supported for - * directory bucket lifecycle configurations.

            + * storage class at a set period in the object's lifetime.

            This parameter + * applies to general purpose buckets only. It is not supported for directory + * bucket lifecycle configurations.

            */ inline const Aws::Vector& GetNoncurrentVersionTransitions() const { return m_noncurrentVersionTransitions; } inline bool NoncurrentVersionTransitionsHasBeenSet() const { return m_noncurrentVersionTransitionsHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleAndOperator.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleAndOperator.h index 73f92e12ff9..2106214dff9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleAndOperator.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleAndOperator.h @@ -32,7 +32,6 @@ class LifecycleRuleAndOperator { AWS_S3_API LifecycleRuleAndOperator() = default; AWS_S3_API LifecycleRuleAndOperator(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API LifecycleRuleAndOperator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h index 04e5e722612..eeb95250fd8 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h @@ -35,15 +35,13 @@ class LifecycleRuleFilter { AWS_S3_API LifecycleRuleFilter() = default; AWS_S3_API LifecycleRuleFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API LifecycleRuleFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

            Prefix identifying one or more objects to which the rule applies.

            - *

            Replacement must be made for object keys containing special - * characters (such as carriage returns) when using XML requests. For more - * information, see Replacement must be made for object keys containing special characters (such + * as carriage returns) when using XML requests. For more information, see * XML related object key constraints.

            */ @@ -64,8 +62,8 @@ class LifecycleRuleFilter { ///@{ /** *

            This tag must exist in the object's tag set in order for the rule to - * apply.

            This parameter applies to general purpose buckets only. It - * is not supported for directory bucket lifecycle configurations.

            + * apply.

            This parameter applies to general purpose buckets only. It is not + * supported for directory bucket lifecycle configurations.

            */ inline const Tag& GetTag() const { return m_tag; } inline bool TagHasBeenSet() const { return m_tagHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketAnalyticsConfigurationsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketAnalyticsConfigurationsRequest.h index 1d65100862b..93d25769c5f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketAnalyticsConfigurationsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketAnalyticsConfigurationsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class ListBucketAnalyticsConfigurationsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketIntelligentTieringConfigurationsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketIntelligentTieringConfigurationsRequest.h index 5282bc5554c..df0d1e186f9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketIntelligentTieringConfigurationsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketIntelligentTieringConfigurationsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class ListBucketIntelligentTieringConfigurationsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketInventoryConfigurationsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketInventoryConfigurationsRequest.h index b221590a49a..1faf6f6975d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketInventoryConfigurationsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketInventoryConfigurationsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class ListBucketInventoryConfigurationsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -96,10 +94,10 @@ class ListBucketInventoryConfigurationsRequest : public S3Request { /** *

            The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

            - *

            For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

            + * the HTTP status code 403 Forbidden (access denied).

            For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

            */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketMetricsConfigurationsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketMetricsConfigurationsRequest.h index dd377467857..ffb3de44f09 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketMetricsConfigurationsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketMetricsConfigurationsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -32,11 +29,12 @@ class ListBucketMetricsConfigurationsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -96,10 +94,10 @@ class ListBucketMetricsConfigurationsRequest : public S3Request { /** *

            The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

            - *

            For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

            + * the HTTP status code 403 Forbidden (access denied).

            For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

            */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketsRequest.h index 05ac2664db2..a40743add86 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListBucketsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListDirectoryBucketsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListDirectoryBucketsRequest.h index b8cf1e17930..fdda7c020ab 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListDirectoryBucketsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListDirectoryBucketsRequest.h @@ -12,9 +12,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,6 +32,7 @@ class ListDirectoryBucketsRequest : public S3Request { AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsRequest.h index a02c2e5cf04..0ba248dba1e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,11 +31,12 @@ class ListMultipartUploadsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -68,11 +66,11 @@ class ListMultipartUploadsRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

            Object - * Lambda access points are not supported by directory buckets.

            - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

            Object Lambda + * access points are not supported by directory buckets.

            S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -103,9 +101,9 @@ class ListMultipartUploadsRequest : public S3Request { * substring starts at the beginning of the key. The keys that are grouped under * CommonPrefixes result element are not returned elsewhere in the * response.

            CommonPrefixes is filtered out from results if it - * is not lexicographically greater than the key-marker.

            - * Directory buckets - For directory buckets, / is the only - * supported delimiter.

            + * is not lexicographically greater than the key-marker.

            Directory + * buckets - For directory buckets, / is the only supported + * delimiter.

            */ inline const Aws::String& GetDelimiter() const { return m_delimiter; } inline bool DelimiterHasBeenSet() const { return m_delimiterHasBeenSet; } @@ -137,8 +135,8 @@ class ListMultipartUploadsRequest : public S3Request { ///@{ /** - *

            Specifies the multipart upload after which listing should begin.

            - *
            • General purpose buckets - For general purpose buckets, + *

              Specifies the multipart upload after which listing should begin.

                + *
              • General purpose buckets - For general purpose buckets, * key-marker is an object key. Together with * upload-id-marker, this parameter specifies the multipart upload * after which listing should begin.

                If upload-id-marker is not @@ -193,9 +191,9 @@ class ListMultipartUploadsRequest : public S3Request { *

                Lists in-progress uploads only for those keys that begin with the specified * prefix. You can use prefixes to separate a bucket into different grouping of * keys. (You can think of using prefix to make groups in the same way - * that you'd use a folder in a file system.)

                Directory - * buckets - For directory buckets, only prefixes that end in a delimiter - * (/) are supported.

                + * that you'd use a folder in a file system.)

                Directory buckets - + * For directory buckets, only prefixes that end in a delimiter (/) + * are supported.

                */ inline const Aws::String& GetPrefix() const { return m_prefix; } inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsResult.h index f34a3c8211a..14c985cf2bc 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListMultipartUploadsResult.h @@ -111,8 +111,8 @@ class ListMultipartUploadsResult { /** *

                When a prefix is provided in the request, this field contains the specified * prefix. The result contains only keys starting with the specified prefix.

                - *

                Directory buckets - For directory buckets, only prefixes that - * end in a delimiter (/) are supported.

                + *

                Directory buckets - For directory buckets, only prefixes that end in + * a delimiter (/) are supported.

                */ inline const Aws::String& GetPrefix() const { return m_prefix; } template @@ -130,8 +130,8 @@ class ListMultipartUploadsResult { ///@{ /** *

                Contains the delimiter you specified in the request. If you don't specify a - * delimiter in your request, this element is absent from the response.

                - *

                Directory buckets - For directory buckets, / is the only + * delimiter in your request, this element is absent from the response.

                + * Directory buckets - For directory buckets, / is the only * supported delimiter.

                */ inline const Aws::String& GetDelimiter() const { return m_delimiter; } @@ -151,8 +151,7 @@ class ListMultipartUploadsResult { /** *

                When a list is truncated, this element specifies the value that should be * used for the upload-id-marker request parameter in a subsequent - * request.

                This functionality is not supported for directory - * buckets.

                + * request.

                This functionality is not supported for directory buckets.

                */ inline const Aws::String& GetNextUploadIdMarker() const { return m_nextUploadIdMarker; } template diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectAnnotationsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectAnnotationsRequest.h index cc05dcbeb3a..9cce3ec439d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectAnnotationsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectAnnotationsRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,10 +30,10 @@ class ListObjectAnnotationsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectVersionsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectVersionsRequest.h index de2de2de426..27d8a5abe7c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectVersionsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectVersionsRequest.h @@ -16,9 +16,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -36,11 +33,12 @@ class ListObjectVersionsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -126,9 +124,8 @@ class ListObjectVersionsRequest : public S3Request { * action returns up to 1,000 key names. The response might contain fewer keys but * will never contain more. If additional keys satisfy the search criteria, but * were not returned because max-keys was exceeded, the response - * contains <isTruncated>true</isTruncated>. To return the - * additional keys, see key-marker and - * version-id-marker.

                + * contains true. To return the additional + * keys, see key-marker and version-id-marker.

                */ inline int GetMaxKeys() const { return m_maxKeys; } inline bool MaxKeysHasBeenSet() const { return m_maxKeysHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsRequest.h index 1e89a38d5ed..f70463e6da6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsRequest.h @@ -16,9 +16,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -36,11 +33,12 @@ class ListObjectsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -70,11 +68,11 @@ class ListObjectsRequest : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

                Object - * Lambda access points are not supported by directory buckets.

                - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

                Object Lambda + * access points are not supported by directory buckets.

                S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsResult.h index d4c0fdde84e..d80946c435c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsResult.h @@ -71,13 +71,12 @@ class ListObjectsResult { *

                When the response is truncated (the IsTruncated element value in * the response is true), you can use the key name in this field as * the marker parameter in the subsequent request to get the next set - * of objects. Amazon S3 lists objects in alphabetical order.

                This - * element is returned only if you have the delimiter request - * parameter specified. If the response does not include the - * NextMarker element and it is truncated, you can use the value of - * the last Key element in the response as the marker - * parameter in the subsequent request to get the next set of object keys.

                - * + * of objects. Amazon S3 lists objects in alphabetical order.

                This element + * is returned only if you have the delimiter request parameter + * specified. If the response does not include the NextMarker element + * and it is truncated, you can use the value of the last Key element + * in the response as the marker parameter in the subsequent request + * to get the next set of object keys.

                */ inline const Aws::String& GetNextMarker() const { return m_nextMarker; } template @@ -229,9 +228,9 @@ class ListObjectsResult { * Amazon S3 encode the keys in the response. For more information about characters * to avoid in object key names, see Object - * key naming guidelines.

                When using the URL encoding type, - * non-ASCII characters that are used in an object's key name will be - * percent-encoded according to UTF-8 code values. For example, the object + * key naming guidelines.

                When using the URL encoding type, non-ASCII + * characters that are used in an object's key name will be percent-encoded + * according to UTF-8 code values. For example, the object * test_file(3).png will appear as * test_file%283%29.png.

                */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Request.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Request.h index 294240cf5ba..8b813e84bee 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Request.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Request.h @@ -16,9 +16,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -36,11 +33,12 @@ class ListObjectsV2Request : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -69,11 +67,11 @@ class ListObjectsV2Request : public S3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

                Object - * Lambda access points are not supported by directory buckets.

                - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

                Object Lambda + * access points are not supported by directory buckets.

                S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -99,13 +97,13 @@ class ListObjectsV2Request : public S3Request { /** *

                A delimiter is a character that you use to group keys.

                * CommonPrefixes is filtered out from results if it is not - * lexicographically greater than the StartAfter value.

                - *
                • Directory buckets - For directory buckets, / - * is the only supported delimiter.

                • Directory buckets - - * When you query ListObjectsV2 with a delimiter during in-progress - * multipart uploads, the CommonPrefixes response parameter contains - * the prefixes that are associated with the in-progress multipart uploads. For - * more information about multipart uploads, see StartAfter value.

                  */ @@ -134,9 +132,9 @@ class ListObjectsV2Request : public S3Request { * Amazon S3 encode the keys in the response. For more information about characters * to avoid in object key names, see Object - * key naming guidelines.

                  When using the URL encoding type, - * non-ASCII characters that are used in an object's key name will be - * percent-encoded according to UTF-8 code values. For example, the object + * key naming guidelines.

                  When using the URL encoding type, non-ASCII + * characters that are used in an object's key name will be percent-encoded + * according to UTF-8 code values. For example, the object * test_file(3).png will appear as * test_file%283%29.png.

                  */ @@ -172,9 +170,9 @@ class ListObjectsV2Request : public S3Request { ///@{ /** - *

                  Limits the response to keys that begin with the specified prefix.

                  - *

                  Directory buckets - For directory buckets, only prefixes that end in - * a delimiter (/) are supported.

                  + *

                  Limits the response to keys that begin with the specified prefix.

                  + * Directory buckets - For directory buckets, only prefixes that end in a + * delimiter (/) are supported.

                  */ inline const Aws::String& GetPrefix() const { return m_prefix; } inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } @@ -235,8 +233,7 @@ class ListObjectsV2Request : public S3Request { /** *

                  StartAfter is where you want Amazon S3 to start listing from. Amazon S3 * starts listing after this specified key. StartAfter can be any key in the - * bucket.

                  This functionality is not supported for directory - * buckets.

                  + * bucket.

                  This functionality is not supported for directory buckets.

                  */ inline const Aws::String& GetStartAfter() const { return m_startAfter; } inline bool StartAfterHasBeenSet() const { return m_startAfterHasBeenSet; } @@ -294,8 +291,8 @@ class ListObjectsV2Request : public S3Request { ///@{ /** *

                  Specifies the optional fields that you want returned in the response. Fields - * that you do not specify are not returned.

                  This functionality is - * not supported for directory buckets.

                  + * that you do not specify are not returned.

                  This functionality is not + * supported for directory buckets.

                  */ inline const Aws::Vector& GetOptionalObjectAttributes() const { return m_optionalObjectAttributes; } inline bool OptionalObjectAttributesHasBeenSet() const { return m_optionalObjectAttributesHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Result.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Result.h index be70373e6bb..fa1bc75d8af 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Result.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ListObjectsV2Result.h @@ -92,9 +92,9 @@ class ListObjectsV2Result { ///@{ /** - *

                  Keys that begin with the indicated prefix.

                  Directory - * buckets - For directory buckets, only prefixes that end in a delimiter - * (/) are supported.

                  + *

                  Keys that begin with the indicated prefix.

                  Directory buckets + * - For directory buckets, only prefixes that end in a delimiter (/) + * are supported.

                  */ inline const Aws::String& GetPrefix() const { return m_prefix; } template @@ -115,9 +115,8 @@ class ListObjectsV2Result { * the first occurrence of the delimiter to be rolled up into a single result * element in the CommonPrefixes collection. These rolled-up keys are * not returned elsewhere in the response. Each rolled-up result counts as only one - * return against the MaxKeys value.

                  Directory - * buckets - For directory buckets, / is the only supported - * delimiter.

                  + * return against the MaxKeys value.

                  Directory buckets + * - For directory buckets, / is the only supported delimiter.

                  */ inline const Aws::String& GetDelimiter() const { return m_delimiter; } template @@ -162,14 +161,13 @@ class ListObjectsV2Result { * example, if the prefix is notes/ and the delimiter is a slash * (/) as in notes/summer/july, the common prefix is * notes/summer/. All of the keys that roll up into a common prefix - * count as a single return when calculating the number of returns.

                  - *

                  Directory buckets - MD5 is not - * supported by directory buckets.

                  + * MD5 digest.

                Directory buckets - MD5 is not supported + * by directory buckets.

                */ inline const Aws::String& GetETag() const { return m_eTag; } inline bool ETagHasBeenSet() const { return m_eTagHasBeenSet; } @@ -189,8 +188,8 @@ class Object { ///@{ /** - *

                The owner of the object

                Directory buckets - The bucket - * owner is returned as the object owner.

                + *

                The owner of the object

                Directory buckets - The bucket owner + * is returned as the object owner.

                */ inline const Owner& GetOwner() const { return m_owner; } inline bool OwnerHasBeenSet() const { return m_ownerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectEncryption.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectEncryption.h index e584219a5f2..3fb57b73bae 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectEncryption.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectEncryption.h @@ -31,7 +31,6 @@ class ObjectEncryption { AWS_S3_API ObjectEncryption() = default; AWS_S3_API ObjectEncryption(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectEncryption& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectIdentifier.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectIdentifier.h index 3a9d35e7d6d..e8b0945b9bf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectIdentifier.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectIdentifier.h @@ -30,14 +30,13 @@ class ObjectIdentifier { AWS_S3_API ObjectIdentifier() = default; AWS_S3_API ObjectIdentifier(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectIdentifier& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** - *

                Key name of the object.

                Replacement must be made for - * object keys containing special characters (such as carriage returns) when using - * XML requests. For more information, see Key name of the object.

                Replacement must be made for object keys + * containing special characters (such as carriage returns) when using XML + * requests. For more information, see * XML related object key constraints.

                */ @@ -57,8 +56,8 @@ class ObjectIdentifier { ///@{ /** - *

                Version ID for the specific version of the object to delete.

                - *

                This functionality is not supported for directory buckets.

                + *

                Version ID for the specific version of the object to delete.

                This + * functionality is not supported for directory buckets.

                */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } @@ -78,9 +77,8 @@ class ObjectIdentifier { /** *

                An entity tag (ETag) is an identifier assigned by a web server to a specific * version of a resource found at a URL. This header field makes the request method - * conditional on ETags.

                Entity tags (ETags) for S3 - * Express One Zone are random alphanumeric strings unique to the object.

                - * + * conditional on ETags.

                Entity tags (ETags) for S3 Express + * One Zone are random alphanumeric strings unique to the object.

                */ inline const Aws::String& GetETag() const { return m_eTag; } inline bool ETagHasBeenSet() const { return m_eTagHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockConfiguration.h index 2c501c2c898..0bb606bec46 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockConfiguration.h @@ -30,7 +30,6 @@ class ObjectLockConfiguration { AWS_S3_API ObjectLockConfiguration() = default; AWS_S3_API ObjectLockConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectLockConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockLegalHold.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockLegalHold.h index 7c20856bf2d..81cb4d85136 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockLegalHold.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockLegalHold.h @@ -28,7 +28,6 @@ class ObjectLockLegalHold { AWS_S3_API ObjectLockLegalHold() = default; AWS_S3_API ObjectLockLegalHold(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectLockLegalHold& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRetention.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRetention.h index 3f588ac08ae..7922c41e825 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRetention.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRetention.h @@ -29,7 +29,6 @@ class ObjectLockRetention { AWS_S3_API ObjectLockRetention() = default; AWS_S3_API ObjectLockRetention(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectLockRetention& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRule.h index 26f291b9cdc..da9bbc1916b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectLockRule.h @@ -28,7 +28,6 @@ class ObjectLockRule { AWS_S3_API ObjectLockRule() = default; AWS_S3_API ObjectLockRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectLockRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectPart.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectPart.h index a2df5987677..90523fb5f9f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectPart.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectPart.h @@ -29,7 +29,6 @@ class ObjectPart { AWS_S3_API ObjectPart() = default; AWS_S3_API ObjectPart(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectPart& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectVersion.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectVersion.h index 49cdfea4008..d763d2c8fbb 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectVersion.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ObjectVersion.h @@ -35,7 +35,6 @@ class ObjectVersion { AWS_S3_API ObjectVersion() = default; AWS_S3_API ObjectVersion(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ObjectVersion& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputLocation.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputLocation.h index c2ccb8e9b9e..2d05ce1f317 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputLocation.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputLocation.h @@ -29,7 +29,6 @@ class OutputLocation { AWS_S3_API OutputLocation() = default; AWS_S3_API OutputLocation(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API OutputLocation& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputSerialization.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputSerialization.h index 8e02af115c3..d0de0d320f0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputSerialization.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OutputSerialization.h @@ -30,7 +30,6 @@ class OutputSerialization { AWS_S3_API OutputSerialization() = default; AWS_S3_API OutputSerialization(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API OutputSerialization& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Owner.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Owner.h index 1304b12d699..cacaf4d805b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Owner.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Owner.h @@ -28,12 +28,11 @@ class Owner { AWS_S3_API Owner() = default; AWS_S3_API Owner(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Owner& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** - *

                + *

                */ inline const Aws::String& GetDisplayName() const { return m_displayName; } inline bool DisplayNameHasBeenSet() const { return m_displayNameHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControls.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControls.h index 8c6ddc4a36f..a614d8ac707 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControls.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControls.h @@ -30,7 +30,6 @@ class OwnershipControls { AWS_S3_API OwnershipControls() = default; AWS_S3_API OwnershipControls(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API OwnershipControls& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControlsRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControlsRule.h index 680e7712a44..8ee7b051592 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControlsRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/OwnershipControlsRule.h @@ -20,7 +20,7 @@ namespace Model { /** *

                The container element for an ownership control rule.

                See Also:

                - * AWS * API Reference

                */ @@ -29,7 +29,6 @@ class OwnershipControlsRule { AWS_S3_API OwnershipControlsRule() = default; AWS_S3_API OwnershipControlsRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API OwnershipControlsRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ParquetInput.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ParquetInput.h index 3f30cf9bae4..58492451adf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ParquetInput.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ParquetInput.h @@ -25,7 +25,6 @@ class ParquetInput { AWS_S3_API ParquetInput() = default; AWS_S3_API ParquetInput(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ParquetInput& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Part.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Part.h index 0771a39ff75..92ccaed0bcc 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Part.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Part.h @@ -29,7 +29,6 @@ class Part { AWS_S3_API Part() = default; AWS_S3_API Part(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Part& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PartitionedPrefix.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PartitionedPrefix.h index a6f46805889..4597ed7b572 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PartitionedPrefix.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PartitionedPrefix.h @@ -32,7 +32,6 @@ class PartitionedPrefix { AWS_S3_API PartitionedPrefix() = default; AWS_S3_API PartitionedPrefix(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API PartitionedPrefix& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PolicyStatus.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PolicyStatus.h index 5e75d581e11..99f2a57ad69 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PolicyStatus.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PolicyStatus.h @@ -17,7 +17,7 @@ namespace Model { /** *

                The container element for a bucket's policy status.

                See Also:

                - * AWS + * AWS * API Reference

                */ class PolicyStatus { @@ -25,7 +25,6 @@ class PolicyStatus { AWS_S3_API PolicyStatus() = default; AWS_S3_API PolicyStatus(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API PolicyStatus& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Progress.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Progress.h index 042a2d8d47d..40891a748bf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Progress.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Progress.h @@ -26,7 +26,6 @@ class Progress { AWS_S3_API Progress() = default; AWS_S3_API Progress(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Progress& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ProgressEvent.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ProgressEvent.h index 49621ffc0d8..2d7b513be6a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ProgressEvent.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ProgressEvent.h @@ -29,7 +29,6 @@ class ProgressEvent { AWS_S3_API ProgressEvent() = default; AWS_S3_API ProgressEvent(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ProgressEvent& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PublicAccessBlockConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PublicAccessBlockConfiguration.h index 804557e5394..48aac433dd3 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PublicAccessBlockConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PublicAccessBlockConfiguration.h @@ -32,7 +32,6 @@ class PublicAccessBlockConfiguration { AWS_S3_API PublicAccessBlockConfiguration() = default; AWS_S3_API PublicAccessBlockConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API PublicAccessBlockConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAbacRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAbacRequest.h index 428d98d80b5..298bb0910a5 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAbacRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAbacRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,12 +31,12 @@ class PutBucketAbacRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAccelerateConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAccelerateConfigurationRequest.h index 67ad17e2720..59e3f66ad9f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAccelerateConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAccelerateConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,13 +31,14 @@ class PutBucketAccelerateConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAclRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAclRequest.h index c476fae5150..c1b1bdeff75 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAclRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAclRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutBucketAclRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAnalyticsConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAnalyticsConfigurationRequest.h index fdca059d354..fc17edcd945 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAnalyticsConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketAnalyticsConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class PutBucketAnalyticsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketCorsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketCorsRequest.h index 52da369dc06..18015f5af6e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketCorsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketCorsRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketCorsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketEncryptionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketEncryptionRequest.h index 9edc644c694..a8e2474335f 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketEncryptionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketEncryptionRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketEncryptionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; @@ -111,9 +108,9 @@ class PutBucketEncryptionRequest : public S3Request { * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking * object integrity in the Amazon S3 User Guide.

                If you provide * an individual checksum, Amazon S3 ignores any provided - * ChecksumAlgorithm parameter.

                For directory buckets, - * when you use Amazon Web Services SDKs, CRC32 is the default - * checksum algorithm that's used for performance.

                + * ChecksumAlgorithm parameter.

                For directory buckets, when + * you use Amazon Web Services SDKs, CRC32 is the default checksum + * algorithm that's used for performance.

                */ inline ChecksumAlgorithm GetChecksumAlgorithm() const { return m_checksumAlgorithm; } inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; } @@ -149,10 +146,10 @@ class PutBucketEncryptionRequest : public S3Request { /** *

                The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

                - *

                For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

                + * the HTTP status code 403 Forbidden (access denied).

                For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

                */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketIntelligentTieringConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketIntelligentTieringConfigurationRequest.h index 56e64e86d9a..e4da280256c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketIntelligentTieringConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketIntelligentTieringConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class PutBucketIntelligentTieringConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketInventoryConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketInventoryConfigurationRequest.h index ca66e12583e..7b9fc955e06 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketInventoryConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketInventoryConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class PutBucketInventoryConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -112,10 +110,10 @@ class PutBucketInventoryConfigurationRequest : public S3Request { /** *

                The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

                - *

                For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

                + * the HTTP status code 403 Forbidden (access denied).

                For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

                */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationRequest.h index ec4581220a2..de774b0b637 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutBucketLifecycleConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; @@ -114,9 +111,9 @@ class PutBucketLifecycleConfigurationRequest : public S3Request { /** *

                The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

                - *

                This parameter applies to general purpose buckets only. It is not supported - * for directory bucket lifecycle configurations.

                + * the HTTP status code 403 Forbidden (access denied).

                This + * parameter applies to general purpose buckets only. It is not supported for + * directory bucket lifecycle configurations.

                */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } @@ -137,13 +134,13 @@ class PutBucketLifecycleConfigurationRequest : public S3Request { *

                Indicates which default minimum object size behavior is applied to the * lifecycle configuration.

                This parameter applies to general purpose * buckets only. It is not supported for directory bucket lifecycle - * configurations.

                • all_storage_classes_128K - * - Objects smaller than 128 KB will not transition to any storage class by - * default.

                • varies_by_storage_class - Objects - * smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier - * Deep Archive storage classes. By default, all other storage classes will prevent - * transitions smaller than 128 KB.

                To customize the minimum - * object size for any transition you can add a filter that specifies a custom + * configurations.

                • all_storage_classes_128K - + * Objects smaller than 128 KB will not transition to any storage class by default. + *

                • varies_by_storage_class - Objects smaller than + * 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive + * storage classes. By default, all other storage classes will prevent transitions + * smaller than 128 KB.

                To customize the minimum object size + * for any transition you can add a filter that specifies a custom * ObjectSizeGreaterThan or ObjectSizeLessThan in the * body of your transition rule. Custom filters always take precedence over the * default transition behavior.

                diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationResult.h index 8dfc66a2cbb..8671141a5d0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLifecycleConfigurationResult.h @@ -33,13 +33,13 @@ class PutBucketLifecycleConfigurationResult { *

                Indicates which default minimum object size behavior is applied to the * lifecycle configuration.

                This parameter applies to general purpose * buckets only. It is not supported for directory bucket lifecycle - * configurations.

                • all_storage_classes_128K - * - Objects smaller than 128 KB will not transition to any storage class by - * default.

                • varies_by_storage_class - Objects - * smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier - * Deep Archive storage classes. By default, all other storage classes will prevent - * transitions smaller than 128 KB.

                To customize the minimum - * object size for any transition you can add a filter that specifies a custom + * configurations.

                • all_storage_classes_128K - + * Objects smaller than 128 KB will not transition to any storage class by default. + *

                • varies_by_storage_class - Objects smaller than + * 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive + * storage classes. By default, all other storage classes will prevent transitions + * smaller than 128 KB.

                To customize the minimum object size + * for any transition you can add a filter that specifies a custom * ObjectSizeGreaterThan or ObjectSizeLessThan in the * body of your transition rule. Custom filters always take precedence over the * default transition behavior.

                diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLoggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLoggingRequest.h index 6d2e24836a1..12d501e3634 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLoggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketLoggingRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketLoggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketMetricsConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketMetricsConfigurationRequest.h index 2e786fa4a62..9c4bd527533 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketMetricsConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketMetricsConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class PutBucketMetricsConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -114,10 +112,10 @@ class PutBucketMetricsConfigurationRequest : public S3Request { /** *

                The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

                - *

                For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

                + * the HTTP status code 403 Forbidden (access denied).

                For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

                */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketNotificationConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketNotificationConfigurationRequest.h index 3502cd88eb5..3e4da84ea08 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketNotificationConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketNotificationConfigurationRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,11 +30,12 @@ class PutBucketNotificationConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketOwnershipControlsRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketOwnershipControlsRequest.h index d24e583e769..e7a4f13c7ea 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketOwnershipControlsRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketOwnershipControlsRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketOwnershipControlsRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketPolicyRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketPolicyRequest.h index d92dda2d130..d0cb0fd370e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketPolicyRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketPolicyRequest.h @@ -13,9 +13,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -31,15 +28,14 @@ class PutBucketPolicyRequest : public StreamingS3Request { // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "PutBucketPolicy"; } - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; - AWS_S3_API bool IsStreaming() const override { return false; } /** @@ -80,8 +76,8 @@ class PutBucketPolicyRequest : public StreamingS3Request { /** *

                The MD5 hash of the request body.

                For requests made using the Amazon * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this - * field is calculated automatically.

                This functionality is not - * supported for directory buckets.

                + * field is calculated automatically.

                This functionality is not supported + * for directory buckets.

                */ inline const Aws::String& GetContentMD5() const { return m_contentMD5; } inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; } @@ -118,9 +114,9 @@ class PutBucketPolicyRequest : public StreamingS3Request { * individual checksum value you provide through * x-amz-checksum-algorithm doesn't match the checksum * algorithm you set through x-amz-sdk-checksum-algorithm, Amazon S3 - * fails the request with a BadDigest error.

                For - * directory buckets, when you use Amazon Web Services SDKs, CRC32 is - * the default checksum algorithm that's used for performance.

                + * fails the request with a BadDigest error.

                For directory + * buckets, when you use Amazon Web Services SDKs, CRC32 is the + * default checksum algorithm that's used for performance.

                */ inline ChecksumAlgorithm GetChecksumAlgorithm() const { return m_checksumAlgorithm; } inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; } @@ -156,10 +152,10 @@ class PutBucketPolicyRequest : public StreamingS3Request { /** *

                The account ID of the expected bucket owner. If the account ID that you * provide does not match the actual owner of the bucket, the request fails with - * the HTTP status code 403 Forbidden (access denied).

                - *

                For directory buckets, this header is not supported in this API operation. If - * you specify this header, the request fails with the HTTP status code 501 - * Not Implemented.

                + * the HTTP status code 403 Forbidden (access denied).

                For + * directory buckets, this header is not supported in this API operation. If you + * specify this header, the request fails with the HTTP status code 501 Not + * Implemented.

                */ inline const Aws::String& GetExpectedBucketOwner() const { return m_expectedBucketOwner; } inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketReplicationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketReplicationRequest.h index 370fb9c2ba5..59e5d75986d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketReplicationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketReplicationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketReplicationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketRequestPaymentRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketRequestPaymentRequest.h index 540d455441e..7052df68571 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketRequestPaymentRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketRequestPaymentRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketRequestPaymentRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketTaggingRequest.h index 6ba744e9f61..ee77a9508e2 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketTaggingRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketVersioningRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketVersioningRequest.h index feefce41416..83e4b102907 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketVersioningRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketVersioningRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketVersioningRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; @@ -68,9 +65,9 @@ class PutBucketVersioningRequest : public S3Request { ///@{ /** - *

                >The Base64 encoded 128-bit MD5 digest of the data. You must - * use this header as a message integrity check to verify that the request body was - * not corrupted in transit. For more information, see >The Base64 encoded 128-bit MD5 digest of the data. You must use + * this header as a message integrity check to verify that the request body was not + * corrupted in transit. For more information, see RFC 1864.

                For requests * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web * Services SDKs, this field is calculated automatically.

                diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketWebsiteRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketWebsiteRequest.h index 970902dde98..3e4d322edb3 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketWebsiteRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutBucketWebsiteRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutBucketWebsiteRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAclRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAclRequest.h index 0d296f53b05..c4dd258afbc 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAclRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAclRequest.h @@ -16,9 +16,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -36,10 +33,10 @@ class PutObjectAclRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; @@ -132,9 +129,9 @@ class PutObjectAclRequest : public S3Request { *

                The Base64 encoded 128-bit MD5 digest of the data. This header * must be used as a message integrity check to verify that the request body was * not corrupted in transit. For more information, go to RFC 1864.>

                For - * requests made using the Amazon Web Services Command Line Interface (CLI) or - * Amazon Web Services SDKs, this field is calculated automatically.

                + * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.>

                For requests + * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web + * Services SDKs, this field is calculated automatically.

                */ inline const Aws::String& GetContentMD5() const { return m_contentMD5; } inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; } @@ -306,8 +303,8 @@ class PutObjectAclRequest : public S3Request { ///@{ /** - *

                Version ID used to reference a specific version of the object.

                - *

                This functionality is not supported for directory buckets.

                + *

                Version ID used to reference a specific version of the object.

                This + * functionality is not supported for directory buckets.

                */ inline const Aws::String& GetVersionId() const { return m_versionId; } inline bool VersionIdHasBeenSet() const { return m_versionIdHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAnnotationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAnnotationRequest.h index e6adbab687c..ad297c0318a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAnnotationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectAnnotationRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,10 +30,9 @@ class PutObjectAnnotationRequest : public StreamingS3Request { // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "PutObjectAnnotation"; } - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; AWS_S3_API bool IsStreaming() const override { return false; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLegalHoldRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLegalHoldRequest.h index 54bcb85827b..9eb974ea79c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLegalHoldRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLegalHoldRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutObjectLegalHoldRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLockConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLockConfigurationRequest.h index 14947ae9c05..11a7d0acd15 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLockConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectLockConfigurationRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutObjectLockConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRequest.h index 78ac0d78878..4fd8c68fa94 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRequest.h @@ -21,9 +21,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -39,13 +36,14 @@ class PutObjectRequest : public StreamingS3Request { // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "PutObject"; } - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -75,9 +73,9 @@ class PutObjectRequest : public StreamingS3Request { * AccessControlListNotSupported. For more information, see * Controlling ownership of objects and disabling ACLs in the Amazon S3 User - * Guide.

                • This functionality is not supported for - * directory buckets.

                • This functionality is not supported for - * Amazon S3 on Outposts.

                + * Guide.

                • This functionality is not supported for directory + * buckets.

                • This functionality is not supported for Amazon S3 on + * Outposts.

                */ inline ObjectCannedACL GetACL() const { return m_aCL; } inline bool ACLHasBeenSet() const { return m_aCLHasBeenSet; } @@ -115,11 +113,11 @@ class PutObjectRequest : public StreamingS3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

                Object - * Lambda access points are not supported by directory buckets.

                - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

                Object Lambda + * access points are not supported by directory buckets.

                S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -253,8 +251,8 @@ class PutObjectRequest : public StreamingS3Request { * For more information, see Uploading * objects to an Object Lock enabled bucket in the Amazon S3 User - * Guide.

                This functionality is not supported for - * directory buckets.

                + * Guide.

                This functionality is not supported for directory + * buckets.

                */ inline const Aws::String& GetContentMD5() const { return m_contentMD5; } inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; } @@ -297,9 +295,9 @@ class PutObjectRequest : public StreamingS3Request { * using Amazon S3 Object Lock. For more information, see Uploading * objects to an Object Lock enabled bucket in the Amazon S3 User - * Guide.

                For directory buckets, when you use Amazon Web - * Services SDKs, CRC32 is the default checksum algorithm that's used - * for performance.

                + * Guide.

                For directory buckets, when you use Amazon Web Services SDKs, + * CRC32 is the default checksum algorithm that's used for + * performance.

                */ inline ChecksumAlgorithm GetChecksumAlgorithm() const { return m_checksumAlgorithm; } inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; } @@ -674,9 +672,9 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** *

                Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the - * object.

                • This functionality is not supported for - * directory buckets.

                • This functionality is not supported for - * Amazon S3 on Outposts.

                + * object.

                • This functionality is not supported for directory + * buckets.

                • This functionality is not supported for Amazon S3 on + * Outposts.

                */ inline const Aws::String& GetGrantFullControl() const { return m_grantFullControl; } inline bool GrantFullControlHasBeenSet() const { return m_grantFullControlHasBeenSet; } @@ -715,10 +713,9 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** - *

                Allows grantee to read the object ACL.

                • This - * functionality is not supported for directory buckets.

                • This - * functionality is not supported for Amazon S3 on Outposts.

                - * + *

                Allows grantee to read the object ACL.

                • This functionality + * is not supported for directory buckets.

                • This functionality is + * not supported for Amazon S3 on Outposts.

                */ inline const Aws::String& GetGrantReadACP() const { return m_grantReadACP; } inline bool GrantReadACPHasBeenSet() const { return m_grantReadACPHasBeenSet; } @@ -736,9 +733,9 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** - *

                Allows grantee to write the ACL for the applicable object.

                  - *
                • This functionality is not supported for directory buckets.

                • - *
                • This functionality is not supported for Amazon S3 on Outposts.

                • + *

                  Allows grantee to write the ACL for the applicable object.

                  • + *

                    This functionality is not supported for directory buckets.

                  • + *

                    This functionality is not supported for Amazon S3 on Outposts.

                  • *
                  */ inline const Aws::String& GetGrantWriteACP() const { return m_grantWriteACP; } @@ -777,9 +774,9 @@ class PutObjectRequest : public StreamingS3Request { /** *

                  Specifies the offset for appending data to existing objects in bytes. The * offset must be equal to the size of the existing object being appended to. If no - * object exists, setting this header to 0 will create a new object.

                  - *

                  This functionality is only supported for objects in the Amazon S3 Express One - * Zone storage class in directory buckets.

                  + * object exists, setting this header to 0 will create a new object.

                  This + * functionality is only supported for objects in the Amazon S3 Express One Zone + * storage class in directory buckets.

                  */ inline long long GetWriteOffsetBytes() const { return m_writeOffsetBytes; } inline bool WriteOffsetBytesHasBeenSet() const { return m_writeOffsetBytesHasBeenSet; } @@ -860,25 +857,24 @@ class PutObjectRequest : public StreamingS3Request { * in the CreateSession request. You don't need to explicitly specify * these encryption settings values in Zonal endpoint API calls, and Amazon S3 will * use the encryption settings values from the CreateSession request - * to protect new objects in the directory bucket.

                  When you use the - * CLI or the Amazon Web Services SDKs, for CreateSession, the session - * token refreshes automatically to avoid service interruptions when a session - * expires. The CLI or the Amazon Web Services SDKs use the bucket's default - * encryption configuration for the CreateSession request. It's not - * supported to override the encryption settings values in the - * CreateSession request. So in the Zonal endpoint API calls (except - *

                  When you use the CLI or + * the Amazon Web Services SDKs, for CreateSession, the session token + * refreshes automatically to avoid service interruptions when a session expires. + * The CLI or the Amazon Web Services SDKs use the bucket's default encryption + * configuration for the CreateSession request. It's not supported to + * override the encryption settings values in the CreateSession + * request. So in the Zonal endpoint API calls (except CopyObject * and UploadPartCopy), * the encryption request headers must match the default encryption configuration - * of the directory bucket.

                • S3 access points for - * Amazon FSx - When accessing data stored in Amazon FSx file systems using S3 - * access points, the only valid server side encryption option is - * aws:fsx. All Amazon FSx file systems have encryption configured by - * default and are encrypted at rest. Data is automatically encrypted before being - * written to the file system, and automatically decrypted as it is read. These - * processes are handled transparently by Amazon FSx.

                + * of the directory bucket.

              • S3 access points for Amazon FSx + * - When accessing data stored in Amazon FSx file systems using S3 access + * points, the only valid server side encryption option is aws:fsx. + * All Amazon FSx file systems have encryption configured by default and are + * encrypted at rest. Data is automatically encrypted before being written to the + * file system, and automatically decrypted as it is read. These processes are + * handled transparently by Amazon FSx.

              */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline bool ServerSideEncryptionHasBeenSet() const { return m_serverSideEncryptionHasBeenSet; } @@ -899,12 +895,11 @@ class PutObjectRequest : public StreamingS3Request { * availability. Depending on performance needs, you can specify a different * Storage Class. For more information, see Storage - * Classes in the Amazon S3 User Guide.

              • - *

                Directory buckets only support EXPRESS_ONEZONE (the S3 Express - * One Zone storage class) in Availability Zones and ONEZONE_IA (the - * S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.

              • - *
              • Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.

              • - *
              + * Classes in the Amazon S3 User Guide.

              • Directory + * buckets only support EXPRESS_ONEZONE (the S3 Express One Zone + * storage class) in Availability Zones and ONEZONE_IA (the S3 One + * Zone-Infrequent Access storage class) in Dedicated Local Zones.

              • + *

                Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.

              */ inline StorageClass GetStorageClass() const { return m_storageClass; } inline bool StorageClassHasBeenSet() const { return m_storageClassHasBeenSet; } @@ -955,8 +950,8 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** *

              Specifies the algorithm to use when encrypting the object (for example, - * AES256).

              This functionality is not supported for - * directory buckets.

              + * AES256).

              This functionality is not supported for directory + * buckets.

              */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -999,8 +994,8 @@ class PutObjectRequest : public StreamingS3Request { /** *

              Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

              This functionality - * is not supported for directory buckets.

              + * encryption key was transmitted without error.

              This functionality is not + * supported for directory buckets.

              */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } @@ -1158,8 +1153,8 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** - *

              The Object Lock mode that you want to apply to this object.

              - *

              This functionality is not supported for directory buckets.

              + *

              The Object Lock mode that you want to apply to this object.

              This + * functionality is not supported for directory buckets.

              */ inline ObjectLockMode GetObjectLockMode() const { return m_objectLockMode; } inline bool ObjectLockModeHasBeenSet() const { return m_objectLockModeHasBeenSet; } @@ -1176,8 +1171,8 @@ class PutObjectRequest : public StreamingS3Request { ///@{ /** *

              The date and time when you want this object's Object Lock to expire. Must be - * formatted as a timestamp parameter.

              This functionality is not - * supported for directory buckets.

              + * formatted as a timestamp parameter.

              This functionality is not supported + * for directory buckets.

              */ inline const Aws::Utils::DateTime& GetObjectLockRetainUntilDate() const { return m_objectLockRetainUntilDate; } inline bool ObjectLockRetainUntilDateHasBeenSet() const { return m_objectLockRetainUntilDateHasBeenSet; } @@ -1198,8 +1193,8 @@ class PutObjectRequest : public StreamingS3Request { *

              Specifies whether a legal hold will be applied to this object. For more * information about S3 Object Lock, see Object - * Lock in the Amazon S3 User Guide.

              This functionality is - * not supported for directory buckets.

              + * Lock in the Amazon S3 User Guide.

              This functionality is not + * supported for directory buckets.

              */ inline ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatus() const { return m_objectLockLegalHoldStatus; } inline bool ObjectLockLegalHoldStatusHasBeenSet() const { return m_objectLockLegalHoldStatusHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectResult.h index 3e0f19194fd..34c5d891bbd 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectResult.h @@ -37,10 +37,9 @@ class PutObjectResult { * in the Amazon S3 User Guide, the response includes this header. It * includes the expiry-date and rule-id key-value pairs * that provide information about object expiration. The value of the - * rule-id is URL-encoded.

              Object expiration information - * is not returned in directory buckets and this header returns the value + * rule-id is URL-encoded.

              Object expiration information is + * not returned in directory buckets and this header returns the value * "NotImplemented" in all responses for directory buckets.

              - * */ inline const Aws::String& GetExpiration() const { return m_expiration; } template @@ -327,9 +326,9 @@ class PutObjectResult { ///@{ /** *

              The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

              When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

              + * Amazon S3 or Amazon FSx.

              When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

              */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -355,7 +354,6 @@ class PutObjectResult { * For information about returning the versioning state of a bucket, see GetBucketVersioning. *

              This functionality is not supported for directory buckets.

              - * */ inline const Aws::String& GetVersionId() const { return m_versionId; } template @@ -374,8 +372,8 @@ class PutObjectResult { /** *

              If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

              This functionality is not supported for - * directory buckets.

              + * algorithm that's used.

              This functionality is not supported for directory + * buckets.

              */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -395,7 +393,7 @@ class PutObjectResult { *

              If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

              - *

              This functionality is not supported for directory buckets.

              + *

              This functionality is not supported for directory buckets.

              */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template @@ -469,8 +467,8 @@ class PutObjectResult { ///@{ /** *

              The size of the object in bytes. This value is only be present if you append - * to an object.

              This functionality is only supported for objects in - * the Amazon S3 Express One Zone storage class in directory buckets.

              + * to an object.

              This functionality is only supported for objects in the + * Amazon S3 Express One Zone storage class in directory buckets.

              */ inline long long GetSize() const { return m_size; } inline void SetSize(long long value) { diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRetentionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRetentionRequest.h index 75716731842..2704b0157a7 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRetentionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectRetentionRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutObjectRetentionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectTaggingRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectTaggingRequest.h index d6439775d90..63462968f30 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectTaggingRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutObjectTaggingRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,10 @@ class PutObjectTaggingRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutPublicAccessBlockRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutPublicAccessBlockRequest.h index 59b649ad0e7..1a23935115a 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutPublicAccessBlockRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/PutPublicAccessBlockRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class PutPublicAccessBlockRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfiguration.h index e1001f3c2f7..7e75090e558 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfiguration.h @@ -33,7 +33,6 @@ class QueueConfiguration { AWS_S3_API QueueConfiguration() = default; AWS_S3_API QueueConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API QueueConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfigurationDeprecated.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfigurationDeprecated.h deleted file mode 100644 index 2a97f65a9b1..00000000000 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/QueueConfigurationDeprecated.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once -#include -#include -#include -#include - -#include - -namespace Aws { -namespace Utils { -namespace Xml { -class XmlNode; -} // namespace Xml -} // namespace Utils -namespace S3 { -namespace Model { - -/** - *

              This data type is deprecated. Use QueueConfiguration - * for the same purposes. This data type specifies the configuration for publishing - * messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 - * detects specified events.

              See Also:

              AWS - * API Reference

              - */ -class QueueConfigurationDeprecated { - public: - AWS_S3_API QueueConfigurationDeprecated() = default; - AWS_S3_API QueueConfigurationDeprecated(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API QueueConfigurationDeprecated& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; - - ///@{ - - inline const Aws::String& GetId() const { return m_id; } - inline bool IdHasBeenSet() const { return m_idHasBeenSet; } - template - void SetId(IdT&& value) { - m_idHasBeenSet = true; - m_id = std::forward(value); - } - template - QueueConfigurationDeprecated& WithId(IdT&& value) { - SetId(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

              A collection of bucket events for which to send notifications.

              - */ - inline const Aws::Vector& GetEvents() const { return m_events; } - inline bool EventsHasBeenSet() const { return m_eventsHasBeenSet; } - template > - void SetEvents(EventsT&& value) { - m_eventsHasBeenSet = true; - m_events = std::forward(value); - } - template > - QueueConfigurationDeprecated& WithEvents(EventsT&& value) { - SetEvents(std::forward(value)); - return *this; - } - inline QueueConfigurationDeprecated& AddEvents(Event value) { - m_eventsHasBeenSet = true; - m_events.push_back(value); - return *this; - } - ///@} - - ///@{ - /** - *

              The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - * publishes a message when it detects events of the specified type.

              - */ - inline const Aws::String& GetQueue() const { return m_queue; } - inline bool QueueHasBeenSet() const { return m_queueHasBeenSet; } - template - void SetQueue(QueueT&& value) { - m_queueHasBeenSet = true; - m_queue = std::forward(value); - } - template - QueueConfigurationDeprecated& WithQueue(QueueT&& value) { - SetQueue(std::forward(value)); - return *this; - } - ///@} - private: - Aws::String m_id; - - Aws::Vector m_events; - - Aws::String m_queue; - bool m_idHasBeenSet = false; - bool m_eventsHasBeenSet = false; - bool m_queueHasBeenSet = false; -}; - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RecordExpiration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RecordExpiration.h index 5861f739e64..d7a7fb5127d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RecordExpiration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RecordExpiration.h @@ -29,7 +29,6 @@ class RecordExpiration { AWS_S3_API RecordExpiration() = default; AWS_S3_API RecordExpiration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RecordExpiration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Redirect.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Redirect.h index 69c6c21eabe..ec2c9deac4c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Redirect.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Redirect.h @@ -30,7 +30,6 @@ class Redirect { AWS_S3_API Redirect() = default; AWS_S3_API Redirect(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Redirect& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -95,9 +94,9 @@ class Redirect { * block with KeyPrefixEquals set to docs/ and in the * Redirect set ReplaceKeyPrefixWith to /documents. Not * required if one of the siblings is present. Can be present only if - * ReplaceKeyWith is not provided.

              Replacement must - * be made for object keys containing special characters (such as carriage returns) - * when using XML requests. For more information, see ReplaceKeyWith is not provided.

              Replacement must be made + * for object keys containing special characters (such as carriage returns) when + * using XML requests. For more information, see * XML related object key constraints.

              */ @@ -120,8 +119,8 @@ class Redirect { *

              The specific object key to use in the redirect request. For example, redirect * request to error.html. Not required if one of the siblings is * present. Can be present only if ReplaceKeyPrefixWith is not - * provided.

              Replacement must be made for object keys containing - * special characters (such as carriage returns) when using XML requests. For more + * provided.

              Replacement must be made for object keys containing special + * characters (such as carriage returns) when using XML requests. For more * information, see * XML related object key constraints.

              diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RedirectAllRequestsTo.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RedirectAllRequestsTo.h index e7ec88422e5..fcaa4a0c0d2 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RedirectAllRequestsTo.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RedirectAllRequestsTo.h @@ -30,7 +30,6 @@ class RedirectAllRequestsTo { AWS_S3_API RedirectAllRequestsTo() = default; AWS_S3_API RedirectAllRequestsTo(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RedirectAllRequestsTo& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RenameObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RenameObjectRequest.h index b61569b7d4b..e01aaedefdf 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RenameObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RenameObjectRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,10 @@ class RenameObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -271,8 +268,8 @@ class RenameObjectRequest : public S3Request { ///@{ /** *

              A unique string with a max of 64 ASCII characters in the ASCII range of 33 - - * 126.

              RenameObject supports idempotency using a - * client token. To make an idempotent API request using RenameObject, + * 126.

              RenameObject supports idempotency using a client + * token. To make an idempotent API request using RenameObject, * specify a client token in the request. You should not reuse the same client * token for other API requests. If you retry a request that completed successfully * using the same client token and the same parameters, the retry succeeds without diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicaModifications.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicaModifications.h index 67fc763ffb5..5366289e423 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicaModifications.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicaModifications.h @@ -35,7 +35,6 @@ class ReplicaModifications { AWS_S3_API ReplicaModifications() = default; AWS_S3_API ReplicaModifications(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicaModifications& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationConfiguration.h index 48e557e0953..9bc50330a0b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationConfiguration.h @@ -31,7 +31,6 @@ class ReplicationConfiguration { AWS_S3_API ReplicationConfiguration() = default; AWS_S3_API ReplicationConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRule.h index 42e98b2a8c8..9ae47b9bdd8 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRule.h @@ -35,7 +35,6 @@ class ReplicationRule { AWS_S3_API ReplicationRule() = default; AWS_S3_API ReplicationRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -136,8 +135,7 @@ class ReplicationRule { ///@{ /** *

              Optional configuration to replicate existing source bucket objects.

              - *

              This parameter is no longer supported. To replicate existing objects, - * see This parameter is no longer supported. To replicate existing objects, see Replicating * existing objects with S3 Batch Replication in the Amazon S3 User * Guide.

              diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleAndOperator.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleAndOperator.h index 7dc0ff836a2..75c7347eea3 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleAndOperator.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleAndOperator.h @@ -36,7 +36,6 @@ class ReplicationRuleAndOperator { AWS_S3_API ReplicationRuleAndOperator() = default; AWS_S3_API ReplicationRuleAndOperator(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationRuleAndOperator& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleFilter.h index 959d9cf4b07..d8b0e6a41fa 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationRuleFilter.h @@ -24,7 +24,7 @@ namespace Model { *

              A filter that identifies the subset of objects to which the replication rule * applies. A Filter must specify exactly one Prefix, * Tag, or an And child element.

              See Also:

              - * AWS * API Reference

              */ @@ -33,15 +33,14 @@ class ReplicationRuleFilter { AWS_S3_API ReplicationRuleFilter() = default; AWS_S3_API ReplicationRuleFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationRuleFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ /** *

              An object key name prefix that identifies the subset of objects to which the - * rule applies.

              Replacement must be made for object keys - * containing special characters (such as carriage returns) when using XML - * requests. For more information, see

              Replacement must be made for object keys containing + * special characters (such as carriage returns) when using XML requests. For more + * information, see * XML related object key constraints.

              */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTime.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTime.h index 697396770db..9ad610c6917 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTime.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTime.h @@ -32,7 +32,6 @@ class ReplicationTime { AWS_S3_API ReplicationTime() = default; AWS_S3_API ReplicationTime(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationTime& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTimeValue.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTimeValue.h index 00c47a8eec9..4c1aba791a9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTimeValue.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ReplicationTimeValue.h @@ -27,7 +27,6 @@ class ReplicationTimeValue { AWS_S3_API ReplicationTimeValue() = default; AWS_S3_API ReplicationTimeValue(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ReplicationTimeValue& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestPaymentConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestPaymentConfiguration.h index 4d696b7b89c..c340794a979 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestPaymentConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestPaymentConfiguration.h @@ -28,7 +28,6 @@ class RequestPaymentConfiguration { AWS_S3_API RequestPaymentConfiguration() = default; AWS_S3_API RequestPaymentConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RequestPaymentConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestProgress.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestProgress.h index be61cf637f5..5634244c7a9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestProgress.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RequestProgress.h @@ -26,7 +26,6 @@ class RequestProgress { AWS_S3_API RequestProgress() = default; AWS_S3_API RequestProgress(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RequestProgress& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreObjectRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreObjectRequest.h index 5cafc8346b9..b189a44babb 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreObjectRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreObjectRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,13 +32,14 @@ class RestoreObjectRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreRequest.h index eb2a47d67bd..55f6ae87dee 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreRequest.h @@ -33,7 +33,6 @@ class RestoreRequest { AWS_S3_API RestoreRequest() = default; AWS_S3_API RestoreRequest(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RestoreRequest& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -75,9 +74,8 @@ class RestoreRequest { ///@{ /** - *

              Amazon S3 Select is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the feature as usual. - * Amazon S3 Select is no longer available to new customers. Existing customers + * of Amazon S3 Select can continue to use the feature as usual. Learn * more

              Type of restore request.

              */ @@ -129,9 +127,8 @@ class RestoreRequest { ///@{ /** - *

              Amazon S3 Select is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the feature as usual. - * Amazon S3 Select is no longer available to new customers. Existing customers + * of Amazon S3 Select can continue to use the feature as usual. Learn * more

              Describes the parameters for Select job types.

              */ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreStatus.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreStatus.h index b309c74b65d..50e6ef37ca1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreStatus.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RestoreStatus.h @@ -27,8 +27,8 @@ namespace Model { *

              This functionality is not supported for directory buckets. Directory buckets * only support EXPRESS_ONEZONE (the S3 Express One Zone storage * class) in Availability Zones and ONEZONE_IA (the S3 One - * Zone-Infrequent Access storage class) in Dedicated Local Zones.

              - *

              See Also:

              See + * Also:

              AWS * API Reference

              */ @@ -37,7 +37,6 @@ class RestoreStatus { AWS_S3_API RestoreStatus() = default; AWS_S3_API RestoreStatus(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RestoreStatus& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RoutingRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RoutingRule.h index 587cb1cecc1..b53ea1a30d1 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RoutingRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/RoutingRule.h @@ -33,7 +33,6 @@ class RoutingRule { AWS_S3_API RoutingRule() = default; AWS_S3_API RoutingRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API RoutingRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Rule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Rule.h deleted file mode 100644 index 8e89201c253..00000000000 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Rule.h +++ /dev/null @@ -1,219 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace Aws { -namespace Utils { -namespace Xml { -class XmlNode; -} // namespace Xml -} // namespace Utils -namespace S3 { -namespace Model { - -/** - *

              Specifies lifecycle rules for an Amazon S3 bucket. For more information, see - * Put - * Bucket Lifecycle Configuration in the Amazon S3 API Reference. For - * examples, see Put - * Bucket Lifecycle Configuration Examples.

              See Also:

              AWS API - * Reference

              - */ -class Rule { - public: - AWS_S3_API Rule() = default; - AWS_S3_API Rule(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API Rule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; - - ///@{ - /** - *

              Specifies the expiration for the lifecycle of the object.

              - */ - inline const LifecycleExpiration& GetExpiration() const { return m_expiration; } - inline bool ExpirationHasBeenSet() const { return m_expirationHasBeenSet; } - template - void SetExpiration(ExpirationT&& value) { - m_expirationHasBeenSet = true; - m_expiration = std::forward(value); - } - template - Rule& WithExpiration(ExpirationT&& value) { - SetExpiration(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

              Unique identifier for the rule. The value can't be longer than 255 - * characters.

              - */ - inline const Aws::String& GetID() const { return m_iD; } - inline bool IDHasBeenSet() const { return m_iDHasBeenSet; } - template - void SetID(IDT&& value) { - m_iDHasBeenSet = true; - m_iD = std::forward(value); - } - template - Rule& WithID(IDT&& value) { - SetID(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

              Object key prefix that identifies one or more objects to which this rule - * applies.

              Replacement must be made for object keys containing - * special characters (such as carriage returns) when using XML requests. For more - * information, see - * XML related object key constraints.

              - */ - inline const Aws::String& GetPrefix() const { return m_prefix; } - inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } - template - void SetPrefix(PrefixT&& value) { - m_prefixHasBeenSet = true; - m_prefix = std::forward(value); - } - template - Rule& WithPrefix(PrefixT&& value) { - SetPrefix(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

              If Enabled, the rule is currently being applied. If - * Disabled, the rule is not currently being applied.

              - */ - inline ExpirationStatus GetStatus() const { return m_status; } - inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } - inline void SetStatus(ExpirationStatus value) { - m_statusHasBeenSet = true; - m_status = value; - } - inline Rule& WithStatus(ExpirationStatus value) { - SetStatus(value); - return *this; - } - ///@} - - ///@{ - /** - *

              Specifies when an object transitions to a specified storage class. For more - * information about Amazon S3 lifecycle configuration rules, see Transitioning - * Objects Using Amazon S3 Lifecycle in the Amazon S3 User Guide.

              - */ - inline const Transition& GetTransition() const { return m_transition; } - inline bool TransitionHasBeenSet() const { return m_transitionHasBeenSet; } - template - void SetTransition(TransitionT&& value) { - m_transitionHasBeenSet = true; - m_transition = std::forward(value); - } - template - Rule& WithTransition(TransitionT&& value) { - SetTransition(std::forward(value)); - return *this; - } - ///@} - - ///@{ - - inline const NoncurrentVersionTransition& GetNoncurrentVersionTransition() const { return m_noncurrentVersionTransition; } - inline bool NoncurrentVersionTransitionHasBeenSet() const { return m_noncurrentVersionTransitionHasBeenSet; } - template - void SetNoncurrentVersionTransition(NoncurrentVersionTransitionT&& value) { - m_noncurrentVersionTransitionHasBeenSet = true; - m_noncurrentVersionTransition = std::forward(value); - } - template - Rule& WithNoncurrentVersionTransition(NoncurrentVersionTransitionT&& value) { - SetNoncurrentVersionTransition(std::forward(value)); - return *this; - } - ///@} - - ///@{ - - inline const NoncurrentVersionExpiration& GetNoncurrentVersionExpiration() const { return m_noncurrentVersionExpiration; } - inline bool NoncurrentVersionExpirationHasBeenSet() const { return m_noncurrentVersionExpirationHasBeenSet; } - template - void SetNoncurrentVersionExpiration(NoncurrentVersionExpirationT&& value) { - m_noncurrentVersionExpirationHasBeenSet = true; - m_noncurrentVersionExpiration = std::forward(value); - } - template - Rule& WithNoncurrentVersionExpiration(NoncurrentVersionExpirationT&& value) { - SetNoncurrentVersionExpiration(std::forward(value)); - return *this; - } - ///@} - - ///@{ - - inline const AbortIncompleteMultipartUpload& GetAbortIncompleteMultipartUpload() const { return m_abortIncompleteMultipartUpload; } - inline bool AbortIncompleteMultipartUploadHasBeenSet() const { return m_abortIncompleteMultipartUploadHasBeenSet; } - template - void SetAbortIncompleteMultipartUpload(AbortIncompleteMultipartUploadT&& value) { - m_abortIncompleteMultipartUploadHasBeenSet = true; - m_abortIncompleteMultipartUpload = std::forward(value); - } - template - Rule& WithAbortIncompleteMultipartUpload(AbortIncompleteMultipartUploadT&& value) { - SetAbortIncompleteMultipartUpload(std::forward(value)); - return *this; - } - ///@} - private: - LifecycleExpiration m_expiration; - - Aws::String m_iD; - - Aws::String m_prefix; - - ExpirationStatus m_status{ExpirationStatus::NOT_SET}; - - Transition m_transition; - - NoncurrentVersionTransition m_noncurrentVersionTransition; - - NoncurrentVersionExpiration m_noncurrentVersionExpiration; - - AbortIncompleteMultipartUpload m_abortIncompleteMultipartUpload; - bool m_expirationHasBeenSet = false; - bool m_iDHasBeenSet = false; - bool m_prefixHasBeenSet = false; - bool m_statusHasBeenSet = false; - bool m_transitionHasBeenSet = false; - bool m_noncurrentVersionTransitionHasBeenSet = false; - bool m_noncurrentVersionExpirationHasBeenSet = false; - bool m_abortIncompleteMultipartUploadHasBeenSet = false; -}; - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3KeyFilter.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3KeyFilter.h index 8b703464e6e..9f73cd1e2ee 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3KeyFilter.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3KeyFilter.h @@ -30,7 +30,6 @@ class S3KeyFilter { AWS_S3_API S3KeyFilter() = default; AWS_S3_API S3KeyFilter(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API S3KeyFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3Location.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3Location.h index 0b810771fa4..e7c902ace86 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3Location.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3Location.h @@ -36,7 +36,6 @@ class S3Location { AWS_S3_API S3Location() = default; AWS_S3_API S3Location(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API S3Location& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3TablesDestination.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3TablesDestination.h index 763bd37f81e..24c5cf3f264 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3TablesDestination.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/S3TablesDestination.h @@ -23,9 +23,9 @@ namespace Model { * destination table bucket must be in the same Region and Amazon Web Services * account as the general purpose bucket. The specified metadata table name must be * unique within the aws_s3_metadata namespace in the destination - * table bucket.

              If you created your S3 Metadata configuration - * before July 15, 2025, we recommend that you delete and re-create your - * configuration by using

              If you created your S3 Metadata configuration before July + * 15, 2025, we recommend that you delete and re-create your configuration by using + * CreateBucketMetadataConfiguration * so that you can expire journal table records and create a live inventory * table.

              See Also:

              aws_s3_metadata
              namespace in the destination - * table bucket.

              If you created your S3 Metadata configuration - * before July 15, 2025, we recommend that you delete and re-create your - * configuration by using

              If you created your S3 Metadata configuration before July + * 15, 2025, we recommend that you delete and re-create your configuration by using + * CreateBucketMetadataConfiguration * so that you can expire journal table records and create a live inventory * table.

              See Also:

              Specifies the Amazon Web Services KMS key Amazon Resource Name (ARN) to use * for the updated server-side encryption type. Required if - * ObjectEncryption specifies SSEKMS.

              You - * must specify the full Amazon Web Services KMS key ARN. The KMS key ID and KMS - * key alias aren't supported.

              Pattern: + * ObjectEncryption specifies SSEKMS.

              You must + * specify the full Amazon Web Services KMS key ARN. The KMS key ID and KMS key + * alias aren't supported.

              Pattern: * (arn:aws[-a-z0-9]*:kms:[-a-z0-9]*:[0-9]{12}:key/.+)

              */ inline const Aws::String& GetKMSKeyArn() const { return m_kMSKeyArn; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SSES3.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SSES3.h index 01c3a961147..0065751c103 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SSES3.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SSES3.h @@ -26,7 +26,6 @@ class SSES3 { AWS_S3_API SSES3() = default; AWS_S3_API SSES3(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SSES3& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ScanRange.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ScanRange.h index 7b25d4a2298..2b90e444d93 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ScanRange.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ScanRange.h @@ -29,7 +29,6 @@ class ScanRange { AWS_S3_API ScanRange() = default; AWS_S3_API ScanRange(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ScanRange& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -37,9 +36,8 @@ class ScanRange { *

              Specifies the start of the byte range. This parameter is optional. Valid * values: non-negative integers. The default value is 0. If only * start is supplied, it means scan from that point to the end of the - * file. For example, - * <scanrange><start>50</start></scanrange> - * means scan from byte 50 until the end of the file.

              + * file. For example, 50 means + * scan from byte 50 until the end of the file.

              */ inline long long GetStart() const { return m_start; } inline bool StartHasBeenSet() const { return m_startHasBeenSet; } @@ -59,8 +57,8 @@ class ScanRange { * values: non-negative integers. The default value is one less than the size of * the object being queried. If only the End parameter is supplied, it is * interpreted to mean scan the last N bytes of the file. For example, - * <scanrange><end>50</end></scanrange> means - * scan the last 50 bytes.

              + * 50 means scan the last 50 + * bytes.

              */ inline long long GetEnd() const { return m_end; } inline bool EndHasBeenSet() const { return m_endHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentInitialResponse.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentInitialResponse.h index a8c814deaa4..e7617f68b53 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentInitialResponse.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentInitialResponse.h @@ -21,7 +21,6 @@ class SelectObjectContentInitialResponse { AWS_S3_API SelectObjectContentInitialResponse() = default; AWS_S3_API SelectObjectContentInitialResponse(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SelectObjectContentInitialResponse& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentRequest.h index 9e8742a847f..e0b1647eee6 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectObjectContentRequest.h @@ -19,24 +19,19 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { /** - *

              Learn Amazon S3 Select is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the feature as usual. - * Learn Amazon S3 Select is no longer available to new customers. Existing + * customers of Amazon S3 Select can continue to use the feature as usual. Learn - * more

              Request to filter the contents of an Amazon S3 object - * based on a simple Structured Query Language (SQL) statement. In the request, - * along with the SQL expression, you must specify a data serialization format - * (JSON or CSV) of the object. Amazon S3 uses this to parse object data into - * records. It returns only records that match the specified SQL expression. You - * must also specify the data serialization format for the response. For more - * information, see

              Request to filter the contents of an Amazon S3 object based on + * a simple Structured Query Language (SQL) statement. In the request, along with + * the SQL expression, you must specify a data serialization format (JSON or CSV) + * of the object. Amazon S3 uses this to parse object data into records. It returns + * only records that match the specified SQL expression. You must also specify the + * data serialization format for the response. For more information, see S3Select * API Documentation.

              See Also:

              AWS @@ -55,11 +50,12 @@ class SelectObjectContentRequest : public S3Request { inline virtual bool HasEventStreamResponse() const override { return true; } AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Underlying Event Stream Decoder. */ @@ -289,13 +285,12 @@ class SelectObjectContentRequest : public S3Request { * optional, but when specified, it must not be empty. See RFC 2616, Section * 14.35.1 about how to specify the start and end of the range.

              * ScanRangemay be used in the following ways:

              • - * <scanrange><start>50</start><end>100</end></scanrange> - * - process only the records starting between the bytes 50 and 100 (inclusive, - * counting from zero)

              • - * <scanrange><start>50</start></scanrange> - + * 50100 - process + * only the records starting between the bytes 50 and 100 (inclusive, counting from + * zero)

              • 50 - * process only the records starting after the byte 50

              • - * <scanrange><end>50</end></scanrange> - - * process only the records within the last 50 bytes of the file.

              + * 50 - process only the records + * within the last 50 bytes of the file.

            */ inline const ScanRange& GetScanRange() const { return m_scanRange; } inline bool ScanRangeHasBeenSet() const { return m_scanRangeHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectParameters.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectParameters.h index 1ac5a3ca33a..94263ad175c 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectParameters.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SelectParameters.h @@ -22,12 +22,10 @@ namespace S3 { namespace Model { /** - *

            Amazon S3 Select is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the feature as usual. - * Amazon S3 Select is no longer available to new customers. Existing customers + * of Amazon S3 Select can continue to use the feature as usual. Learn - * more

            Describes the parameters for Select job types.

            - *

            Learn

            Describes the parameters for Select job types.

            Learn How * to optimize querying your data in Amazon S3 using Amazon @@ -42,7 +40,6 @@ class SelectParameters { AWS_S3_API SelectParameters() = default; AWS_S3_API SelectParameters(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SelectParameters& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -81,12 +78,10 @@ class SelectParameters { ///@{ /** - *

            Amazon S3 Select is no longer available to new customers. - * Existing customers of Amazon S3 Select can continue to use the feature as usual. - * Amazon S3 Select is no longer available to new customers. Existing customers + * of Amazon S3 Select can continue to use the feature as usual. Learn - * more

            The expression that is used to query the - * object.

            + * more

            The expression that is used to query the object.

            */ inline const Aws::String& GetExpression() const { return m_expression; } inline bool ExpressionHasBeenSet() const { return m_expressionHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionByDefault.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionByDefault.h index 5d8b793a59f..dc5a1836a78 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionByDefault.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionByDefault.h @@ -24,10 +24,10 @@ namespace Model { * bucket. If a PUT Object request doesn't specify any server-side encryption, this * default encryption will be applied. For more information, see PutBucketEncryption.

            - *

            Amazon S3 only supports symmetric encryption KMS keys. For more + * information, see Asymmetric * keys in Amazon Web Services KMS in the Amazon Web Services Key Management * Service Developer Guide.

            diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionConfiguration.h index d80af3f5ba9..315b16ba0ba 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionConfiguration.h @@ -30,7 +30,6 @@ class ServerSideEncryptionConfiguration { AWS_S3_API ServerSideEncryptionConfiguration() = default; AWS_S3_API ServerSideEncryptionConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ServerSideEncryptionConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionRule.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionRule.h index 9b62980fa57..a7134953486 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionRule.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryptionRule.h @@ -20,13 +20,13 @@ namespace S3 { namespace Model { /** - *

            Specifies the default server-side encryption configuration.

              - *
            • General purpose buckets - If you're specifying a customer - * managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a - * KMS key alias instead, then KMS resolves the key within the requester’s account. - * This behavior can result in data that's encrypted with a KMS key that belongs to - * the requester, and not the bucket owner.

            • Directory - * buckets - When you specify an Specifies the default server-side encryption configuration.

              • + *

                General purpose buckets - If you're specifying a customer managed KMS + * key, we recommend using a fully qualified KMS key ARN. If you use a KMS key + * alias instead, then KMS resolves the key within the requester’s account. This + * behavior can result in data that's encrypted with a KMS key that belongs to the + * requester, and not the bucket owner.

              • Directory buckets + * - When you specify an KMS * customer managed key for encryption in your directory bucket, only use the * key ID or key ARN. The key alias format of the KMS key isn't supported.

                @@ -39,7 +39,6 @@ class ServerSideEncryptionRule { AWS_S3_API ServerSideEncryptionRule() = default; AWS_S3_API ServerSideEncryptionRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API ServerSideEncryptionRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -67,9 +66,9 @@ class ServerSideEncryptionRule { *

                Specifies whether Amazon S3 should use an S3 Bucket Key with server-side * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects * are not affected. Setting the BucketKeyEnabled element to - * true causes Amazon S3 to use an S3 Bucket Key.

                  - *
                • General purpose buckets - By default, S3 Bucket Key is not - * enabled. For more information, see true causes Amazon S3 to use an S3 Bucket Key.

                  • + * General purpose buckets - By default, S3 Bucket Key is not enabled. For + * more information, see Amazon S3 * Bucket Keys in the Amazon S3 User Guide.

                  • * Directory buckets - S3 Bucket Keys are always enabled for @@ -110,8 +109,8 @@ class ServerSideEncryptionRule { * pre-existing objects already encrypted with the specified encryption type. For * more information, see Blocking - * or unblocking SSE-C for a general purpose bucket.

                    Currently, - * this parameter only supports blocking or unblocking server-side encryption with + * or unblocking SSE-C for a general purpose bucket.

                    Currently, this + * parameter only supports blocking or unblocking server-side encryption with * customer-provided keys (SSE-C). For more information about SSE-C, see Using * server-side encryption with customer-provided keys (SSE-C).

                    diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SessionCredentials.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SessionCredentials.h index cd2bb1f1de3..a4321197025 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SessionCredentials.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SessionCredentials.h @@ -32,7 +32,6 @@ class SessionCredentials { AWS_S3_API SessionCredentials() = default; AWS_S3_API SessionCredentials(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SessionCredentials& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SimplePrefix.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SimplePrefix.h index 221de1eb204..47bdba01601 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SimplePrefix.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SimplePrefix.h @@ -28,7 +28,6 @@ class SimplePrefix { AWS_S3_API SimplePrefix() = default; AWS_S3_API SimplePrefix(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SimplePrefix& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SourceSelectionCriteria.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SourceSelectionCriteria.h index d94075cecfd..7eb0e3d0093 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SourceSelectionCriteria.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SourceSelectionCriteria.h @@ -34,7 +34,6 @@ class SourceSelectionCriteria { AWS_S3_API SourceSelectionCriteria() = default; AWS_S3_API SourceSelectionCriteria(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SourceSelectionCriteria& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SseKmsEncryptedObjects.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SseKmsEncryptedObjects.h index d891694636e..69ad79fc291 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SseKmsEncryptedObjects.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/SseKmsEncryptedObjects.h @@ -29,7 +29,6 @@ class SseKmsEncryptedObjects { AWS_S3_API SseKmsEncryptedObjects() = default; AWS_S3_API SseKmsEncryptedObjects(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API SseKmsEncryptedObjects& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Stats.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Stats.h index 45fc88369ff..c2a3f81d80e 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Stats.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Stats.h @@ -25,7 +25,6 @@ class Stats { AWS_S3_API Stats() = default; AWS_S3_API Stats(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Stats& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StatsEvent.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StatsEvent.h index 157cac3bed8..269ef6a0ba9 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StatsEvent.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StatsEvent.h @@ -28,7 +28,6 @@ class StatsEvent { AWS_S3_API StatsEvent() = default; AWS_S3_API StatsEvent(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API StatsEvent& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysis.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysis.h index 2880683946f..8d582ea5538 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysis.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysis.h @@ -30,7 +30,6 @@ class StorageClassAnalysis { AWS_S3_API StorageClassAnalysis() = default; AWS_S3_API StorageClassAnalysis(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API StorageClassAnalysis& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysisDataExport.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysisDataExport.h index aba431e5ace..ef0a79e90d7 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysisDataExport.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/StorageClassAnalysisDataExport.h @@ -30,7 +30,6 @@ class StorageClassAnalysisDataExport { AWS_S3_API StorageClassAnalysisDataExport() = default; AWS_S3_API StorageClassAnalysisDataExport(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API StorageClassAnalysisDataExport& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tag.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tag.h index 9fde4650a25..9802a463a8b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tag.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tag.h @@ -28,7 +28,6 @@ class Tag { AWS_S3_API Tag() = default; AWS_S3_API Tag(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Tag& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tagging.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tagging.h index 29d0effbc14..eb96e52ee12 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tagging.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tagging.h @@ -29,7 +29,6 @@ class Tagging { AWS_S3_API Tagging() = default; AWS_S3_API Tagging(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Tagging& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetGrant.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetGrant.h index 87406eb016e..fd45a3e8963 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetGrant.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetGrant.h @@ -34,7 +34,6 @@ class TargetGrant { AWS_S3_API TargetGrant() = default; AWS_S3_API TargetGrant(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API TargetGrant& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetObjectKeyFormat.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetObjectKeyFormat.h index ac9d495e538..32769cbbe20 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetObjectKeyFormat.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TargetObjectKeyFormat.h @@ -30,7 +30,6 @@ class TargetObjectKeyFormat { AWS_S3_API TargetObjectKeyFormat() = default; AWS_S3_API TargetObjectKeyFormat(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API TargetObjectKeyFormat& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tiering.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tiering.h index cbca6b19634..f2ed85bf844 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tiering.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Tiering.h @@ -30,7 +30,6 @@ class Tiering { AWS_S3_API Tiering() = default; AWS_S3_API Tiering(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Tiering& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfiguration.h index d8c4a29efab..efb6e80799b 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfiguration.h @@ -33,7 +33,6 @@ class TopicConfiguration { AWS_S3_API TopicConfiguration() = default; AWS_S3_API TopicConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API TopicConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfigurationDeprecated.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfigurationDeprecated.h deleted file mode 100644 index 9d5ed3cf2c6..00000000000 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/TopicConfigurationDeprecated.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#pragma once -#include -#include -#include -#include - -#include - -namespace Aws { -namespace Utils { -namespace Xml { -class XmlNode; -} // namespace Xml -} // namespace Utils -namespace S3 { -namespace Model { - -/** - *

                    A container for specifying the configuration for publication of messages to - * an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects - * specified events. This data type is deprecated. Use TopicConfiguration - * instead.

                    See Also:

                    AWS - * API Reference

                    - */ -class TopicConfigurationDeprecated { - public: - AWS_S3_API TopicConfigurationDeprecated() = default; - AWS_S3_API TopicConfigurationDeprecated(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API TopicConfigurationDeprecated& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; - - ///@{ - - inline const Aws::String& GetId() const { return m_id; } - inline bool IdHasBeenSet() const { return m_idHasBeenSet; } - template - void SetId(IdT&& value) { - m_idHasBeenSet = true; - m_id = std::forward(value); - } - template - TopicConfigurationDeprecated& WithId(IdT&& value) { - SetId(std::forward(value)); - return *this; - } - ///@} - - ///@{ - /** - *

                    A collection of events related to objects

                    - */ - inline const Aws::Vector& GetEvents() const { return m_events; } - inline bool EventsHasBeenSet() const { return m_eventsHasBeenSet; } - template > - void SetEvents(EventsT&& value) { - m_eventsHasBeenSet = true; - m_events = std::forward(value); - } - template > - TopicConfigurationDeprecated& WithEvents(EventsT&& value) { - SetEvents(std::forward(value)); - return *this; - } - inline TopicConfigurationDeprecated& AddEvents(Event value) { - m_eventsHasBeenSet = true; - m_events.push_back(value); - return *this; - } - ///@} - - ///@{ - /** - *

                    Amazon SNS topic to which Amazon S3 will publish a message to report the - * specified events for the bucket.

                    - */ - inline const Aws::String& GetTopic() const { return m_topic; } - inline bool TopicHasBeenSet() const { return m_topicHasBeenSet; } - template - void SetTopic(TopicT&& value) { - m_topicHasBeenSet = true; - m_topic = std::forward(value); - } - template - TopicConfigurationDeprecated& WithTopic(TopicT&& value) { - SetTopic(std::forward(value)); - return *this; - } - ///@} - private: - Aws::String m_id; - - Aws::Vector m_events; - - Aws::String m_topic; - bool m_idHasBeenSet = false; - bool m_eventsHasBeenSet = false; - bool m_topicHasBeenSet = false; -}; - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Transition.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Transition.h index 3588086f704..28f995702bd 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Transition.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/Transition.h @@ -33,7 +33,6 @@ class Transition { AWS_S3_API Transition() = default; AWS_S3_API Transition(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API Transition& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.h index 891ea3852e5..35b2ae7e134 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,9 @@ class UpdateBucketMetadataAnnotationTableConfigurationRequest : public S3Request AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataInventoryTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataInventoryTableConfigurationRequest.h index c0a5e0cab56..ab3044e3022 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataInventoryTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataInventoryTableConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,9 @@ class UpdateBucketMetadataInventoryTableConfigurationRequest : public S3Request AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataJournalTableConfigurationRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataJournalTableConfigurationRequest.h index 23c0946ff5b..ee9d8dcf322 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataJournalTableConfigurationRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateBucketMetadataJournalTableConfigurationRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,10 +31,9 @@ class UpdateBucketMetadataJournalTableConfigurationRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateObjectEncryptionRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateObjectEncryptionRequest.h index 3e25e4c67bd..d2ca4ccf9e0 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateObjectEncryptionRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UpdateObjectEncryptionRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -35,10 +32,9 @@ class UpdateObjectEncryptionRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; inline bool RequestChecksumRequired() const override { return true; }; diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyRequest.h index 941cbae0871..b275fba4e15 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyRequest.h @@ -14,9 +14,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -34,11 +31,12 @@ class UploadPartCopyRequest : public S3Request { AWS_S3_API Aws::String SerializePayload() const override; - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -56,28 +54,28 @@ class UploadPartCopyRequest : public S3Request { * amzn-s3-demo-bucket--usw2-az1--x-s3). For * information about bucket naming restrictions, see Directory - * bucket naming rules in the Amazon S3 User Guide.

                    - *

                    Copying objects across different Amazon Web Services Regions isn't supported - * when the source or destination bucket is in Amazon Web Services Local Zones. The - * source and destination buckets must have the same parent Amazon Web Services - * Region. Otherwise, you get an HTTP 400 Bad Request error with the - * error code InvalidRequest.

                    Access points - - * When you use this action with an access point for general purpose buckets, you - * must provide the alias of the access point in place of the bucket name or - * specify the access point ARN. When you use this action with an access point for - * directory buckets, you must provide the access point name in place of the bucket - * name. When using the access point ARN, you must direct requests to the access - * point hostname. The access point hostname takes the form + * bucket naming rules in the Amazon S3 User Guide.

                    Copying + * objects across different Amazon Web Services Regions isn't supported when the + * source or destination bucket is in Amazon Web Services Local Zones. The source + * and destination buckets must have the same parent Amazon Web Services Region. + * Otherwise, you get an HTTP 400 Bad Request error with the error + * code InvalidRequest.

                    Access points - When you use + * this action with an access point for general purpose buckets, you must provide + * the alias of the access point in place of the bucket name or specify the access + * point ARN. When you use this action with an access point for directory buckets, + * you must provide the access point name in place of the bucket name. When using + * the access point ARN, you must direct requests to the access point hostname. The + * access point hostname takes the form * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. * When using this action with an access point through the Amazon Web Services * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

                    Object - * Lambda access points are not supported by directory buckets.

                    - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

                    Object Lambda + * access points are not supported by directory buckets.

                    S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -113,7 +111,7 @@ class UploadPartCopyRequest : public S3Request { * URL-encoded.

                  • For objects accessed through access points, * specify the Amazon Resource Name (ARN) of the object as accessed through the * access point, in the format - * arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>. + * arn:aws:s3:::accesspoint//object/. * For example, to copy the object reports/january.pdf through access * point my-access-point owned by account 123456789012 in * Region us-west-2, use the URL encoding of @@ -121,10 +119,10 @@ class UploadPartCopyRequest : public S3Request { * The value must be URL encoded.

                    • Amazon S3 supports copy * operations using Access points only when the source and destination buckets are * in the same Amazon Web Services Region.

                    • Access points are not - * supported by directory buckets.

                    Alternatively, for - * objects accessed through Amazon S3 on Outposts, specify the ARN of the object as + * supported by directory buckets.

                  Alternatively, for objects + * accessed through Amazon S3 on Outposts, specify the ARN of the object as * accessed in the format - * arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>. + * arn:aws:s3-outposts:::outpost//object/. * For example, to copy the object reports/january.pdf through outpost * my-outpost owned by account 123456789012 in Region * us-west-2, use the URL encoding of @@ -133,7 +131,7 @@ class UploadPartCopyRequest : public S3Request { * enabled, you could have multiple versions of the same object. By default, * x-amz-copy-source identifies the current version of the source * object to copy. To copy a specific version of the source object to copy, append - * ?versionId=<version-id> to the x-amz-copy-source + * ?versionId= to the x-amz-copy-source * request header (for example, x-amz-copy-source: * /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). *

                  If the current version is a delete marker and you don't specify a @@ -142,8 +140,8 @@ class UploadPartCopyRequest : public S3Request { * If you specify versionId in the x-amz-copy-source and the versionId * is a delete marker, Amazon S3 returns an HTTP 400 Bad Request * error, because you are not allowed to specify a delete marker as a version for - * the x-amz-copy-source.

                  Directory buckets - - * S3 Versioning isn't enabled and supported for directory buckets.

                  + * the x-amz-copy-source.

                  Directory buckets - S3 + * Versioning isn't enabled and supported for directory buckets.

                  */ inline const Aws::String& GetCopySource() const { return m_copySource; } inline bool CopySourceHasBeenSet() const { return m_copySourceHasBeenSet; } @@ -337,8 +335,8 @@ class UploadPartCopyRequest : public S3Request { ///@{ /** *

                  Specifies the algorithm to use when encrypting the object (for example, - * AES256).

                  This functionality is not supported when the destination - * bucket is a directory bucket.

                  + * AES256).

                  This functionality is not supported when the destination bucket + * is a directory bucket.

                  */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -362,8 +360,8 @@ class UploadPartCopyRequest : public S3Request { * appropriate for use with the algorithm specified in the * x-amz-server-side-encryption-customer-algorithm header. This must * be the same encryption key specified in the initiate multipart upload - * request.

                  This functionality is not supported when the destination - * bucket is a directory bucket.

                  + * request.

                  This functionality is not supported when the destination bucket + * is a directory bucket.

                  */ inline const Aws::String& GetSSECustomerKey() const { return m_sSECustomerKey; } inline bool SSECustomerKeyHasBeenSet() const { return m_sSECustomerKeyHasBeenSet; } @@ -383,8 +381,8 @@ class UploadPartCopyRequest : public S3Request { /** *

                  Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

                  This functionality - * is not supported when the destination bucket is a directory bucket.

                  + * encryption key was transmitted without error.

                  This functionality is not + * supported when the destination bucket is a directory bucket.

                  */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } @@ -403,8 +401,8 @@ class UploadPartCopyRequest : public S3Request { ///@{ /** *

                  Specifies the algorithm to use when decrypting the source object (for - * example, AES256).

                  This functionality is not supported - * when the source object is in a directory bucket.

                  + * example, AES256).

                  This functionality is not supported when + * the source object is in a directory bucket.

                  */ inline const Aws::String& GetCopySourceSSECustomerAlgorithm() const { return m_copySourceSSECustomerAlgorithm; } inline bool CopySourceSSECustomerAlgorithmHasBeenSet() const { return m_copySourceSSECustomerAlgorithmHasBeenSet; } @@ -424,9 +422,8 @@ class UploadPartCopyRequest : public S3Request { /** *

                  Specifies the customer-provided encryption key for Amazon S3 to use to * decrypt the source object. The encryption key provided in this header must be - * one that was used when the source object was created.

                  This - * functionality is not supported when the source object is in a directory - * bucket.

                  + * one that was used when the source object was created.

                  This functionality + * is not supported when the source object is in a directory bucket.

                  */ inline const Aws::String& GetCopySourceSSECustomerKey() const { return m_copySourceSSECustomerKey; } inline bool CopySourceSSECustomerKeyHasBeenSet() const { return m_copySourceSSECustomerKeyHasBeenSet; } @@ -446,8 +443,8 @@ class UploadPartCopyRequest : public S3Request { /** *

                  Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

                  This functionality - * is not supported when the source object is in a directory bucket.

                  + * encryption key was transmitted without error.

                  This functionality is not + * supported when the source object is in a directory bucket.

                  */ inline const Aws::String& GetCopySourceSSECustomerKeyMD5() const { return m_copySourceSSECustomerKeyMD5; } inline bool CopySourceSSECustomerKeyMD5HasBeenSet() const { return m_copySourceSSECustomerKeyMD5HasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyResult.h index 29db2c05bd6..27b4ee36dbe 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartCopyResult.h @@ -33,8 +33,8 @@ class UploadPartCopyResult { ///@{ /** *

                  The version of the source object that was copied, if you have enabled - * versioning on the source bucket.

                  This functionality is not - * supported when the source object is in a directory bucket.

                  + * versioning on the source bucket.

                  This functionality is not supported + * when the source object is in a directory bucket.

                  */ inline const Aws::String& GetCopySourceVersionId() const { return m_copySourceVersionId; } template @@ -69,9 +69,9 @@ class UploadPartCopyResult { ///@{ /** *

                  The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

                  + * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

                  */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -88,8 +88,8 @@ class UploadPartCopyResult { /** *

                  If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

                  This functionality is not supported for - * directory buckets.

                  + * algorithm that's used.

                  This functionality is not supported for directory + * buckets.

                  */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -109,7 +109,7 @@ class UploadPartCopyResult { *

                  If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

                  - *

                  This functionality is not supported for directory buckets.

                  + *

                  This functionality is not supported for directory buckets.

                  */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartRequest.h index 269bc5512d3..c51b1ccfb02 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartRequest.h @@ -15,9 +15,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -33,13 +30,14 @@ class UploadPartRequest : public StreamingS3Request { // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "UploadPart"; } - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API Aws::String GetChecksumAlgorithmName() const override; AWS_S3_API bool ChecksumAlgorithmIsSet() const override; + /** * Helper function to collect parameters (configurable and static hardcoded) required for endpoint computation. */ @@ -69,11 +67,11 @@ class UploadPartRequest : public StreamingS3Request { * SDKs, you provide the access point ARN in place of the bucket name. For more * information about access point ARNs, see Using - * access points in the Amazon S3 User Guide.

                  Object - * Lambda access points are not supported by directory buckets.

                  - * S3 on Outposts - When you use this action with S3 on Outposts, you must - * direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname - * takes the form + * access points in the Amazon S3 User Guide.

                  Object Lambda + * access points are not supported by directory buckets.

                  S3 on + * Outposts - When you use this action with S3 on Outposts, you must direct + * requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the + * form * AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. * When you use this action with S3 on Outposts, the destination bucket must be the * Outposts access point ARN or the access point alias. For more information about @@ -500,8 +498,7 @@ class UploadPartRequest : public StreamingS3Request { ///@{ /** *

                  Specifies the algorithm to use when encrypting the object (for example, - * AES256).

                  This functionality is not supported for directory - * buckets.

                  + * AES256).

                  This functionality is not supported for directory buckets.

                  */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } @@ -525,8 +522,7 @@ class UploadPartRequest : public StreamingS3Request { * appropriate for use with the algorithm specified in the * x-amz-server-side-encryption-customer-algorithm header. This must * be the same encryption key specified in the initiate multipart upload - * request.

                  This functionality is not supported for directory - * buckets.

                  + * request.

                  This functionality is not supported for directory buckets.

                  */ inline const Aws::String& GetSSECustomerKey() const { return m_sSECustomerKey; } inline bool SSECustomerKeyHasBeenSet() const { return m_sSECustomerKeyHasBeenSet; } @@ -546,8 +542,8 @@ class UploadPartRequest : public StreamingS3Request { /** *

                  Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. * Amazon S3 uses this header for a message integrity check to ensure that the - * encryption key was transmitted without error.

                  This functionality - * is not supported for directory buckets.

                  + * encryption key was transmitted without error.

                  This functionality is not + * supported for directory buckets.

                  */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartResult.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartResult.h index a9878a45f29..03bef24a0d8 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartResult.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/UploadPartResult.h @@ -32,9 +32,9 @@ class UploadPartResult { ///@{ /** *

                  The server-side encryption algorithm used when you store this object in - * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

                  + * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

                  */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline void SetServerSideEncryption(ServerSideEncryption value) { @@ -278,8 +278,8 @@ class UploadPartResult { /** *

                  If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to confirm the encryption - * algorithm that's used.

                  This functionality is not supported for - * directory buckets.

                  + * algorithm that's used.

                  This functionality is not supported for directory + * buckets.

                  */ inline const Aws::String& GetSSECustomerAlgorithm() const { return m_sSECustomerAlgorithm; } template @@ -299,7 +299,7 @@ class UploadPartResult { *

                  If server-side encryption with a customer-provided encryption key was * requested, the response will include this header to provide the round-trip * message integrity verification of the customer-provided encryption key.

                  - *

                  This functionality is not supported for directory buckets.

                  + *

                  This functionality is not supported for directory buckets.

                  */ inline const Aws::String& GetSSECustomerKeyMD5() const { return m_sSECustomerKeyMD5; } template diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/VersioningConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/VersioningConfiguration.h index 7114214e868..a170a5bb61d 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/VersioningConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/VersioningConfiguration.h @@ -33,7 +33,6 @@ class VersioningConfiguration { AWS_S3_API VersioningConfiguration() = default; AWS_S3_API VersioningConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API VersioningConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WebsiteConfiguration.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WebsiteConfiguration.h index dab622675ad..264b0338190 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WebsiteConfiguration.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WebsiteConfiguration.h @@ -33,7 +33,6 @@ class WebsiteConfiguration { AWS_S3_API WebsiteConfiguration() = default; AWS_S3_API WebsiteConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_S3_API WebsiteConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); - AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; ///@{ @@ -75,8 +74,8 @@ class WebsiteConfiguration { ///@{ /** *

                  The redirect behavior for every request to this bucket's website - * endpoint.

                  If you specify this property, you can't specify any - * other property.

                  + * endpoint.

                  If you specify this property, you can't specify any other + * property.

                  */ inline const RedirectAllRequestsTo& GetRedirectAllRequestsTo() const { return m_redirectAllRequestsTo; } inline bool RedirectAllRequestsToHasBeenSet() const { return m_redirectAllRequestsToHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WriteGetObjectResponseRequest.h b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WriteGetObjectResponseRequest.h index 582d9a026c2..cbd175ae8cc 100644 --- a/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WriteGetObjectResponseRequest.h +++ b/generated/src/aws-cpp-sdk-s3/include/aws/s3/model/WriteGetObjectResponseRequest.h @@ -20,9 +20,6 @@ #include namespace Aws { -namespace Http { -class URI; -} // namespace Http namespace S3 { namespace Model { @@ -38,13 +35,12 @@ class WriteGetObjectResponseRequest : public StreamingS3Request { // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "WriteGetObjectResponse"; } - AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; - AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; + AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; + AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override; AWS_S3_API bool SignBody() const override { return false; } - AWS_S3_API bool IsChunked() const override { return true; } /** @@ -118,12 +114,12 @@ class WriteGetObjectResponseRequest : public StreamingS3Request { ///@{ /** - *

                  A string that uniquely identifies an error condition. Returned in the - * <Code> tag of the error XML response for a corresponding - * GetObject call. Cannot be used with a successful - * StatusCode header or when the transformed object is provided in the - * body. All error codes from S3 are sentence-cased. The regular expression (regex) - * value is "^[A-Z][a-zA-Z]+$".

                  + *

                  A string that uniquely identifies an error condition. Returned in the + * tag of the error XML response for a corresponding GetObject call. + * Cannot be used with a successful StatusCode header or when the + * transformed object is provided in the body. All error codes from S3 are + * sentence-cased. The regular expression (regex) value is + * "^[A-Z][a-zA-Z]+$".

                  */ inline const Aws::String& GetErrorCode() const { return m_errorCode; } inline bool ErrorCodeHasBeenSet() const { return m_errorCodeHasBeenSet; } @@ -142,7 +138,7 @@ class WriteGetObjectResponseRequest : public StreamingS3Request { ///@{ /** *

                  Contains a generic description of the error condition. Returned in the - * <Message> tag of the error XML response for a corresponding + * tag of the error XML response for a corresponding * GetObject call. Cannot be used with a successful * StatusCode header or when the transformed object is provided in * body.

                  @@ -299,7 +295,7 @@ class WriteGetObjectResponseRequest : public StreamingS3Request { * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking * object integrity in the Amazon S3 User Guide.

                  Only one * checksum header can be specified at a time. If you supply multiple checksum - * headers, this request will fail.

                  + * headers, this request will fail.

                  */ inline const Aws::String& GetChecksumCRC32() const { return m_checksumCRC32; } inline bool ChecksumCRC32HasBeenSet() const { return m_checksumCRC32HasBeenSet; } @@ -799,9 +795,9 @@ class WriteGetObjectResponseRequest : public StreamingS3Request { ///@{ /** *

                  The server-side encryption algorithm used when storing requested object in - * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx - * file systems using S3 access points, the only valid server side encryption - * option is aws:fsx.

                  + * Amazon S3 or Amazon FSx.

                  When accessing data stored in Amazon FSx file + * systems using S3 access points, the only valid server side encryption option is + * aws:fsx.

                  */ inline ServerSideEncryption GetServerSideEncryption() const { return m_serverSideEncryption; } inline bool ServerSideEncryptionHasBeenSet() const { return m_serverSideEncryptionHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AbacStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AbacStatus.cpp index 6c493c3ad60..7e7be4215a1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AbacStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AbacStatus.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { AbacStatus::AbacStatus(const XmlNode& xmlNode) { *this = xmlNode; } -AbacStatus& AbacStatus::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = BucketAbacStatusMapper::GetBucketAbacStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void AbacStatus::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(BucketAbacStatusMapper::GetNameForBucketAbacStatus(m_status)); - } -} +AbacStatus& AbacStatus::operator=(const XmlNode& xmlNode) { return *this; } + +void AbacStatus::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AbortIncompleteMultipartUpload.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AbortIncompleteMultipartUpload.cpp index 8813e1f9547..ee685b0edcd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AbortIncompleteMultipartUpload.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AbortIncompleteMultipartUpload.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,30 +20,9 @@ namespace Model { AbortIncompleteMultipartUpload::AbortIncompleteMultipartUpload(const XmlNode& xmlNode) { *this = xmlNode; } -AbortIncompleteMultipartUpload& AbortIncompleteMultipartUpload::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode daysAfterInitiationNode = resultNode.FirstChild("DaysAfterInitiation"); - if (!daysAfterInitiationNode.IsNull()) { - m_daysAfterInitiation = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysAfterInitiationNode.GetText()).c_str()).c_str()); - m_daysAfterInitiationHasBeenSet = true; - } - } - - return *this; -} - -void AbortIncompleteMultipartUpload::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_daysAfterInitiationHasBeenSet) { - XmlNode daysAfterInitiationNode = parentNode.CreateChildElement("DaysAfterInitiation"); - ss << m_daysAfterInitiation; - daysAfterInitiationNode.SetText(ss.str()); - ss.str(""); - } -} +AbortIncompleteMultipartUpload& AbortIncompleteMultipartUpload::operator=(const XmlNode& xmlNode) { return *this; } + +void AbortIncompleteMultipartUpload::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadRequest.cpp index 1275f8627a0..7d18c07b501 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,32 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool AbortMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String AbortMultipartUploadRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection AbortMultipartUploadRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + if (m_ifMatchInitiatedTimeHasBeenSet) { + headers.emplace("x-amz-if-match-initiated-time", m_ifMatchInitiatedTime.ToGmtString(Aws::Utils::DateFormat::RFC822)); + } + return headers; } -Aws::String AbortMultipartUploadRequest::SerializePayload() const { return {}; } - -void AbortMultipartUploadRequest::AddQueryStringParameters(URI& uri) const { +void AbortMultipartUploadRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_uploadIdHasBeenSet) { ss << m_uploadId; uri.AddQueryStringParameter("uploadId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,31 +53,24 @@ void AbortMultipartUploadRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection AbortMultipartUploadRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool AbortMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_ifMatchInitiatedTimeHasBeenSet) { - headers.emplace("x-amz-if-match-initiated-time", m_ifMatchInitiatedTime.ToGmtString(Aws::Utils::DateFormat::RFC822)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } AbortMultipartUploadRequest::EndpointParameters AbortMultipartUploadRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadResult.cpp index 31db8707019..4789cbeb89b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AbortMultipartUploadResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; AbortMultipartUploadResult::AbortMultipartUploadResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -AbortMultipartUploadResult& AbortMultipartUploadResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +AbortMultipartUploadResult& AbortMultipartUploadResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AccelerateConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AccelerateConfiguration.cpp index ba2fb8299dc..8fe610a3114 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AccelerateConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AccelerateConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { AccelerateConfiguration::AccelerateConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -AccelerateConfiguration& AccelerateConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = BucketAccelerateStatusMapper::GetBucketAccelerateStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void AccelerateConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(BucketAccelerateStatusMapper::GetNameForBucketAccelerateStatus(m_status)); - } -} +AccelerateConfiguration& AccelerateConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void AccelerateConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AccessControlPolicy.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AccessControlPolicy.cpp index 768c5d4ddbe..1873ce82a4f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AccessControlPolicy.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AccessControlPolicy.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,46 +20,9 @@ namespace Model { AccessControlPolicy::AccessControlPolicy(const XmlNode& xmlNode) { *this = xmlNode; } -AccessControlPolicy& AccessControlPolicy::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AccessControlPolicy& AccessControlPolicy::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode grantsNode = resultNode.FirstChild("AccessControlList"); - if (!grantsNode.IsNull()) { - XmlNode grantsMember = grantsNode.FirstChild("Grant"); - m_grantsHasBeenSet = !grantsMember.IsNull(); - while (!grantsMember.IsNull()) { - m_grants.push_back(grantsMember); - grantsMember = grantsMember.NextNode("Grant"); - } - - m_grantsHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - } - - return *this; -} - -void AccessControlPolicy::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_grantsHasBeenSet) { - XmlNode grantsParentNode = parentNode.CreateChildElement("AccessControlList"); - for (const auto& item : m_grants) { - XmlNode grantsNode = grantsParentNode.CreateChildElement("Grant"); - item.AddToNode(grantsNode); - } - } - - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - m_owner.AddToNode(ownerNode); - } -} +void AccessControlPolicy::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AccessControlTranslation.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AccessControlTranslation.cpp index e95b737b897..e3165179ac4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AccessControlTranslation.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AccessControlTranslation.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { AccessControlTranslation::AccessControlTranslation(const XmlNode& xmlNode) { *this = xmlNode; } -AccessControlTranslation& AccessControlTranslation::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = OwnerOverrideMapper::GetOwnerOverrideForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(ownerNode.GetText()).c_str())); - m_ownerHasBeenSet = true; - } - } - - return *this; -} - -void AccessControlTranslation::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - ownerNode.SetText(OwnerOverrideMapper::GetNameForOwnerOverride(m_owner)); - } -} +AccessControlTranslation& AccessControlTranslation::operator=(const XmlNode& xmlNode) { return *this; } + +void AccessControlTranslation::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsAndOperator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsAndOperator.cpp index c08adcf18a0..89bdf03273d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsAndOperator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsAndOperator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,45 +20,9 @@ namespace Model { AnalyticsAndOperator::AnalyticsAndOperator(const XmlNode& xmlNode) { *this = xmlNode; } -AnalyticsAndOperator& AnalyticsAndOperator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnalyticsAndOperator& AnalyticsAndOperator::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tag"); - if (!tagsNode.IsNull()) { - XmlNode tagMember = tagsNode; - m_tagsHasBeenSet = !tagMember.IsNull(); - while (!tagMember.IsNull()) { - m_tags.push_back(tagMember); - tagMember = tagMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - } - - return *this; -} - -void AnalyticsAndOperator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagsHasBeenSet) { - for (const auto& item : m_tags) { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } -} +void AnalyticsAndOperator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsConfiguration.cpp index d45ce72dbed..cb422e1a043 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { AnalyticsConfiguration::AnalyticsConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -AnalyticsConfiguration& AnalyticsConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnalyticsConfiguration& AnalyticsConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - XmlNode storageClassAnalysisNode = resultNode.FirstChild("StorageClassAnalysis"); - if (!storageClassAnalysisNode.IsNull()) { - m_storageClassAnalysis = storageClassAnalysisNode; - m_storageClassAnalysisHasBeenSet = true; - } - } - - return *this; -} - -void AnalyticsConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } - - if (m_storageClassAnalysisHasBeenSet) { - XmlNode storageClassAnalysisNode = parentNode.CreateChildElement("StorageClassAnalysis"); - m_storageClassAnalysis.AddToNode(storageClassAnalysisNode); - } -} +void AnalyticsConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsExportDestination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsExportDestination.cpp index 20d76384e9b..d7e88049fb3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsExportDestination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsExportDestination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { AnalyticsExportDestination::AnalyticsExportDestination(const XmlNode& xmlNode) { *this = xmlNode; } -AnalyticsExportDestination& AnalyticsExportDestination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode s3BucketDestinationNode = resultNode.FirstChild("S3BucketDestination"); - if (!s3BucketDestinationNode.IsNull()) { - m_s3BucketDestination = s3BucketDestinationNode; - m_s3BucketDestinationHasBeenSet = true; - } - } - - return *this; -} - -void AnalyticsExportDestination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_s3BucketDestinationHasBeenSet) { - XmlNode s3BucketDestinationNode = parentNode.CreateChildElement("S3BucketDestination"); - m_s3BucketDestination.AddToNode(s3BucketDestinationNode); - } -} +AnalyticsExportDestination& AnalyticsExportDestination::operator=(const XmlNode& xmlNode) { return *this; } + +void AnalyticsExportDestination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsFilter.cpp index f38f4cb96bb..6cde8b41a75 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { AnalyticsFilter::AnalyticsFilter(const XmlNode& xmlNode) { *this = xmlNode; } -AnalyticsFilter& AnalyticsFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnalyticsFilter& AnalyticsFilter::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if (!tagNode.IsNull()) { - m_tag = tagNode; - m_tagHasBeenSet = true; - } - XmlNode andNode = resultNode.FirstChild("And"); - if (!andNode.IsNull()) { - m_and = andNode; - m_andHasBeenSet = true; - } - } - - return *this; -} - -void AnalyticsFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); - } - - if (m_andHasBeenSet) { - XmlNode andNode = parentNode.CreateChildElement("And"); - m_and.AddToNode(andNode); - } -} +void AnalyticsFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3BucketDestination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3BucketDestination.cpp index 73bf01d2988..c18c2b4dc52 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3BucketDestination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3BucketDestination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,58 +20,9 @@ namespace Model { AnalyticsS3BucketDestination::AnalyticsS3BucketDestination(const XmlNode& xmlNode) { *this = xmlNode; } -AnalyticsS3BucketDestination& AnalyticsS3BucketDestination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnalyticsS3BucketDestination& AnalyticsS3BucketDestination::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode formatNode = resultNode.FirstChild("Format"); - if (!formatNode.IsNull()) { - m_format = AnalyticsS3ExportFileFormatMapper::GetAnalyticsS3ExportFileFormatForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(formatNode.GetText()).c_str())); - m_formatHasBeenSet = true; - } - XmlNode bucketAccountIdNode = resultNode.FirstChild("BucketAccountId"); - if (!bucketAccountIdNode.IsNull()) { - m_bucketAccountId = Aws::Utils::Xml::DecodeEscapedXmlText(bucketAccountIdNode.GetText()); - m_bucketAccountIdHasBeenSet = true; - } - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - } - - return *this; -} - -void AnalyticsS3BucketDestination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_formatHasBeenSet) { - XmlNode formatNode = parentNode.CreateChildElement("Format"); - formatNode.SetText(AnalyticsS3ExportFileFormatMapper::GetNameForAnalyticsS3ExportFileFormat(m_format)); - } - - if (m_bucketAccountIdHasBeenSet) { - XmlNode bucketAccountIdNode = parentNode.CreateChildElement("BucketAccountId"); - bucketAccountIdNode.SetText(m_bucketAccountId); - } - - if (m_bucketHasBeenSet) { - XmlNode bucketNode = parentNode.CreateChildElement("Bucket"); - bucketNode.SetText(m_bucket); - } - - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } -} +void AnalyticsS3BucketDestination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3ExportFileFormat.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3ExportFileFormat.cpp index eb938637742..1aa02d7eb8b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3ExportFileFormat.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnalyticsS3ExportFileFormat.cpp @@ -27,7 +27,6 @@ AnalyticsS3ExportFileFormat GetAnalyticsS3ExportFileFormatForName(const Aws::Str overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return AnalyticsS3ExportFileFormat::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForAnalyticsS3ExportFileFormat(AnalyticsS3ExportFileFormat en if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationConfigurationState.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationConfigurationState.cpp index d83b4c8f0a5..b8b01d40545 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationConfigurationState.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationConfigurationState.cpp @@ -30,7 +30,6 @@ AnnotationConfigurationState GetAnnotationConfigurationStateForName(const Aws::S overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return AnnotationConfigurationState::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForAnnotationConfigurationState(AnnotationConfigurationState if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationDirective.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationDirective.cpp index cee57a787ff..6682ec9917b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationDirective.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationDirective.cpp @@ -30,7 +30,6 @@ AnnotationDirective GetAnnotationDirectiveForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return AnnotationDirective::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForAnnotationDirective(AnnotationDirective enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationEntry.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationEntry.cpp index f51c31db418..c34fb0c3e56 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationEntry.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationEntry.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,91 +20,9 @@ namespace Model { AnnotationEntry::AnnotationEntry(const XmlNode& xmlNode) { *this = xmlNode; } -AnnotationEntry& AnnotationEntry::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnnotationEntry& AnnotationEntry::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode annotationNameNode = resultNode.FirstChild("AnnotationName"); - if (!annotationNameNode.IsNull()) { - m_annotationName = Aws::Utils::Xml::DecodeEscapedXmlText(annotationNameNode.GetText()); - m_annotationNameHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumAlgorithmNode = resultNode.FirstChild("ChecksumAlgorithm"); - if (!checksumAlgorithmNode.IsNull()) { - XmlNode checksumAlgorithmMember = checksumAlgorithmNode; - m_checksumAlgorithmHasBeenSet = !checksumAlgorithmMember.IsNull(); - while (!checksumAlgorithmMember.IsNull()) { - m_checksumAlgorithm.push_back( - ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(StringUtils::Trim(checksumAlgorithmMember.GetText().c_str()))); - checksumAlgorithmMember = checksumAlgorithmMember.NextNode("ChecksumAlgorithm"); - } - - m_checksumAlgorithmHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - XmlNode replicationStatusNode = resultNode.FirstChild("ReplicationStatus"); - if (!replicationStatusNode.IsNull()) { - m_replicationStatus = ReplicationStatusMapper::GetReplicationStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(replicationStatusNode.GetText()).c_str())); - m_replicationStatusHasBeenSet = true; - } - } - - return *this; -} - -void AnnotationEntry::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_annotationNameHasBeenSet) { - XmlNode annotationNameNode = parentNode.CreateChildElement("AnnotationName"); - annotationNameNode.SetText(m_annotationName); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_checksumAlgorithmHasBeenSet) { - XmlNode checksumAlgorithmParentNode = parentNode.CreateChildElement("ChecksumAlgorithm"); - for (const auto& item : m_checksumAlgorithm) { - XmlNode checksumAlgorithmNode = checksumAlgorithmParentNode.CreateChildElement("ChecksumAlgorithm"); - checksumAlgorithmNode.SetText(ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(item)); - } - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } - - if (m_replicationStatusHasBeenSet) { - XmlNode replicationStatusNode = parentNode.CreateChildElement("ReplicationStatus"); - replicationStatusNode.SetText(ReplicationStatusMapper::GetNameForReplicationStatus(m_replicationStatus)); - } -} +void AnnotationEntry::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfiguration.cpp index b5080b42fe7..9d701239012 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,48 +20,9 @@ namespace Model { AnnotationTableConfiguration::AnnotationTableConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -AnnotationTableConfiguration& AnnotationTableConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnnotationTableConfiguration& AnnotationTableConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = AnnotationConfigurationStateMapper::GetAnnotationConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - XmlNode roleNode = resultNode.FirstChild("Role"); - if (!roleNode.IsNull()) { - m_role = Aws::Utils::Xml::DecodeEscapedXmlText(roleNode.GetText()); - m_roleHasBeenSet = true; - } - } - - return *this; -} - -void AnnotationTableConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(AnnotationConfigurationStateMapper::GetNameForAnnotationConfigurationState(m_configurationState)); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } - - if (m_roleHasBeenSet) { - XmlNode roleNode = parentNode.CreateChildElement("Role"); - roleNode.SetText(m_role); - } -} +void AnnotationTableConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationResult.cpp index 99d25d2b619..35df237daa4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,78 +20,9 @@ namespace Model { AnnotationTableConfigurationResult::AnnotationTableConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -AnnotationTableConfigurationResult& AnnotationTableConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnnotationTableConfigurationResult& AnnotationTableConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = AnnotationConfigurationStateMapper::GetAnnotationConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode tableStatusNode = resultNode.FirstChild("TableStatus"); - if (!tableStatusNode.IsNull()) { - m_tableStatus = Aws::Utils::Xml::DecodeEscapedXmlText(tableStatusNode.GetText()); - m_tableStatusHasBeenSet = true; - } - XmlNode errorNode = resultNode.FirstChild("Error"); - if (!errorNode.IsNull()) { - m_error = errorNode; - m_errorHasBeenSet = true; - } - XmlNode tableNameNode = resultNode.FirstChild("TableName"); - if (!tableNameNode.IsNull()) { - m_tableName = Aws::Utils::Xml::DecodeEscapedXmlText(tableNameNode.GetText()); - m_tableNameHasBeenSet = true; - } - XmlNode tableArnNode = resultNode.FirstChild("TableArn"); - if (!tableArnNode.IsNull()) { - m_tableArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableArnNode.GetText()); - m_tableArnHasBeenSet = true; - } - XmlNode roleNode = resultNode.FirstChild("Role"); - if (!roleNode.IsNull()) { - m_role = Aws::Utils::Xml::DecodeEscapedXmlText(roleNode.GetText()); - m_roleHasBeenSet = true; - } - } - - return *this; -} - -void AnnotationTableConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(AnnotationConfigurationStateMapper::GetNameForAnnotationConfigurationState(m_configurationState)); - } - - if (m_tableStatusHasBeenSet) { - XmlNode tableStatusNode = parentNode.CreateChildElement("TableStatus"); - tableStatusNode.SetText(m_tableStatus); - } - - if (m_errorHasBeenSet) { - XmlNode errorNode = parentNode.CreateChildElement("Error"); - m_error.AddToNode(errorNode); - } - - if (m_tableNameHasBeenSet) { - XmlNode tableNameNode = parentNode.CreateChildElement("TableName"); - tableNameNode.SetText(m_tableName); - } - - if (m_tableArnHasBeenSet) { - XmlNode tableArnNode = parentNode.CreateChildElement("TableArn"); - tableArnNode.SetText(m_tableArn); - } - - if (m_roleHasBeenSet) { - XmlNode roleNode = parentNode.CreateChildElement("Role"); - roleNode.SetText(m_role); - } -} +void AnnotationTableConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationUpdates.cpp b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationUpdates.cpp index 8f4eb422fcb..a611b26e88b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationUpdates.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/AnnotationTableConfigurationUpdates.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,48 +20,9 @@ namespace Model { AnnotationTableConfigurationUpdates::AnnotationTableConfigurationUpdates(const XmlNode& xmlNode) { *this = xmlNode; } -AnnotationTableConfigurationUpdates& AnnotationTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +AnnotationTableConfigurationUpdates& AnnotationTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = AnnotationConfigurationStateMapper::GetAnnotationConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - XmlNode roleNode = resultNode.FirstChild("Role"); - if (!roleNode.IsNull()) { - m_role = Aws::Utils::Xml::DecodeEscapedXmlText(roleNode.GetText()); - m_roleHasBeenSet = true; - } - } - - return *this; -} - -void AnnotationTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(AnnotationConfigurationStateMapper::GetNameForAnnotationConfigurationState(m_configurationState)); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } - - if (m_roleHasBeenSet) { - XmlNode roleNode = parentNode.CreateChildElement("Role"); - roleNode.SetText(m_role); - } -} +void AnnotationTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ArchiveStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ArchiveStatus.cpp index 561c9661114..f249adbdbeb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ArchiveStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ArchiveStatus.cpp @@ -30,7 +30,6 @@ ArchiveStatus GetArchiveStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ArchiveStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForArchiveStatus(ArchiveStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BlockedEncryptionTypes.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BlockedEncryptionTypes.cpp index 47a33a0195d..9d47ad501aa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BlockedEncryptionTypes.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BlockedEncryptionTypes.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { BlockedEncryptionTypes::BlockedEncryptionTypes(const XmlNode& xmlNode) { *this = xmlNode; } -BlockedEncryptionTypes& BlockedEncryptionTypes::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode encryptionTypeNode = resultNode.FirstChild("EncryptionType"); - if (!encryptionTypeNode.IsNull()) { - XmlNode encryptionTypeMember = encryptionTypeNode; - m_encryptionTypeHasBeenSet = !encryptionTypeMember.IsNull(); - while (!encryptionTypeMember.IsNull()) { - m_encryptionType.push_back( - EncryptionTypeMapper::GetEncryptionTypeForName(StringUtils::Trim(encryptionTypeMember.GetText().c_str()))); - encryptionTypeMember = encryptionTypeMember.NextNode("EncryptionType"); - } - - m_encryptionTypeHasBeenSet = true; - } - } - - return *this; -} - -void BlockedEncryptionTypes::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_encryptionTypeHasBeenSet) { - XmlNode encryptionTypeParentNode = parentNode.CreateChildElement("EncryptionType"); - for (const auto& item : m_encryptionType) { - XmlNode encryptionTypeNode = encryptionTypeParentNode.CreateChildElement("EncryptionType"); - encryptionTypeNode.SetText(EncryptionTypeMapper::GetNameForEncryptionType(item)); - } - } -} +BlockedEncryptionTypes& BlockedEncryptionTypes::operator=(const XmlNode& xmlNode) { return *this; } + +void BlockedEncryptionTypes::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Bucket.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Bucket.cpp index d93d6f8108f..37a7d393a46 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Bucket.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Bucket.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,58 +20,9 @@ namespace Model { Bucket::Bucket(const XmlNode& xmlNode) { *this = xmlNode; } -Bucket& Bucket::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Bucket& Bucket::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - XmlNode creationDateNode = resultNode.FirstChild("CreationDate"); - if (!creationDateNode.IsNull()) { - m_creationDate = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(creationDateNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_creationDateHasBeenSet = true; - } - XmlNode bucketRegionNode = resultNode.FirstChild("BucketRegion"); - if (!bucketRegionNode.IsNull()) { - m_bucketRegion = Aws::Utils::Xml::DecodeEscapedXmlText(bucketRegionNode.GetText()); - m_bucketRegionHasBeenSet = true; - } - XmlNode bucketArnNode = resultNode.FirstChild("BucketArn"); - if (!bucketArnNode.IsNull()) { - m_bucketArn = Aws::Utils::Xml::DecodeEscapedXmlText(bucketArnNode.GetText()); - m_bucketArnHasBeenSet = true; - } - } - - return *this; -} - -void Bucket::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_nameHasBeenSet) { - XmlNode nameNode = parentNode.CreateChildElement("Name"); - nameNode.SetText(m_name); - } - - if (m_creationDateHasBeenSet) { - XmlNode creationDateNode = parentNode.CreateChildElement("CreationDate"); - creationDateNode.SetText(m_creationDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_bucketRegionHasBeenSet) { - XmlNode bucketRegionNode = parentNode.CreateChildElement("BucketRegion"); - bucketRegionNode.SetText(m_bucketRegion); - } - - if (m_bucketArnHasBeenSet) { - XmlNode bucketArnNode = parentNode.CreateChildElement("BucketArn"); - bucketArnNode.SetText(m_bucketArn); - } -} +void Bucket::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketAbacStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketAbacStatus.cpp index 8a588f7da0c..37915841461 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketAbacStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketAbacStatus.cpp @@ -30,7 +30,6 @@ BucketAbacStatus GetBucketAbacStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketAbacStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForBucketAbacStatus(BucketAbacStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketAccelerateStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketAccelerateStatus.cpp index fcd5f4f0fb4..d0ae0e3d966 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketAccelerateStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketAccelerateStatus.cpp @@ -30,7 +30,6 @@ BucketAccelerateStatus GetBucketAccelerateStatusForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketAccelerateStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForBucketAccelerateStatus(BucketAccelerateStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketCannedACL.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketCannedACL.cpp index 7fd0c554b26..67e74a1953c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketCannedACL.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketCannedACL.cpp @@ -36,7 +36,6 @@ BucketCannedACL GetBucketCannedACLForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketCannedACL::NOT_SET; } @@ -57,7 +56,6 @@ Aws::String GetNameForBucketCannedACL(BucketCannedACL enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketInfo.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketInfo.cpp index b10bbfb6776..20ea7cece0d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketInfo.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketInfo.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { BucketInfo::BucketInfo(const XmlNode& xmlNode) { *this = xmlNode; } -BucketInfo& BucketInfo::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode dataRedundancyNode = resultNode.FirstChild("DataRedundancy"); - if (!dataRedundancyNode.IsNull()) { - m_dataRedundancy = DataRedundancyMapper::GetDataRedundancyForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(dataRedundancyNode.GetText()).c_str())); - m_dataRedundancyHasBeenSet = true; - } - XmlNode typeNode = resultNode.FirstChild("Type"); - if (!typeNode.IsNull()) { - m_type = BucketTypeMapper::GetBucketTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(typeNode.GetText()).c_str())); - m_typeHasBeenSet = true; - } - } - - return *this; -} - -void BucketInfo::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_dataRedundancyHasBeenSet) { - XmlNode dataRedundancyNode = parentNode.CreateChildElement("DataRedundancy"); - dataRedundancyNode.SetText(DataRedundancyMapper::GetNameForDataRedundancy(m_dataRedundancy)); - } - - if (m_typeHasBeenSet) { - XmlNode typeNode = parentNode.CreateChildElement("Type"); - typeNode.SetText(BucketTypeMapper::GetNameForBucketType(m_type)); - } -} +BucketInfo& BucketInfo::operator=(const XmlNode& xmlNode) { return *this; } + +void BucketInfo::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketLifecycleConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketLifecycleConfiguration.cpp index 4b170b9eac1..1cf66991180 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketLifecycleConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketLifecycleConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { BucketLifecycleConfiguration::BucketLifecycleConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -BucketLifecycleConfiguration& BucketLifecycleConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - return *this; -} - -void BucketLifecycleConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_rulesHasBeenSet) { - for (const auto& item : m_rules) { - XmlNode rulesNode = parentNode.CreateChildElement("Rule"); - item.AddToNode(rulesNode); - } - } -} +BucketLifecycleConfiguration& BucketLifecycleConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void BucketLifecycleConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp index ad1f8b69f1f..bae91d10963 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp @@ -144,7 +144,6 @@ BucketLocationConstraint GetBucketLocationConstraintForName(const Aws::String& n overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketLocationConstraint::NOT_SET; } @@ -237,7 +236,6 @@ Aws::String GetNameForBucketLocationConstraint(BucketLocationConstraint enumValu if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketLoggingStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketLoggingStatus.cpp index ac3015463ee..985ce5fba68 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketLoggingStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketLoggingStatus.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { BucketLoggingStatus::BucketLoggingStatus(const XmlNode& xmlNode) { *this = xmlNode; } -BucketLoggingStatus& BucketLoggingStatus::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode loggingEnabledNode = resultNode.FirstChild("LoggingEnabled"); - if (!loggingEnabledNode.IsNull()) { - m_loggingEnabled = loggingEnabledNode; - m_loggingEnabledHasBeenSet = true; - } - } - - return *this; -} - -void BucketLoggingStatus::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_loggingEnabledHasBeenSet) { - XmlNode loggingEnabledNode = parentNode.CreateChildElement("LoggingEnabled"); - m_loggingEnabled.AddToNode(loggingEnabledNode); - } -} +BucketLoggingStatus& BucketLoggingStatus::operator=(const XmlNode& xmlNode) { return *this; } + +void BucketLoggingStatus::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketLogsPermission.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketLogsPermission.cpp index 9de461003d7..b432b08ee52 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketLogsPermission.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketLogsPermission.cpp @@ -33,7 +33,6 @@ BucketLogsPermission GetBucketLogsPermissionForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketLogsPermission::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForBucketLogsPermission(BucketLogsPermission enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketNamespace.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketNamespace.cpp index e6713c286e0..df6b88dc268 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketNamespace.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketNamespace.cpp @@ -30,7 +30,6 @@ BucketNamespace GetBucketNamespaceForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketNamespace::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForBucketNamespace(BucketNamespace enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketType.cpp index 50f87f36128..a1db11bec6e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketType.cpp @@ -27,7 +27,6 @@ BucketType GetBucketTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketType::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForBucketType(BucketType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/BucketVersioningStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/BucketVersioningStatus.cpp index 97a0ba40669..1d1cf2aed8f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/BucketVersioningStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/BucketVersioningStatus.cpp @@ -30,7 +30,6 @@ BucketVersioningStatus GetBucketVersioningStatusForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BucketVersioningStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForBucketVersioningStatus(BucketVersioningStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CORSConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CORSConfiguration.cpp index 0b51a3e7fd0..ef0e87cc596 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CORSConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CORSConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { CORSConfiguration::CORSConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -CORSConfiguration& CORSConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode cORSRulesNode = resultNode.FirstChild("CORSRule"); - if (!cORSRulesNode.IsNull()) { - XmlNode cORSRuleMember = cORSRulesNode; - m_cORSRulesHasBeenSet = !cORSRuleMember.IsNull(); - while (!cORSRuleMember.IsNull()) { - m_cORSRules.push_back(cORSRuleMember); - cORSRuleMember = cORSRuleMember.NextNode("CORSRule"); - } - - m_cORSRulesHasBeenSet = true; - } - } - - return *this; -} - -void CORSConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_cORSRulesHasBeenSet) { - for (const auto& item : m_cORSRules) { - XmlNode cORSRulesNode = parentNode.CreateChildElement("CORSRule"); - item.AddToNode(cORSRulesNode); - } - } -} +CORSConfiguration& CORSConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void CORSConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CORSRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CORSRule.cpp index d907e48f8f4..43277708d33 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CORSRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CORSRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,112 +20,9 @@ namespace Model { CORSRule::CORSRule(const XmlNode& xmlNode) { *this = xmlNode; } -CORSRule& CORSRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CORSRule& CORSRule::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - XmlNode allowedHeadersNode = resultNode.FirstChild("AllowedHeader"); - if (!allowedHeadersNode.IsNull()) { - XmlNode allowedHeaderMember = allowedHeadersNode; - m_allowedHeadersHasBeenSet = !allowedHeaderMember.IsNull(); - while (!allowedHeaderMember.IsNull()) { - m_allowedHeaders.push_back(allowedHeaderMember.GetText()); - allowedHeaderMember = allowedHeaderMember.NextNode("AllowedHeader"); - } - - m_allowedHeadersHasBeenSet = true; - } - XmlNode allowedMethodsNode = resultNode.FirstChild("AllowedMethod"); - if (!allowedMethodsNode.IsNull()) { - XmlNode allowedMethodMember = allowedMethodsNode; - m_allowedMethodsHasBeenSet = !allowedMethodMember.IsNull(); - while (!allowedMethodMember.IsNull()) { - m_allowedMethods.push_back(allowedMethodMember.GetText()); - allowedMethodMember = allowedMethodMember.NextNode("AllowedMethod"); - } - - m_allowedMethodsHasBeenSet = true; - } - XmlNode allowedOriginsNode = resultNode.FirstChild("AllowedOrigin"); - if (!allowedOriginsNode.IsNull()) { - XmlNode allowedOriginMember = allowedOriginsNode; - m_allowedOriginsHasBeenSet = !allowedOriginMember.IsNull(); - while (!allowedOriginMember.IsNull()) { - m_allowedOrigins.push_back(allowedOriginMember.GetText()); - allowedOriginMember = allowedOriginMember.NextNode("AllowedOrigin"); - } - - m_allowedOriginsHasBeenSet = true; - } - XmlNode exposeHeadersNode = resultNode.FirstChild("ExposeHeader"); - if (!exposeHeadersNode.IsNull()) { - XmlNode exposeHeaderMember = exposeHeadersNode; - m_exposeHeadersHasBeenSet = !exposeHeaderMember.IsNull(); - while (!exposeHeaderMember.IsNull()) { - m_exposeHeaders.push_back(exposeHeaderMember.GetText()); - exposeHeaderMember = exposeHeaderMember.NextNode("ExposeHeader"); - } - - m_exposeHeadersHasBeenSet = true; - } - XmlNode maxAgeSecondsNode = resultNode.FirstChild("MaxAgeSeconds"); - if (!maxAgeSecondsNode.IsNull()) { - m_maxAgeSeconds = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxAgeSecondsNode.GetText()).c_str()).c_str()); - m_maxAgeSecondsHasBeenSet = true; - } - } - - return *this; -} - -void CORSRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_allowedHeadersHasBeenSet) { - for (const auto& item : m_allowedHeaders) { - XmlNode allowedHeadersNode = parentNode.CreateChildElement("AllowedHeader"); - allowedHeadersNode.SetText(item); - } - } - - if (m_allowedMethodsHasBeenSet) { - for (const auto& item : m_allowedMethods) { - XmlNode allowedMethodsNode = parentNode.CreateChildElement("AllowedMethod"); - allowedMethodsNode.SetText(item); - } - } - - if (m_allowedOriginsHasBeenSet) { - for (const auto& item : m_allowedOrigins) { - XmlNode allowedOriginsNode = parentNode.CreateChildElement("AllowedOrigin"); - allowedOriginsNode.SetText(item); - } - } - - if (m_exposeHeadersHasBeenSet) { - for (const auto& item : m_exposeHeaders) { - XmlNode exposeHeadersNode = parentNode.CreateChildElement("ExposeHeader"); - exposeHeadersNode.SetText(item); - } - } - - if (m_maxAgeSecondsHasBeenSet) { - XmlNode maxAgeSecondsNode = parentNode.CreateChildElement("MaxAgeSeconds"); - ss << m_maxAgeSeconds; - maxAgeSecondsNode.SetText(ss.str()); - ss.str(""); - } -} +void CORSRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CSVInput.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CSVInput.cpp index 2fe18d98d39..adb2276ffc8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CSVInput.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CSVInput.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,91 +20,9 @@ namespace Model { CSVInput::CSVInput(const XmlNode& xmlNode) { *this = xmlNode; } -CSVInput& CSVInput::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CSVInput& CSVInput::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode fileHeaderInfoNode = resultNode.FirstChild("FileHeaderInfo"); - if (!fileHeaderInfoNode.IsNull()) { - m_fileHeaderInfo = FileHeaderInfoMapper::GetFileHeaderInfoForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(fileHeaderInfoNode.GetText()).c_str())); - m_fileHeaderInfoHasBeenSet = true; - } - XmlNode commentsNode = resultNode.FirstChild("Comments"); - if (!commentsNode.IsNull()) { - m_comments = Aws::Utils::Xml::DecodeEscapedXmlText(commentsNode.GetText()); - m_commentsHasBeenSet = true; - } - XmlNode quoteEscapeCharacterNode = resultNode.FirstChild("QuoteEscapeCharacter"); - if (!quoteEscapeCharacterNode.IsNull()) { - m_quoteEscapeCharacter = Aws::Utils::Xml::DecodeEscapedXmlText(quoteEscapeCharacterNode.GetText()); - m_quoteEscapeCharacterHasBeenSet = true; - } - XmlNode recordDelimiterNode = resultNode.FirstChild("RecordDelimiter"); - if (!recordDelimiterNode.IsNull()) { - m_recordDelimiter = Aws::Utils::Xml::DecodeEscapedXmlText(recordDelimiterNode.GetText()); - m_recordDelimiterHasBeenSet = true; - } - XmlNode fieldDelimiterNode = resultNode.FirstChild("FieldDelimiter"); - if (!fieldDelimiterNode.IsNull()) { - m_fieldDelimiter = Aws::Utils::Xml::DecodeEscapedXmlText(fieldDelimiterNode.GetText()); - m_fieldDelimiterHasBeenSet = true; - } - XmlNode quoteCharacterNode = resultNode.FirstChild("QuoteCharacter"); - if (!quoteCharacterNode.IsNull()) { - m_quoteCharacter = Aws::Utils::Xml::DecodeEscapedXmlText(quoteCharacterNode.GetText()); - m_quoteCharacterHasBeenSet = true; - } - XmlNode allowQuotedRecordDelimiterNode = resultNode.FirstChild("AllowQuotedRecordDelimiter"); - if (!allowQuotedRecordDelimiterNode.IsNull()) { - m_allowQuotedRecordDelimiter = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(allowQuotedRecordDelimiterNode.GetText()).c_str()).c_str()); - m_allowQuotedRecordDelimiterHasBeenSet = true; - } - } - - return *this; -} - -void CSVInput::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_fileHeaderInfoHasBeenSet) { - XmlNode fileHeaderInfoNode = parentNode.CreateChildElement("FileHeaderInfo"); - fileHeaderInfoNode.SetText(FileHeaderInfoMapper::GetNameForFileHeaderInfo(m_fileHeaderInfo)); - } - - if (m_commentsHasBeenSet) { - XmlNode commentsNode = parentNode.CreateChildElement("Comments"); - commentsNode.SetText(m_comments); - } - - if (m_quoteEscapeCharacterHasBeenSet) { - XmlNode quoteEscapeCharacterNode = parentNode.CreateChildElement("QuoteEscapeCharacter"); - quoteEscapeCharacterNode.SetText(m_quoteEscapeCharacter); - } - - if (m_recordDelimiterHasBeenSet) { - XmlNode recordDelimiterNode = parentNode.CreateChildElement("RecordDelimiter"); - recordDelimiterNode.SetText(m_recordDelimiter); - } - - if (m_fieldDelimiterHasBeenSet) { - XmlNode fieldDelimiterNode = parentNode.CreateChildElement("FieldDelimiter"); - fieldDelimiterNode.SetText(m_fieldDelimiter); - } - - if (m_quoteCharacterHasBeenSet) { - XmlNode quoteCharacterNode = parentNode.CreateChildElement("QuoteCharacter"); - quoteCharacterNode.SetText(m_quoteCharacter); - } - - if (m_allowQuotedRecordDelimiterHasBeenSet) { - XmlNode allowQuotedRecordDelimiterNode = parentNode.CreateChildElement("AllowQuotedRecordDelimiter"); - ss << std::boolalpha << m_allowQuotedRecordDelimiter; - allowQuotedRecordDelimiterNode.SetText(ss.str()); - ss.str(""); - } -} +void CSVInput::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CSVOutput.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CSVOutput.cpp index 24952ce388f..0be4ef32bd8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CSVOutput.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CSVOutput.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,68 +20,9 @@ namespace Model { CSVOutput::CSVOutput(const XmlNode& xmlNode) { *this = xmlNode; } -CSVOutput& CSVOutput::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CSVOutput& CSVOutput::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode quoteFieldsNode = resultNode.FirstChild("QuoteFields"); - if (!quoteFieldsNode.IsNull()) { - m_quoteFields = QuoteFieldsMapper::GetQuoteFieldsForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(quoteFieldsNode.GetText()).c_str())); - m_quoteFieldsHasBeenSet = true; - } - XmlNode quoteEscapeCharacterNode = resultNode.FirstChild("QuoteEscapeCharacter"); - if (!quoteEscapeCharacterNode.IsNull()) { - m_quoteEscapeCharacter = Aws::Utils::Xml::DecodeEscapedXmlText(quoteEscapeCharacterNode.GetText()); - m_quoteEscapeCharacterHasBeenSet = true; - } - XmlNode recordDelimiterNode = resultNode.FirstChild("RecordDelimiter"); - if (!recordDelimiterNode.IsNull()) { - m_recordDelimiter = Aws::Utils::Xml::DecodeEscapedXmlText(recordDelimiterNode.GetText()); - m_recordDelimiterHasBeenSet = true; - } - XmlNode fieldDelimiterNode = resultNode.FirstChild("FieldDelimiter"); - if (!fieldDelimiterNode.IsNull()) { - m_fieldDelimiter = Aws::Utils::Xml::DecodeEscapedXmlText(fieldDelimiterNode.GetText()); - m_fieldDelimiterHasBeenSet = true; - } - XmlNode quoteCharacterNode = resultNode.FirstChild("QuoteCharacter"); - if (!quoteCharacterNode.IsNull()) { - m_quoteCharacter = Aws::Utils::Xml::DecodeEscapedXmlText(quoteCharacterNode.GetText()); - m_quoteCharacterHasBeenSet = true; - } - } - - return *this; -} - -void CSVOutput::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_quoteFieldsHasBeenSet) { - XmlNode quoteFieldsNode = parentNode.CreateChildElement("QuoteFields"); - quoteFieldsNode.SetText(QuoteFieldsMapper::GetNameForQuoteFields(m_quoteFields)); - } - - if (m_quoteEscapeCharacterHasBeenSet) { - XmlNode quoteEscapeCharacterNode = parentNode.CreateChildElement("QuoteEscapeCharacter"); - quoteEscapeCharacterNode.SetText(m_quoteEscapeCharacter); - } - - if (m_recordDelimiterHasBeenSet) { - XmlNode recordDelimiterNode = parentNode.CreateChildElement("RecordDelimiter"); - recordDelimiterNode.SetText(m_recordDelimiter); - } - - if (m_fieldDelimiterHasBeenSet) { - XmlNode fieldDelimiterNode = parentNode.CreateChildElement("FieldDelimiter"); - fieldDelimiterNode.SetText(m_fieldDelimiter); - } - - if (m_quoteCharacterHasBeenSet) { - XmlNode quoteCharacterNode = parentNode.CreateChildElement("QuoteCharacter"); - quoteCharacterNode.SetText(m_quoteCharacter); - } -} +void CSVOutput::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Checksum.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Checksum.cpp index c22fe421a41..2cd48442cbc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Checksum.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Checksum.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,128 +20,9 @@ namespace Model { Checksum::Checksum(const XmlNode& xmlNode) { *this = xmlNode; } -Checksum& Checksum::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Checksum& Checksum::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - } - - return *this; -} - -void Checksum::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } - - if (m_checksumTypeHasBeenSet) { - XmlNode checksumTypeNode = parentNode.CreateChildElement("ChecksumType"); - checksumTypeNode.SetText(ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); - } -} +void Checksum::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumAlgorithm.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumAlgorithm.cpp index 23677a203d4..4d705d04d0f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumAlgorithm.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumAlgorithm.cpp @@ -54,7 +54,6 @@ ChecksumAlgorithm GetChecksumAlgorithmForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ChecksumAlgorithm::NOT_SET; } @@ -87,7 +86,6 @@ Aws::String GetNameForChecksumAlgorithm(ChecksumAlgorithm enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumMode.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumMode.cpp index 0cd5c6a6275..b752d649be2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumMode.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumMode.cpp @@ -27,7 +27,6 @@ ChecksumMode GetChecksumModeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ChecksumMode::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForChecksumMode(ChecksumMode enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumType.cpp index 508eb39dead..7600ecad60a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ChecksumType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ChecksumType.cpp @@ -30,7 +30,6 @@ ChecksumType GetChecksumTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ChecksumType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForChecksumType(ChecksumType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CloudFunctionConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CloudFunctionConfiguration.cpp deleted file mode 100644 index 6742a9ac5f7..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/CloudFunctionConfiguration.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -CloudFunctionConfiguration::CloudFunctionConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } - -CloudFunctionConfiguration& CloudFunctionConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode cloudFunctionNode = resultNode.FirstChild("CloudFunction"); - if (!cloudFunctionNode.IsNull()) { - m_cloudFunction = Aws::Utils::Xml::DecodeEscapedXmlText(cloudFunctionNode.GetText()); - m_cloudFunctionHasBeenSet = true; - } - XmlNode invocationRoleNode = resultNode.FirstChild("InvocationRole"); - if (!invocationRoleNode.IsNull()) { - m_invocationRole = Aws::Utils::Xml::DecodeEscapedXmlText(invocationRoleNode.GetText()); - m_invocationRoleHasBeenSet = true; - } - } - - return *this; -} - -void CloudFunctionConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_cloudFunctionHasBeenSet) { - XmlNode cloudFunctionNode = parentNode.CreateChildElement("CloudFunction"); - cloudFunctionNode.SetText(m_cloudFunction); - } - - if (m_invocationRoleHasBeenSet) { - XmlNode invocationRoleNode = parentNode.CreateChildElement("InvocationRole"); - invocationRoleNode.SetText(m_invocationRole); - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CommonPrefix.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CommonPrefix.cpp index 7b50de87351..a1c545efbc4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CommonPrefix.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CommonPrefix.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { CommonPrefix::CommonPrefix(const XmlNode& xmlNode) { *this = xmlNode; } -CommonPrefix& CommonPrefix::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - } - - return *this; -} - -void CommonPrefix::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } -} +CommonPrefix& CommonPrefix::operator=(const XmlNode& xmlNode) { return *this; } + +void CommonPrefix::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp index fcb4e87abf0..7083dcb7df0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,59 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool CompleteMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String CompleteMultipartUploadRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("CompleteMultipartUpload"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_multipartUpload.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void CompleteMultipartUploadRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_uploadIdHasBeenSet) { - ss << m_uploadId; - uri.AddQueryStringParameter("uploadId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String CompleteMultipartUploadRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection CompleteMultipartUploadRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -78,114 +29,130 @@ Aws::Http::HeaderValueCollection CompleteMultipartUploadRequest::GetRequestSpeci headers.emplace("x-amz-checksum-crc32", ss.str()); ss.str(""); } - if (m_checksumCRC32CHasBeenSet) { ss << m_checksumCRC32C; headers.emplace("x-amz-checksum-crc32c", ss.str()); ss.str(""); } - if (m_checksumCRC64NVMEHasBeenSet) { ss << m_checksumCRC64NVME; headers.emplace("x-amz-checksum-crc64nvme", ss.str()); ss.str(""); } - if (m_checksumSHA1HasBeenSet) { ss << m_checksumSHA1; headers.emplace("x-amz-checksum-sha1", ss.str()); ss.str(""); } - if (m_checksumSHA256HasBeenSet) { ss << m_checksumSHA256; headers.emplace("x-amz-checksum-sha256", ss.str()); ss.str(""); } - if (m_checksumSHA512HasBeenSet) { ss << m_checksumSHA512; headers.emplace("x-amz-checksum-sha512", ss.str()); ss.str(""); } - if (m_checksumMD5HasBeenSet) { ss << m_checksumMD5; headers.emplace("x-amz-checksum-md5", ss.str()); ss.str(""); } - if (m_checksumXXHASH64HasBeenSet) { ss << m_checksumXXHASH64; headers.emplace("x-amz-checksum-xxhash64", ss.str()); ss.str(""); } - if (m_checksumXXHASH3HasBeenSet) { ss << m_checksumXXHASH3; headers.emplace("x-amz-checksum-xxhash3", ss.str()); ss.str(""); } - if (m_checksumXXHASH128HasBeenSet) { ss << m_checksumXXHASH128; headers.emplace("x-amz-checksum-xxhash128", ss.str()); ss.str(""); } - if (m_checksumTypeHasBeenSet && m_checksumType != ChecksumType::NOT_SET) { headers.emplace("x-amz-checksum-type", ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); } - if (m_mpuObjectSizeHasBeenSet) { ss << m_mpuObjectSize; headers.emplace("x-amz-mp-object-size", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_ifMatchHasBeenSet) { ss << m_ifMatch; headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_ifNoneMatchHasBeenSet) { ss << m_ifNoneMatch; headers.emplace("if-none-match", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - return headers; } +void CompleteMultipartUploadRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_uploadIdHasBeenSet) { + ss << m_uploadId; + uri.AddQueryStringParameter("uploadId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool CompleteMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + CompleteMultipartUploadRequest::EndpointParameters CompleteMultipartUploadRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp index 7ac369b8aab..bc66348cd1b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,131 +21,5 @@ using namespace Aws; CompleteMultipartUploadResult::CompleteMultipartUploadResult(const Aws::AmazonWebServiceResult& result) { *this = result; } CompleteMultipartUploadResult& CompleteMultipartUploadResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode locationNode = resultNode.FirstChild("Location"); - if (!locationNode.IsNull()) { - m_location = Aws::Utils::Xml::DecodeEscapedXmlText(locationNode.GetText()); - m_locationHasBeenSet = true; - } - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& expirationIter = headers.find("x-amz-expiration"); - if (expirationIter != headers.end()) { - m_expiration = expirationIter->second; - m_expirationHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CompletedMultipartUpload.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CompletedMultipartUpload.cpp index 1d60e198e4b..df7b8c20870 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CompletedMultipartUpload.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CompletedMultipartUpload.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { CompletedMultipartUpload::CompletedMultipartUpload(const XmlNode& xmlNode) { *this = xmlNode; } -CompletedMultipartUpload& CompletedMultipartUpload::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode partsNode = resultNode.FirstChild("Part"); - if (!partsNode.IsNull()) { - XmlNode partMember = partsNode; - m_partsHasBeenSet = !partMember.IsNull(); - while (!partMember.IsNull()) { - m_parts.push_back(partMember); - partMember = partMember.NextNode("Part"); - } - - m_partsHasBeenSet = true; - } - } - - return *this; -} - -void CompletedMultipartUpload::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_partsHasBeenSet) { - for (const auto& item : m_parts) { - XmlNode partsNode = parentNode.CreateChildElement("Part"); - item.AddToNode(partsNode); - } - } -} +CompletedMultipartUpload& CompletedMultipartUpload::operator=(const XmlNode& xmlNode) { return *this; } + +void CompletedMultipartUpload::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CompletedPart.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CompletedPart.cpp index b40510ce7d0..2029f9a3a33 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CompletedPart.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CompletedPart.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,140 +20,9 @@ namespace Model { CompletedPart::CompletedPart(const XmlNode& xmlNode) { *this = xmlNode; } -CompletedPart& CompletedPart::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CompletedPart& CompletedPart::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - XmlNode partNumberNode = resultNode.FirstChild("PartNumber"); - if (!partNumberNode.IsNull()) { - m_partNumber = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partNumberNode.GetText()).c_str()).c_str()); - m_partNumberHasBeenSet = true; - } - } - - return *this; -} - -void CompletedPart::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } - - if (m_partNumberHasBeenSet) { - XmlNode partNumberNode = parentNode.CreateChildElement("PartNumber"); - ss << m_partNumber; - partNumberNode.SetText(ss.str()); - ss.str(""); - } -} +void CompletedPart::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CompressionType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CompressionType.cpp index accbcf9f4e8..60ce58a7749 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CompressionType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CompressionType.cpp @@ -33,7 +33,6 @@ CompressionType GetCompressionTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return CompressionType::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForCompressionType(CompressionType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Condition.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Condition.cpp index 6bb0acebc74..bca667d5aba 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Condition.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Condition.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { Condition::Condition(const XmlNode& xmlNode) { *this = xmlNode; } -Condition& Condition::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode httpErrorCodeReturnedEqualsNode = resultNode.FirstChild("HttpErrorCodeReturnedEquals"); - if (!httpErrorCodeReturnedEqualsNode.IsNull()) { - m_httpErrorCodeReturnedEquals = Aws::Utils::Xml::DecodeEscapedXmlText(httpErrorCodeReturnedEqualsNode.GetText()); - m_httpErrorCodeReturnedEqualsHasBeenSet = true; - } - XmlNode keyPrefixEqualsNode = resultNode.FirstChild("KeyPrefixEquals"); - if (!keyPrefixEqualsNode.IsNull()) { - m_keyPrefixEquals = Aws::Utils::Xml::DecodeEscapedXmlText(keyPrefixEqualsNode.GetText()); - m_keyPrefixEqualsHasBeenSet = true; - } - } - - return *this; -} - -void Condition::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_httpErrorCodeReturnedEqualsHasBeenSet) { - XmlNode httpErrorCodeReturnedEqualsNode = parentNode.CreateChildElement("HttpErrorCodeReturnedEquals"); - httpErrorCodeReturnedEqualsNode.SetText(m_httpErrorCodeReturnedEquals); - } - - if (m_keyPrefixEqualsHasBeenSet) { - XmlNode keyPrefixEqualsNode = parentNode.CreateChildElement("KeyPrefixEquals"); - keyPrefixEqualsNode.SetText(m_keyPrefixEquals); - } -} +Condition& Condition::operator=(const XmlNode& xmlNode) { return *this; } + +void Condition::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectRequest.cpp index 1d2f66ff15d..da679aa59ce 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,149 +19,96 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool CopyObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String CopyObjectRequest::SerializePayload() const { return {}; } -void CopyObjectRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection CopyObjectRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if (m_aCLHasBeenSet && m_aCL != ObjectCannedACL::NOT_SET) { headers.emplace("x-amz-acl", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL)); } - if (m_cacheControlHasBeenSet) { ss << m_cacheControl; headers.emplace("cache-control", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_contentDispositionHasBeenSet) { ss << m_contentDisposition; headers.emplace("content-disposition", ss.str()); ss.str(""); } - if (m_contentEncodingHasBeenSet) { ss << m_contentEncoding; headers.emplace("content-encoding", ss.str()); ss.str(""); } - if (m_contentLanguageHasBeenSet) { ss << m_contentLanguage; headers.emplace("content-language", ss.str()); ss.str(""); } - if (m_contentTypeHasBeenSet) { ss << m_contentType; headers.emplace("content-type", ss.str()); ss.str(""); } - if (m_copySourceHasBeenSet) { ss << m_copySource; headers.emplace("x-amz-copy-source", URI::URLEncodePath(ss.str())); ss.str(""); } - if (m_copySourceIfMatchHasBeenSet) { ss << m_copySourceIfMatch; headers.emplace("x-amz-copy-source-if-match", ss.str()); ss.str(""); } - if (m_copySourceIfModifiedSinceHasBeenSet) { headers.emplace("x-amz-copy-source-if-modified-since", m_copySourceIfModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_copySourceIfNoneMatchHasBeenSet) { ss << m_copySourceIfNoneMatch; headers.emplace("x-amz-copy-source-if-none-match", ss.str()); ss.str(""); } - if (m_copySourceIfUnmodifiedSinceHasBeenSet) { headers.emplace("x-amz-copy-source-if-unmodified-since", m_copySourceIfUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_expiresHasBeenSet) { headers.emplace("expires", m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_ifMatchHasBeenSet) { ss << m_ifMatch; headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_ifNoneMatchHasBeenSet) { ss << m_ifNoneMatch; headers.emplace("if-none-match", ss.str()); ss.str(""); } - if (m_metadataHasBeenSet) { for (const auto& item : m_metadata) { ss << "x-amz-meta-" << item.first; @@ -166,125 +116,132 @@ Aws::Http::HeaderValueCollection CopyObjectRequest::GetRequestSpecificHeaders() ss.str(""); } } - if (m_metadataDirectiveHasBeenSet && m_metadataDirective != MetadataDirective::NOT_SET) { headers.emplace("x-amz-metadata-directive", MetadataDirectiveMapper::GetNameForMetadataDirective(m_metadataDirective)); } - if (m_taggingDirectiveHasBeenSet && m_taggingDirective != TaggingDirective::NOT_SET) { headers.emplace("x-amz-tagging-directive", TaggingDirectiveMapper::GetNameForTaggingDirective(m_taggingDirective)); } - if (m_annotationDirectiveHasBeenSet && m_annotationDirective != AnnotationDirective::NOT_SET) { headers.emplace("x-amz-object-annotation-directive", AnnotationDirectiveMapper::GetNameForAnnotationDirective(m_annotationDirective)); } - if (m_serverSideEncryptionHasBeenSet && m_serverSideEncryption != ServerSideEncryption::NOT_SET) { headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); } - if (m_storageClassHasBeenSet && m_storageClass != StorageClass::NOT_SET) { headers.emplace("x-amz-storage-class", StorageClassMapper::GetNameForStorageClass(m_storageClass)); } - if (m_websiteRedirectLocationHasBeenSet) { ss << m_websiteRedirectLocation; headers.emplace("x-amz-website-redirect-location", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_sSEKMSKeyIdHasBeenSet) { ss << m_sSEKMSKeyId; headers.emplace("x-amz-server-side-encryption-aws-kms-key-id", ss.str()); ss.str(""); } - if (m_sSEKMSEncryptionContextHasBeenSet) { ss << m_sSEKMSEncryptionContext; headers.emplace("x-amz-server-side-encryption-context", ss.str()); ss.str(""); } - if (m_bucketKeyEnabledHasBeenSet) { ss << std::boolalpha << m_bucketKeyEnabled; headers.emplace("x-amz-server-side-encryption-bucket-key-enabled", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerAlgorithmHasBeenSet) { ss << m_copySourceSSECustomerAlgorithm; headers.emplace("x-amz-copy-source-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerKeyHasBeenSet) { ss << m_copySourceSSECustomerKey; headers.emplace("x-amz-copy-source-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerKeyMD5HasBeenSet) { ss << m_copySourceSSECustomerKeyMD5; headers.emplace("x-amz-copy-source-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_taggingHasBeenSet) { ss << m_tagging; headers.emplace("x-amz-tagging", ss.str()); ss.str(""); } - if (m_objectLockModeHasBeenSet && m_objectLockMode != ObjectLockMode::NOT_SET) { headers.emplace("x-amz-object-lock-mode", ObjectLockModeMapper::GetNameForObjectLockMode(m_objectLockMode)); } - if (m_objectLockRetainUntilDateHasBeenSet) { headers.emplace("x-amz-object-lock-retain-until-date", m_objectLockRetainUntilDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } - if (m_objectLockLegalHoldStatusHasBeenSet && m_objectLockLegalHoldStatus != ObjectLockLegalHoldStatus::NOT_SET) { headers.emplace("x-amz-object-lock-legal-hold", ObjectLockLegalHoldStatusMapper::GetNameForObjectLockLegalHoldStatus(m_objectLockLegalHoldStatus)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_expectedSourceBucketOwnerHasBeenSet) { ss << m_expectedSourceBucketOwner; headers.emplace("x-amz-source-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void CopyObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool CopyObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + CopyObjectRequest::EndpointParameters CopyObjectRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResult.cpp index b69f538cd8e..11eaec2f53a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,82 +20,4 @@ using namespace Aws; CopyObjectResult::CopyObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CopyObjectResult& CopyObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_copyObjectResultDetails = resultNode; - m_copyObjectResultDetailsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& expirationIter = headers.find("x-amz-expiration"); - if (expirationIter != headers.end()) { - m_expiration = expirationIter->second; - m_expirationHasBeenSet = true; - } - - const auto& copySourceVersionIdIter = headers.find("x-amz-copy-source-version-id"); - if (copySourceVersionIdIter != headers.end()) { - m_copySourceVersionId = copySourceVersionIdIter->second; - m_copySourceVersionIdHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& sSEKMSEncryptionContextIter = headers.find("x-amz-server-side-encryption-context"); - if (sSEKMSEncryptionContextIter != headers.end()) { - m_sSEKMSEncryptionContext = sSEKMSEncryptionContextIter->second; - m_sSEKMSEncryptionContextHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CopyObjectResult& CopyObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResultDetails.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResultDetails.cpp index f470d75c1c1..757734990f2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResultDetails.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CopyObjectResultDetails.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,149 +20,9 @@ namespace Model { CopyObjectResultDetails::CopyObjectResultDetails(const XmlNode& xmlNode) { *this = xmlNode; } -CopyObjectResultDetails& CopyObjectResultDetails::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CopyObjectResultDetails& CopyObjectResultDetails::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - } - - return *this; -} - -void CopyObjectResultDetails::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_checksumTypeHasBeenSet) { - XmlNode checksumTypeNode = parentNode.CreateChildElement("ChecksumType"); - checksumTypeNode.SetText(ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); - } - - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } -} +void CopyObjectResultDetails::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CopyPartResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CopyPartResult.cpp index 53b83512148..2f4678153d4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CopyPartResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CopyPartResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,138 +20,9 @@ namespace Model { CopyPartResult::CopyPartResult(const XmlNode& xmlNode) { *this = xmlNode; } -CopyPartResult& CopyPartResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CopyPartResult& CopyPartResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - } - - return *this; -} - -void CopyPartResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } -} +void CopyPartResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketConfiguration.cpp index bb6b6248941..2ec64643efb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,67 +20,9 @@ namespace Model { CreateBucketConfiguration::CreateBucketConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -CreateBucketConfiguration& CreateBucketConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +CreateBucketConfiguration& CreateBucketConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode locationConstraintNode = resultNode.FirstChild("LocationConstraint"); - if (!locationConstraintNode.IsNull()) { - m_locationConstraint = BucketLocationConstraintMapper::GetBucketLocationConstraintForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(locationConstraintNode.GetText()).c_str())); - m_locationConstraintHasBeenSet = true; - } - XmlNode locationNode = resultNode.FirstChild("Location"); - if (!locationNode.IsNull()) { - m_location = locationNode; - m_locationHasBeenSet = true; - } - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = bucketNode; - m_bucketHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tags"); - if (!tagsNode.IsNull()) { - XmlNode tagsMember = tagsNode.FirstChild("Tag"); - m_tagsHasBeenSet = !tagsMember.IsNull(); - while (!tagsMember.IsNull()) { - m_tags.push_back(tagsMember); - tagsMember = tagsMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - } - - return *this; -} - -void CreateBucketConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_locationConstraintHasBeenSet) { - XmlNode locationConstraintNode = parentNode.CreateChildElement("LocationConstraint"); - locationConstraintNode.SetText(BucketLocationConstraintMapper::GetNameForBucketLocationConstraint(m_locationConstraint)); - } - - if (m_locationHasBeenSet) { - XmlNode locationNode = parentNode.CreateChildElement("Location"); - m_location.AddToNode(locationNode); - } - - if (m_bucketHasBeenSet) { - XmlNode bucketNode = parentNode.CreateChildElement("Bucket"); - m_bucket.AddToNode(bucketNode); - } - - if (m_tagsHasBeenSet) { - XmlNode tagsParentNode = parentNode.CreateChildElement("Tags"); - for (const auto& item : m_tags) { - XmlNode tagsNode = tagsParentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } -} +void CreateBucketConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataConfigurationRequest.cpp index b62a7407d75..aad38994dd4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,21 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String CreateBucketMetadataConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("MetadataConfiguration"); +Aws::String CreateBucketMetadataConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_metadataConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection CreateBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - return {}; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void CreateBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void CreateBucketMetadataConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -40,35 +50,21 @@ void CreateBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection CreateBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +Aws::String CreateBucketMetadataConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool CreateBucketMetadataConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + CreateBucketMetadataConfigurationRequest::EndpointParameters CreateBucketMetadataConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -80,13 +76,3 @@ CreateBucketMetadataConfigurationRequest::EndpointParameters CreateBucketMetadat } return parameters; } - -Aws::String CreateBucketMetadataConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool CreateBucketMetadataConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataTableConfigurationRequest.cpp index 36aaee7cf42..5ae06406eab 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketMetadataTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,21 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String CreateBucketMetadataTableConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("MetadataTableConfiguration"); +Aws::String CreateBucketMetadataTableConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_metadataTableConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection CreateBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - return {}; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void CreateBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void CreateBucketMetadataTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -40,33 +50,21 @@ void CreateBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection CreateBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +Aws::String CreateBucketMetadataTableConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } +} - return headers; +bool CreateBucketMetadataTableConfigurationRequest::ChecksumAlgorithmIsSet() const { + return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } CreateBucketMetadataTableConfigurationRequest::EndpointParameters CreateBucketMetadataTableConfigurationRequest::GetEndpointContextParams() @@ -81,15 +79,3 @@ CreateBucketMetadataTableConfigurationRequest::EndpointParameters CreateBucketMe } return parameters; } - -Aws::String CreateBucketMetadataTableConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool CreateBucketMetadataTableConfigurationRequest::ChecksumAlgorithmIsSet() const { - return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; -} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp index 32377760d79..dbd38ec54e0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool CreateBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String CreateBucketRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("CreateBucketConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_createBucketConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void CreateBucketRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String CreateBucketRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection CreateBucketRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -70,60 +27,81 @@ Aws::Http::HeaderValueCollection CreateBucketRequest::GetRequestSpecificHeaders( if (m_aCLHasBeenSet && m_aCL != BucketCannedACL::NOT_SET) { headers.emplace("x-amz-acl", BucketCannedACLMapper::GetNameForBucketCannedACL(m_aCL)); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteHasBeenSet) { ss << m_grantWrite; headers.emplace("x-amz-grant-write", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_objectLockEnabledForBucketHasBeenSet) { ss << std::boolalpha << m_objectLockEnabledForBucket; headers.emplace("x-amz-bucket-object-lock-enabled", ss.str()); ss.str(""); } - if (m_objectOwnershipHasBeenSet && m_objectOwnership != ObjectOwnership::NOT_SET) { headers.emplace("x-amz-object-ownership", ObjectOwnershipMapper::GetNameForObjectOwnership(m_objectOwnership)); } - if (m_bucketNamespaceHasBeenSet && m_bucketNamespace != BucketNamespace::NOT_SET) { headers.emplace("x-amz-bucket-namespace", BucketNamespaceMapper::GetNameForBucketNamespace(m_bucketNamespace)); } - return headers; } +void CreateBucketRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool CreateBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + CreateBucketRequest::EndpointParameters CreateBucketRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters - parameters.emplace_back(Aws::String("DisableAccessPoints"), true, Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); + parameters.emplace_back(Aws::String("DisableAccessPoints"), true, Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); // Operation context parameters if (BucketHasBeenSet()) { parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketResult.cpp index b2be81a0505..2b4dbdfd0b3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateBucketResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,32 +20,4 @@ using namespace Aws; CreateBucketResult::CreateBucketResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CreateBucketResult& CreateBucketResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& locationIter = headers.find("location"); - if (locationIter != headers.end()) { - m_location = locationIter->second; - m_locationHasBeenSet = true; - } - - const auto& bucketArnIter = headers.find("x-amz-bucket-arn"); - if (bucketArnIter != headers.end()) { - m_bucketArn = bucketArnIter->second; - m_bucketArnHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CreateBucketResult& CreateBucketResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadRequest.cpp index baa544427fa..5e0e3830cdb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,107 +19,62 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool CreateMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String CreateMultipartUploadRequest::SerializePayload() const { return {}; } -void CreateMultipartUploadRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection CreateMultipartUploadRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if (m_aCLHasBeenSet && m_aCL != ObjectCannedACL::NOT_SET) { headers.emplace("x-amz-acl", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL)); } - if (m_cacheControlHasBeenSet) { ss << m_cacheControl; headers.emplace("cache-control", ss.str()); ss.str(""); } - if (m_contentDispositionHasBeenSet) { ss << m_contentDisposition; headers.emplace("content-disposition", ss.str()); ss.str(""); } - if (m_contentEncodingHasBeenSet) { ss << m_contentEncoding; headers.emplace("content-encoding", ss.str()); ss.str(""); } - if (m_contentLanguageHasBeenSet) { ss << m_contentLanguage; headers.emplace("content-language", ss.str()); ss.str(""); } - if (m_contentTypeHasBeenSet) { ss << m_contentType; headers.emplace("content-type", ss.str()); ss.str(""); } - if (m_expiresHasBeenSet) { headers.emplace("expires", m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_metadataHasBeenSet) { for (const auto& item : m_metadata) { ss << "x-amz-meta-" << item.first; @@ -124,97 +82,109 @@ Aws::Http::HeaderValueCollection CreateMultipartUploadRequest::GetRequestSpecifi ss.str(""); } } - if (m_serverSideEncryptionHasBeenSet && m_serverSideEncryption != ServerSideEncryption::NOT_SET) { headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); } - if (m_storageClassHasBeenSet && m_storageClass != StorageClass::NOT_SET) { headers.emplace("x-amz-storage-class", StorageClassMapper::GetNameForStorageClass(m_storageClass)); } - if (m_websiteRedirectLocationHasBeenSet) { ss << m_websiteRedirectLocation; headers.emplace("x-amz-website-redirect-location", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_sSEKMSKeyIdHasBeenSet) { ss << m_sSEKMSKeyId; headers.emplace("x-amz-server-side-encryption-aws-kms-key-id", ss.str()); ss.str(""); } - if (m_sSEKMSEncryptionContextHasBeenSet) { ss << m_sSEKMSEncryptionContext; headers.emplace("x-amz-server-side-encryption-context", ss.str()); ss.str(""); } - if (m_bucketKeyEnabledHasBeenSet) { ss << std::boolalpha << m_bucketKeyEnabled; headers.emplace("x-amz-server-side-encryption-bucket-key-enabled", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_taggingHasBeenSet) { ss << m_tagging; headers.emplace("x-amz-tagging", ss.str()); ss.str(""); } - if (m_objectLockModeHasBeenSet && m_objectLockMode != ObjectLockMode::NOT_SET) { headers.emplace("x-amz-object-lock-mode", ObjectLockModeMapper::GetNameForObjectLockMode(m_objectLockMode)); } - if (m_objectLockRetainUntilDateHasBeenSet) { headers.emplace("x-amz-object-lock-retain-until-date", m_objectLockRetainUntilDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } - if (m_objectLockLegalHoldStatusHasBeenSet && m_objectLockLegalHoldStatus != ObjectLockLegalHoldStatus::NOT_SET) { headers.emplace("x-amz-object-lock-legal-hold", ObjectLockLegalHoldStatusMapper::GetNameForObjectLockLegalHoldStatus(m_objectLockLegalHoldStatus)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_checksumTypeHasBeenSet && m_checksumType != ChecksumType::NOT_SET) { headers.emplace("x-amz-checksum-type", ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); } - return headers; } +void CreateMultipartUploadRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool CreateMultipartUploadRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + CreateMultipartUploadRequest::EndpointParameters CreateMultipartUploadRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadResult.cpp index 4dce7de614f..20cb7cf648d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateMultipartUploadResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,104 +21,5 @@ using namespace Aws; CreateMultipartUploadResult::CreateMultipartUploadResult(const Aws::AmazonWebServiceResult& result) { *this = result; } CreateMultipartUploadResult& CreateMultipartUploadResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode uploadIdNode = resultNode.FirstChild("UploadId"); - if (!uploadIdNode.IsNull()) { - m_uploadId = Aws::Utils::Xml::DecodeEscapedXmlText(uploadIdNode.GetText()); - m_uploadIdHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& abortDateIter = headers.find("x-amz-abort-date"); - if (abortDateIter != headers.end()) { - m_abortDate = DateTime(abortDateIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_abortDate.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::CreateMultipartUploadResult", - "Failed to parse abortDate header as an RFC822 timestamp: " << abortDateIter->second.c_str()); - } - m_abortDateHasBeenSet = true; - } - - const auto& abortRuleIdIter = headers.find("x-amz-abort-rule-id"); - if (abortRuleIdIter != headers.end()) { - m_abortRuleId = abortRuleIdIter->second; - m_abortRuleIdHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& sSEKMSEncryptionContextIter = headers.find("x-amz-server-side-encryption-context"); - if (sSEKMSEncryptionContextIter != headers.end()) { - m_sSEKMSEncryptionContext = sSEKMSEncryptionContextIter->second; - m_sSEKMSEncryptionContextHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& checksumAlgorithmIter = headers.find("x-amz-checksum-algorithm"); - if (checksumAlgorithmIter != headers.end()) { - m_checksumAlgorithm = ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(checksumAlgorithmIter->second); - m_checksumAlgorithmHasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionRequest.cpp index 92b78706394..8abdcd77426 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,74 +19,65 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool CreateSessionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String CreateSessionRequest::SerializePayload() const { return {}; } -void CreateSessionRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection CreateSessionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if (m_sessionModeHasBeenSet && m_sessionMode != SessionMode::NOT_SET) { headers.emplace("x-amz-create-session-mode", SessionModeMapper::GetNameForSessionMode(m_sessionMode)); } - if (m_serverSideEncryptionHasBeenSet && m_serverSideEncryption != ServerSideEncryption::NOT_SET) { headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); } - if (m_sSEKMSKeyIdHasBeenSet) { ss << m_sSEKMSKeyId; headers.emplace("x-amz-server-side-encryption-aws-kms-key-id", ss.str()); ss.str(""); } - if (m_sSEKMSEncryptionContextHasBeenSet) { ss << m_sSEKMSEncryptionContext; headers.emplace("x-amz-server-side-encryption-context", ss.str()); ss.str(""); } - if (m_bucketKeyEnabledHasBeenSet) { ss << std::boolalpha << m_bucketKeyEnabled; headers.emplace("x-amz-server-side-encryption-bucket-key-enabled", ss.str()); ss.str(""); } - return headers; } +void CreateSessionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool CreateSessionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + CreateSessionRequest::EndpointParameters CreateSessionRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionResult.cpp index 7ab4327d06b..e9f2a373288 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/CreateSessionResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,49 +20,4 @@ using namespace Aws; CreateSessionResult::CreateSessionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CreateSessionResult& CreateSessionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode credentialsNode = resultNode.FirstChild("Credentials"); - if (!credentialsNode.IsNull()) { - m_credentials = credentialsNode; - m_credentialsHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& sSEKMSEncryptionContextIter = headers.find("x-amz-server-side-encryption-context"); - if (sSEKMSEncryptionContextIter != headers.end()) { - m_sSEKMSEncryptionContext = sSEKMSEncryptionContextIter->second; - m_sSEKMSEncryptionContextHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CreateSessionResult& CreateSessionResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DataRedundancy.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DataRedundancy.cpp index 2762178d428..f12da718373 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DataRedundancy.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DataRedundancy.cpp @@ -30,7 +30,6 @@ DataRedundancy GetDataRedundancyForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return DataRedundancy::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForDataRedundancy(DataRedundancy enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DefaultRetention.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DefaultRetention.cpp index f5d03368e67..17136287b23 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DefaultRetention.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DefaultRetention.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,52 +20,9 @@ namespace Model { DefaultRetention::DefaultRetention(const XmlNode& xmlNode) { *this = xmlNode; } -DefaultRetention& DefaultRetention::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +DefaultRetention& DefaultRetention::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode modeNode = resultNode.FirstChild("Mode"); - if (!modeNode.IsNull()) { - m_mode = ObjectLockRetentionModeMapper::GetObjectLockRetentionModeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(modeNode.GetText()).c_str())); - m_modeHasBeenSet = true; - } - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - XmlNode yearsNode = resultNode.FirstChild("Years"); - if (!yearsNode.IsNull()) { - m_years = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(yearsNode.GetText()).c_str()).c_str()); - m_yearsHasBeenSet = true; - } - } - - return *this; -} - -void DefaultRetention::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_modeHasBeenSet) { - XmlNode modeNode = parentNode.CreateChildElement("Mode"); - modeNode.SetText(ObjectLockRetentionModeMapper::GetNameForObjectLockRetentionMode(m_mode)); - } - - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_yearsHasBeenSet) { - XmlNode yearsNode = parentNode.CreateChildElement("Years"); - ss << m_years; - yearsNode.SetText(ss.str()); - ss.str(""); - } -} +void DefaultRetention::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Delete.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Delete.cpp index 82a2511ffe6..5b1668c76fa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Delete.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Delete.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { Delete::Delete(const XmlNode& xmlNode) { *this = xmlNode; } -Delete& Delete::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Delete& Delete::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode objectsNode = resultNode.FirstChild("Object"); - if (!objectsNode.IsNull()) { - XmlNode objectMember = objectsNode; - m_objectsHasBeenSet = !objectMember.IsNull(); - while (!objectMember.IsNull()) { - m_objects.push_back(objectMember); - objectMember = objectMember.NextNode("Object"); - } - - m_objectsHasBeenSet = true; - } - XmlNode quietNode = resultNode.FirstChild("Quiet"); - if (!quietNode.IsNull()) { - m_quiet = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(quietNode.GetText()).c_str()).c_str()); - m_quietHasBeenSet = true; - } - } - - return *this; -} - -void Delete::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_objectsHasBeenSet) { - for (const auto& item : m_objects) { - XmlNode objectsNode = parentNode.CreateChildElement("Object"); - item.AddToNode(objectsNode); - } - } - - if (m_quietHasBeenSet) { - XmlNode quietNode = parentNode.CreateChildElement("Quiet"); - ss << std::boolalpha << m_quiet; - quietNode.SetText(ss.str()); - ss.str(""); - } -} +void Delete::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketAnalyticsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketAnalyticsConfigurationRequest.cpp index 5666b1bbefd..db50c948095 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketAnalyticsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketAnalyticsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,14 +21,24 @@ using namespace Aws::Http; Aws::String DeleteBucketAnalyticsConfigurationRequest::SerializePayload() const { return {}; } -void DeleteBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection DeleteBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void DeleteBucketAnalyticsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -34,25 +47,12 @@ void DeleteBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& ur collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - DeleteBucketAnalyticsConfigurationRequest::EndpointParameters DeleteBucketAnalyticsConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketCorsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketCorsRequest.cpp index e0be78ff6f2..0128ae4d892 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketCorsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketCorsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketCorsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketCorsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketCorsRequest::SerializePayload() const { return {}; } - -void DeleteBucketCorsRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketCorsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketCorsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketCorsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketCorsRequest::EndpointParameters DeleteBucketCorsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketEncryptionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketEncryptionRequest.cpp index cd87310f964..de1a9278b3d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketEncryptionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketEncryptionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketEncryptionRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketEncryptionRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketEncryptionRequest::SerializePayload() const { return {}; } - -void DeleteBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketEncryptionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketEncryptionRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketEncryptionRequest::EndpointParameters DeleteBucketEncryptionRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketIntelligentTieringConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketIntelligentTieringConfigurationRequest.cpp index 27b82d78b6b..3a380ea473b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketIntelligentTieringConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketIntelligentTieringConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,34 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketIntelligentTieringConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketIntelligentTieringConfigurationRequest::SerializePayload() const { return {}; } - -void DeleteBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -52,23 +47,25 @@ void DeleteBucketIntelligentTieringConfigurationRequest::AddQueryStringParameter collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketIntelligentTieringConfigurationRequest::EndpointParameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketInventoryConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketInventoryConfigurationRequest.cpp index 8a94284e674..5258dbd0c2c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketInventoryConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketInventoryConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,34 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketInventoryConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketInventoryConfigurationRequest::SerializePayload() const { return {}; } - -void DeleteBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketInventoryConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -52,23 +47,25 @@ void DeleteBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& ur collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketInventoryConfigurationRequest::EndpointParameters DeleteBucketInventoryConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketLifecycleRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketLifecycleRequest.cpp index dc06a8467a0..61670d8252b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketLifecycleRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketLifecycleRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketLifecycleRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketLifecycleRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketLifecycleRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketLifecycleRequest::SerializePayload() const { return {}; } - -void DeleteBucketLifecycleRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketLifecycleRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketLifecycleRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketLifecycleRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketLifecycleRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketLifecycleRequest::EndpointParameters DeleteBucketLifecycleRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataConfigurationRequest.cpp index 5783a3be4f1..381b3de00b5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,18 @@ using namespace Aws::Http; Aws::String DeleteBucketMetadataConfigurationRequest::SerializePayload() const { return {}; } -void DeleteBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection DeleteBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void DeleteBucketMetadataConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,25 +42,12 @@ void DeleteBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - DeleteBucketMetadataConfigurationRequest::EndpointParameters DeleteBucketMetadataConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataTableConfigurationRequest.cpp index bc9534094c3..0796e05812d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetadataTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,18 @@ using namespace Aws::Http; Aws::String DeleteBucketMetadataTableConfigurationRequest::SerializePayload() const { return {}; } -void DeleteBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection DeleteBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void DeleteBucketMetadataTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,25 +42,12 @@ void DeleteBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - DeleteBucketMetadataTableConfigurationRequest::EndpointParameters DeleteBucketMetadataTableConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetricsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetricsConfigurationRequest.cpp index 3f01f395466..fa69b1ab928 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetricsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketMetricsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketMetricsConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketMetricsConfigurationRequest::SerializePayload() const { return {}; } - -void DeleteBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketMetricsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void DeleteBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketMetricsConfigurationRequest::EndpointParameters DeleteBucketMetricsConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketOwnershipControlsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketOwnershipControlsRequest.cpp index b3bccc6778d..023a81a5846 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketOwnershipControlsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketOwnershipControlsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketOwnershipControlsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketOwnershipControlsRequest::SerializePayload() const { return {}; } - -void DeleteBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketOwnershipControlsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) co collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketOwnershipControlsRequest::EndpointParameters DeleteBucketOwnershipControlsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketPolicyRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketPolicyRequest.cpp index 1cdb1d9fbeb..822bcf50471 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketPolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketPolicyRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketPolicyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketPolicyRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketPolicyRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketPolicyRequest::SerializePayload() const { return {}; } - -void DeleteBucketPolicyRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketPolicyRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketPolicyRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketPolicyRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketPolicyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketPolicyRequest::EndpointParameters DeleteBucketPolicyRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketReplicationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketReplicationRequest.cpp index fe73ce2c264..6fe75e32202 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketReplicationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketReplicationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketReplicationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketReplicationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketReplicationRequest::SerializePayload() const { return {}; } - -void DeleteBucketReplicationRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketReplicationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketReplicationRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketReplicationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketReplicationRequest::EndpointParameters DeleteBucketReplicationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketRequest.cpp index ad5c71c8bc5..630f045f000 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketRequest::SerializePayload() const { return {}; } - -void DeleteBucketRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketRequest::EndpointParameters DeleteBucketRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketTaggingRequest.cpp index a7813fda1cd..a67cf49cc5e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketTaggingRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketTaggingRequest::SerializePayload() const { return {}; } - -void DeleteBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketTaggingRequest::EndpointParameters DeleteBucketTaggingRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketWebsiteRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketWebsiteRequest.cpp index 9bd8525f75c..6bba1f14e7f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketWebsiteRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteBucketWebsiteRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteBucketWebsiteRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteBucketWebsiteRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteBucketWebsiteRequest::SerializePayload() const { return {}; } - -void DeleteBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { +void DeleteBucketWebsiteRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeleteBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteBucketWebsiteRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteBucketWebsiteRequest::EndpointParameters DeleteBucketWebsiteRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerEntry.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerEntry.cpp index 501189c1fb4..99163e1ee0f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerEntry.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerEntry.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,71 +20,9 @@ namespace Model { DeleteMarkerEntry::DeleteMarkerEntry(const XmlNode& xmlNode) { *this = xmlNode; } -DeleteMarkerEntry& DeleteMarkerEntry::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +DeleteMarkerEntry& DeleteMarkerEntry::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode versionIdNode = resultNode.FirstChild("VersionId"); - if (!versionIdNode.IsNull()) { - m_versionId = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdNode.GetText()); - m_versionIdHasBeenSet = true; - } - XmlNode isLatestNode = resultNode.FirstChild("IsLatest"); - if (!isLatestNode.IsNull()) { - m_isLatest = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isLatestNode.GetText()).c_str()).c_str()); - m_isLatestHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - } - - return *this; -} - -void DeleteMarkerEntry::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - m_owner.AddToNode(ownerNode); - } - - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_versionIdHasBeenSet) { - XmlNode versionIdNode = parentNode.CreateChildElement("VersionId"); - versionIdNode.SetText(m_versionId); - } - - if (m_isLatestHasBeenSet) { - XmlNode isLatestNode = parentNode.CreateChildElement("IsLatest"); - ss << std::boolalpha << m_isLatest; - isLatestNode.SetText(ss.str()); - ss.str(""); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } -} +void DeleteMarkerEntry::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplication.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplication.cpp index 5d8712ef568..7d01c5a2619 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplication.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplication.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { DeleteMarkerReplication::DeleteMarkerReplication(const XmlNode& xmlNode) { *this = xmlNode; } -DeleteMarkerReplication& DeleteMarkerReplication::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = DeleteMarkerReplicationStatusMapper::GetDeleteMarkerReplicationStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void DeleteMarkerReplication::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(DeleteMarkerReplicationStatusMapper::GetNameForDeleteMarkerReplicationStatus(m_status)); - } -} +DeleteMarkerReplication& DeleteMarkerReplication::operator=(const XmlNode& xmlNode) { return *this; } + +void DeleteMarkerReplication::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplicationStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplicationStatus.cpp index c2fe30c88e9..f94864a2c26 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplicationStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteMarkerReplicationStatus.cpp @@ -30,7 +30,6 @@ DeleteMarkerReplicationStatus GetDeleteMarkerReplicationStatusForName(const Aws: overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return DeleteMarkerReplicationStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForDeleteMarkerReplicationStatus(DeleteMarkerReplicationStatu if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationRequest.cpp index b8857283c7d..5e548ec1979 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,20 +21,37 @@ using namespace Aws::Http; Aws::String DeleteObjectAnnotationRequest::SerializePayload() const { return {}; } -void DeleteObjectAnnotationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection DeleteObjectAnnotationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + if (m_objectIfMatchHasBeenSet) { + ss << m_objectIfMatch; + headers.emplace("x-amz-object-if-match", ss.str()); + ss.str(""); + } + return headers; +} + +void DeleteObjectAnnotationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_annotationNameHasBeenSet) { ss << m_annotationName; uri.AddQueryStringParameter("annotationName", ss.str()); ss.str(""); } - if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -40,35 +60,12 @@ void DeleteObjectAnnotationRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteObjectAnnotationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - if (m_objectIfMatchHasBeenSet) { - ss << m_objectIfMatch; - headers.emplace("x-amz-object-if-match", ss.str()); - ss.str(""); - } - - return headers; -} - DeleteObjectAnnotationRequest::EndpointParameters DeleteObjectAnnotationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationResult.cpp index 0e04355c6ce..2fc2cf265a5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectAnnotationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,31 +21,5 @@ using namespace Aws; DeleteObjectAnnotationResult::DeleteObjectAnnotationResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DeleteObjectAnnotationResult& DeleteObjectAnnotationResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& objectVersionIdIter = headers.find("x-amz-object-version-id"); - if (objectVersionIdIter != headers.end()) { - m_objectVersionId = objectVersionIdIter->second; - m_objectVersionIdHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectRequest.cpp index 2eab691f749..60c012595bc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,48 +19,8 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String DeleteObjectRequest::SerializePayload() const { return {}; } -void DeleteObjectRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection DeleteObjectRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -66,42 +29,70 @@ Aws::Http::HeaderValueCollection DeleteObjectRequest::GetRequestSpecificHeaders( headers.emplace("x-amz-mfa", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_bypassGovernanceRetentionHasBeenSet) { ss << std::boolalpha << m_bypassGovernanceRetention; headers.emplace("x-amz-bypass-governance-retention", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_ifMatchHasBeenSet) { ss << m_ifMatch; headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_ifMatchLastModifiedTimeHasBeenSet) { headers.emplace("x-amz-if-match-last-modified-time", m_ifMatchLastModifiedTime.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_ifMatchSizeHasBeenSet) { ss << m_ifMatchSize; headers.emplace("x-amz-if-match-size", ss.str()); ss.str(""); } - return headers; } +void DeleteObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool DeleteObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + DeleteObjectRequest::EndpointParameters DeleteObjectRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectResult.cpp index 12f23ccda94..f44f6e132ea 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,38 +20,4 @@ using namespace Aws; DeleteObjectResult::DeleteObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteObjectResult& DeleteObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& deleteMarkerIter = headers.find("x-amz-delete-marker"); - if (deleteMarkerIter != headers.end()) { - m_deleteMarker = StringUtils::ConvertToBool(deleteMarkerIter->second.c_str()); - m_deleteMarkerHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteObjectResult& DeleteObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingRequest.cpp index 7a0f973daae..22e281ea411 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeleteObjectTaggingRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeleteObjectTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeleteObjectTaggingRequest::SerializePayload() const { return {}; } - -void DeleteObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { +void DeleteObjectTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void DeleteObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeleteObjectTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeleteObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeleteObjectTaggingRequest::EndpointParameters DeleteObjectTaggingRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingResult.cpp index 429323a7c56..4a0ba7aa4bb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectTaggingResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; DeleteObjectTaggingResult::DeleteObjectTaggingResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteObjectTaggingResult& DeleteObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteObjectTaggingResult& DeleteObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsRequest.cpp index 20a6b69f4aa..27c73304542 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeleteObjectsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String DeleteObjectsRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("Delete"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_delete.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void DeleteObjectsRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String DeleteObjectsRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection DeleteObjectsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -72,39 +29,54 @@ Aws::Http::HeaderValueCollection DeleteObjectsRequest::GetRequestSpecificHeaders headers.emplace("x-amz-mfa", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_bypassGovernanceRetentionHasBeenSet) { ss << std::boolalpha << m_bypassGovernanceRetention; headers.emplace("x-amz-bypass-governance-retention", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return headers; } -DeleteObjectsRequest::EndpointParameters DeleteObjectsRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void DeleteObjectsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool DeleteObjectsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String DeleteObjectsRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -114,3 +86,12 @@ Aws::String DeleteObjectsRequest::GetChecksumAlgorithmName() const { } bool DeleteObjectsRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +DeleteObjectsRequest::EndpointParameters DeleteObjectsRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsResult.cpp index c86ff40db38..ef198dffb93 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeleteObjectsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,48 +20,4 @@ using namespace Aws; DeleteObjectsResult::DeleteObjectsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteObjectsResult& DeleteObjectsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode deletedNode = resultNode.FirstChild("Deleted"); - if (!deletedNode.IsNull()) { - XmlNode deletedMember = deletedNode; - m_deletedHasBeenSet = !deletedMember.IsNull(); - while (!deletedMember.IsNull()) { - m_deleted.push_back(deletedMember); - deletedMember = deletedMember.NextNode("Deleted"); - } - - m_deletedHasBeenSet = true; - } - XmlNode errorsNode = resultNode.FirstChild("Error"); - if (!errorsNode.IsNull()) { - XmlNode errorMember = errorsNode; - m_errorsHasBeenSet = !errorMember.IsNull(); - while (!errorMember.IsNull()) { - m_errors.push_back(errorMember); - errorMember = errorMember.NextNode("Error"); - } - - m_errorsHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteObjectsResult& DeleteObjectsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeletePublicAccessBlockRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeletePublicAccessBlockRequest.cpp index 68e5406feea..9a7535f840b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeletePublicAccessBlockRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeletePublicAccessBlockRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool DeletePublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String DeletePublicAccessBlockRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection DeletePublicAccessBlockRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String DeletePublicAccessBlockRequest::SerializePayload() const { return {}; } - -void DeletePublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { +void DeletePublicAccessBlockRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void DeletePublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection DeletePublicAccessBlockRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool DeletePublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } DeletePublicAccessBlockRequest::EndpointParameters DeletePublicAccessBlockRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DeletedObject.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DeletedObject.cpp index 3c6635a4ab5..4aa25634793 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DeletedObject.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DeletedObject.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,60 +20,9 @@ namespace Model { DeletedObject::DeletedObject(const XmlNode& xmlNode) { *this = xmlNode; } -DeletedObject& DeletedObject::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +DeletedObject& DeletedObject::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode versionIdNode = resultNode.FirstChild("VersionId"); - if (!versionIdNode.IsNull()) { - m_versionId = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdNode.GetText()); - m_versionIdHasBeenSet = true; - } - XmlNode deleteMarkerNode = resultNode.FirstChild("DeleteMarker"); - if (!deleteMarkerNode.IsNull()) { - m_deleteMarker = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(deleteMarkerNode.GetText()).c_str()).c_str()); - m_deleteMarkerHasBeenSet = true; - } - XmlNode deleteMarkerVersionIdNode = resultNode.FirstChild("DeleteMarkerVersionId"); - if (!deleteMarkerVersionIdNode.IsNull()) { - m_deleteMarkerVersionId = Aws::Utils::Xml::DecodeEscapedXmlText(deleteMarkerVersionIdNode.GetText()); - m_deleteMarkerVersionIdHasBeenSet = true; - } - } - - return *this; -} - -void DeletedObject::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_versionIdHasBeenSet) { - XmlNode versionIdNode = parentNode.CreateChildElement("VersionId"); - versionIdNode.SetText(m_versionId); - } - - if (m_deleteMarkerHasBeenSet) { - XmlNode deleteMarkerNode = parentNode.CreateChildElement("DeleteMarker"); - ss << std::boolalpha << m_deleteMarker; - deleteMarkerNode.SetText(ss.str()); - ss.str(""); - } - - if (m_deleteMarkerVersionIdHasBeenSet) { - XmlNode deleteMarkerVersionIdNode = parentNode.CreateChildElement("DeleteMarkerVersionId"); - deleteMarkerVersionIdNode.SetText(m_deleteMarkerVersionId); - } -} +void DeletedObject::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Destination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Destination.cpp index a578e7374fa..f5020c5a8cd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Destination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Destination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,88 +20,9 @@ namespace Model { Destination::Destination(const XmlNode& xmlNode) { *this = xmlNode; } -Destination& Destination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Destination& Destination::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode accountNode = resultNode.FirstChild("Account"); - if (!accountNode.IsNull()) { - m_account = Aws::Utils::Xml::DecodeEscapedXmlText(accountNode.GetText()); - m_accountHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode accessControlTranslationNode = resultNode.FirstChild("AccessControlTranslation"); - if (!accessControlTranslationNode.IsNull()) { - m_accessControlTranslation = accessControlTranslationNode; - m_accessControlTranslationHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - XmlNode replicationTimeNode = resultNode.FirstChild("ReplicationTime"); - if (!replicationTimeNode.IsNull()) { - m_replicationTime = replicationTimeNode; - m_replicationTimeHasBeenSet = true; - } - XmlNode metricsNode = resultNode.FirstChild("Metrics"); - if (!metricsNode.IsNull()) { - m_metrics = metricsNode; - m_metricsHasBeenSet = true; - } - } - - return *this; -} - -void Destination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_bucketHasBeenSet) { - XmlNode bucketNode = parentNode.CreateChildElement("Bucket"); - bucketNode.SetText(m_bucket); - } - - if (m_accountHasBeenSet) { - XmlNode accountNode = parentNode.CreateChildElement("Account"); - accountNode.SetText(m_account); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(StorageClassMapper::GetNameForStorageClass(m_storageClass)); - } - - if (m_accessControlTranslationHasBeenSet) { - XmlNode accessControlTranslationNode = parentNode.CreateChildElement("AccessControlTranslation"); - m_accessControlTranslation.AddToNode(accessControlTranslationNode); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } - - if (m_replicationTimeHasBeenSet) { - XmlNode replicationTimeNode = parentNode.CreateChildElement("ReplicationTime"); - m_replicationTime.AddToNode(replicationTimeNode); - } - - if (m_metricsHasBeenSet) { - XmlNode metricsNode = parentNode.CreateChildElement("Metrics"); - m_metrics.AddToNode(metricsNode); - } -} +void Destination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/DestinationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/DestinationResult.cpp index f53179823c0..907a4f0ad0b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/DestinationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/DestinationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,48 +20,9 @@ namespace Model { DestinationResult::DestinationResult(const XmlNode& xmlNode) { *this = xmlNode; } -DestinationResult& DestinationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +DestinationResult& DestinationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode tableBucketTypeNode = resultNode.FirstChild("TableBucketType"); - if (!tableBucketTypeNode.IsNull()) { - m_tableBucketType = S3TablesBucketTypeMapper::GetS3TablesBucketTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(tableBucketTypeNode.GetText()).c_str())); - m_tableBucketTypeHasBeenSet = true; - } - XmlNode tableBucketArnNode = resultNode.FirstChild("TableBucketArn"); - if (!tableBucketArnNode.IsNull()) { - m_tableBucketArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableBucketArnNode.GetText()); - m_tableBucketArnHasBeenSet = true; - } - XmlNode tableNamespaceNode = resultNode.FirstChild("TableNamespace"); - if (!tableNamespaceNode.IsNull()) { - m_tableNamespace = Aws::Utils::Xml::DecodeEscapedXmlText(tableNamespaceNode.GetText()); - m_tableNamespaceHasBeenSet = true; - } - } - - return *this; -} - -void DestinationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tableBucketTypeHasBeenSet) { - XmlNode tableBucketTypeNode = parentNode.CreateChildElement("TableBucketType"); - tableBucketTypeNode.SetText(S3TablesBucketTypeMapper::GetNameForS3TablesBucketType(m_tableBucketType)); - } - - if (m_tableBucketArnHasBeenSet) { - XmlNode tableBucketArnNode = parentNode.CreateChildElement("TableBucketArn"); - tableBucketArnNode.SetText(m_tableBucketArn); - } - - if (m_tableNamespaceHasBeenSet) { - XmlNode tableNamespaceNode = parentNode.CreateChildElement("TableNamespace"); - tableNamespaceNode.SetText(m_tableNamespace); - } -} +void DestinationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/EncodingType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/EncodingType.cpp index f3669fe36e8..3d069d544ea 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/EncodingType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/EncodingType.cpp @@ -27,7 +27,6 @@ EncodingType GetEncodingTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return EncodingType::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForEncodingType(EncodingType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Encryption.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Encryption.cpp index 2cbb70900ab..aeb066e0c08 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Encryption.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Encryption.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,48 +20,9 @@ namespace Model { Encryption::Encryption(const XmlNode& xmlNode) { *this = xmlNode; } -Encryption& Encryption::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Encryption& Encryption::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode encryptionTypeNode = resultNode.FirstChild("EncryptionType"); - if (!encryptionTypeNode.IsNull()) { - m_encryptionType = ServerSideEncryptionMapper::GetServerSideEncryptionForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encryptionTypeNode.GetText()).c_str())); - m_encryptionTypeHasBeenSet = true; - } - XmlNode kMSKeyIdNode = resultNode.FirstChild("KMSKeyId"); - if (!kMSKeyIdNode.IsNull()) { - m_kMSKeyId = Aws::Utils::Xml::DecodeEscapedXmlText(kMSKeyIdNode.GetText()); - m_kMSKeyIdHasBeenSet = true; - } - XmlNode kMSContextNode = resultNode.FirstChild("KMSContext"); - if (!kMSContextNode.IsNull()) { - m_kMSContext = Aws::Utils::Xml::DecodeEscapedXmlText(kMSContextNode.GetText()); - m_kMSContextHasBeenSet = true; - } - } - - return *this; -} - -void Encryption::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_encryptionTypeHasBeenSet) { - XmlNode encryptionTypeNode = parentNode.CreateChildElement("EncryptionType"); - encryptionTypeNode.SetText(ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_encryptionType)); - } - - if (m_kMSKeyIdHasBeenSet) { - XmlNode kMSKeyIdNode = parentNode.CreateChildElement("KMSKeyId"); - kMSKeyIdNode.SetText(m_kMSKeyId); - } - - if (m_kMSContextHasBeenSet) { - XmlNode kMSContextNode = parentNode.CreateChildElement("KMSContext"); - kMSContextNode.SetText(m_kMSContext); - } -} +void Encryption::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/EncryptionConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/EncryptionConfiguration.cpp index 826d1919dcd..a5b08f5a5f0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/EncryptionConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/EncryptionConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { EncryptionConfiguration::EncryptionConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -EncryptionConfiguration& EncryptionConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode replicaKmsKeyIDNode = resultNode.FirstChild("ReplicaKmsKeyID"); - if (!replicaKmsKeyIDNode.IsNull()) { - m_replicaKmsKeyID = Aws::Utils::Xml::DecodeEscapedXmlText(replicaKmsKeyIDNode.GetText()); - m_replicaKmsKeyIDHasBeenSet = true; - } - } - - return *this; -} - -void EncryptionConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_replicaKmsKeyIDHasBeenSet) { - XmlNode replicaKmsKeyIDNode = parentNode.CreateChildElement("ReplicaKmsKeyID"); - replicaKmsKeyIDNode.SetText(m_replicaKmsKeyID); - } -} +EncryptionConfiguration& EncryptionConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void EncryptionConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/EncryptionType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/EncryptionType.cpp index 88396fbd798..f21a816df2f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/EncryptionType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/EncryptionType.cpp @@ -30,7 +30,6 @@ EncryptionType GetEncryptionTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return EncryptionType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForEncryptionType(EncryptionType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Error.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Error.cpp index 60e10cb0ff3..237da2320ec 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Error.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Error.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,57 +20,9 @@ namespace Model { Error::Error(const XmlNode& xmlNode) { *this = xmlNode; } -Error& Error::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Error& Error::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode versionIdNode = resultNode.FirstChild("VersionId"); - if (!versionIdNode.IsNull()) { - m_versionId = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdNode.GetText()); - m_versionIdHasBeenSet = true; - } - XmlNode codeNode = resultNode.FirstChild("Code"); - if (!codeNode.IsNull()) { - m_code = Aws::Utils::Xml::DecodeEscapedXmlText(codeNode.GetText()); - m_codeHasBeenSet = true; - } - XmlNode messageNode = resultNode.FirstChild("Message"); - if (!messageNode.IsNull()) { - m_message = Aws::Utils::Xml::DecodeEscapedXmlText(messageNode.GetText()); - m_messageHasBeenSet = true; - } - } - - return *this; -} - -void Error::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_versionIdHasBeenSet) { - XmlNode versionIdNode = parentNode.CreateChildElement("VersionId"); - versionIdNode.SetText(m_versionId); - } - - if (m_codeHasBeenSet) { - XmlNode codeNode = parentNode.CreateChildElement("Code"); - codeNode.SetText(m_code); - } - - if (m_messageHasBeenSet) { - XmlNode messageNode = parentNode.CreateChildElement("Message"); - messageNode.SetText(m_message); - } -} +void Error::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ErrorDetails.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ErrorDetails.cpp index 57191503a02..e86f5d8bace 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ErrorDetails.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ErrorDetails.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { ErrorDetails::ErrorDetails(const XmlNode& xmlNode) { *this = xmlNode; } -ErrorDetails& ErrorDetails::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode errorCodeNode = resultNode.FirstChild("ErrorCode"); - if (!errorCodeNode.IsNull()) { - m_errorCode = Aws::Utils::Xml::DecodeEscapedXmlText(errorCodeNode.GetText()); - m_errorCodeHasBeenSet = true; - } - XmlNode errorMessageNode = resultNode.FirstChild("ErrorMessage"); - if (!errorMessageNode.IsNull()) { - m_errorMessage = Aws::Utils::Xml::DecodeEscapedXmlText(errorMessageNode.GetText()); - m_errorMessageHasBeenSet = true; - } - } - - return *this; -} - -void ErrorDetails::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_errorCodeHasBeenSet) { - XmlNode errorCodeNode = parentNode.CreateChildElement("ErrorCode"); - errorCodeNode.SetText(m_errorCode); - } - - if (m_errorMessageHasBeenSet) { - XmlNode errorMessageNode = parentNode.CreateChildElement("ErrorMessage"); - errorMessageNode.SetText(m_errorMessage); - } -} +ErrorDetails& ErrorDetails::operator=(const XmlNode& xmlNode) { return *this; } + +void ErrorDetails::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ErrorDocument.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ErrorDocument.cpp index ebf1fc736b5..63c765b0f5d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ErrorDocument.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ErrorDocument.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { ErrorDocument::ErrorDocument(const XmlNode& xmlNode) { *this = xmlNode; } -ErrorDocument& ErrorDocument::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - } - - return *this; -} - -void ErrorDocument::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } -} +ErrorDocument& ErrorDocument::operator=(const XmlNode& xmlNode) { return *this; } + +void ErrorDocument::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Event.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Event.cpp index c4607b2c540..81deb979dad 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Event.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Event.cpp @@ -115,7 +115,6 @@ Event GetEventForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Event::NOT_SET; } @@ -188,7 +187,6 @@ Aws::String GetNameForEvent(Event enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/EventBridgeConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/EventBridgeConfiguration.cpp index 0ea3654e393..b9c1d4d49cd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/EventBridgeConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/EventBridgeConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,19 +20,9 @@ namespace Model { EventBridgeConfiguration::EventBridgeConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -EventBridgeConfiguration& EventBridgeConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +EventBridgeConfiguration& EventBridgeConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - } - - return *this; -} - -void EventBridgeConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - AWS_UNREFERENCED_PARAM(parentNode); -} +void EventBridgeConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplication.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplication.cpp index 808d44903fd..43790c67bf4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplication.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplication.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { ExistingObjectReplication::ExistingObjectReplication(const XmlNode& xmlNode) { *this = xmlNode; } -ExistingObjectReplication& ExistingObjectReplication::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ExistingObjectReplicationStatusMapper::GetExistingObjectReplicationStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void ExistingObjectReplication::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ExistingObjectReplicationStatusMapper::GetNameForExistingObjectReplicationStatus(m_status)); - } -} +ExistingObjectReplication& ExistingObjectReplication::operator=(const XmlNode& xmlNode) { return *this; } + +void ExistingObjectReplication::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplicationStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplicationStatus.cpp index f585c06895d..64dfd3d2438 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplicationStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ExistingObjectReplicationStatus.cpp @@ -30,7 +30,6 @@ ExistingObjectReplicationStatus GetExistingObjectReplicationStatusForName(const overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExistingObjectReplicationStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExistingObjectReplicationStatus(ExistingObjectReplicationS if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ExpirationState.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ExpirationState.cpp index 14a2451f294..ed088cda0cb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ExpirationState.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ExpirationState.cpp @@ -30,7 +30,6 @@ ExpirationState GetExpirationStateForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExpirationState::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExpirationState(ExpirationState enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ExpirationStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ExpirationStatus.cpp index 426a0ab8e71..943e9567954 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ExpirationStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ExpirationStatus.cpp @@ -30,7 +30,6 @@ ExpirationStatus GetExpirationStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExpirationStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExpirationStatus(ExpirationStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ExpressionType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ExpressionType.cpp index 221159cf0e0..78411373895 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ExpressionType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ExpressionType.cpp @@ -27,7 +27,6 @@ ExpressionType GetExpressionTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExpressionType::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForExpressionType(ExpressionType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/FileHeaderInfo.cpp b/generated/src/aws-cpp-sdk-s3/source/model/FileHeaderInfo.cpp index f698894dca0..8871424e4bf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/FileHeaderInfo.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/FileHeaderInfo.cpp @@ -33,7 +33,6 @@ FileHeaderInfo GetFileHeaderInfoForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return FileHeaderInfo::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForFileHeaderInfo(FileHeaderInfo enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/FilterRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/FilterRule.cpp index 36ffa93d599..bd63d1982e1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/FilterRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/FilterRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { FilterRule::FilterRule(const XmlNode& xmlNode) { *this = xmlNode; } -FilterRule& FilterRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = FilterRuleNameMapper::GetFilterRuleNameForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()).c_str())); - m_nameHasBeenSet = true; - } - XmlNode valueNode = resultNode.FirstChild("Value"); - if (!valueNode.IsNull()) { - m_value = Aws::Utils::Xml::DecodeEscapedXmlText(valueNode.GetText()); - m_valueHasBeenSet = true; - } - } - - return *this; -} - -void FilterRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_nameHasBeenSet) { - XmlNode nameNode = parentNode.CreateChildElement("Name"); - nameNode.SetText(FilterRuleNameMapper::GetNameForFilterRuleName(m_name)); - } - - if (m_valueHasBeenSet) { - XmlNode valueNode = parentNode.CreateChildElement("Value"); - valueNode.SetText(m_value); - } -} +FilterRule& FilterRule::operator=(const XmlNode& xmlNode) { return *this; } + +void FilterRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/FilterRuleName.cpp b/generated/src/aws-cpp-sdk-s3/source/model/FilterRuleName.cpp index e058719dddd..f7819d9de9e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/FilterRuleName.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/FilterRuleName.cpp @@ -30,7 +30,6 @@ FilterRuleName GetFilterRuleNameForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return FilterRuleName::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForFilterRuleName(FilterRuleName enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacRequest.cpp index d6190bca8d6..2aa20ef4cc8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,18 @@ using namespace Aws::Http; Aws::String GetBucketAbacRequest::SerializePayload() const { return {}; } -void GetBucketAbacRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection GetBucketAbacRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void GetBucketAbacRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,25 +42,12 @@ void GetBucketAbacRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketAbacRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - GetBucketAbacRequest::EndpointParameters GetBucketAbacRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacResult.cpp index 6b4e2239f3f..798182e56d9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAbacResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetBucketAbacResult::GetBucketAbacResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketAbacResult& GetBucketAbacResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_abacStatus = resultNode; - m_abacStatusHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketAbacResult& GetBucketAbacResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationRequest.cpp index 869cd589e0f..27dfa7eda76 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,23 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketAccelerateConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String GetBucketAccelerateConfigurationRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection GetBucketAccelerateConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - return false; + return headers; } -Aws::String GetBucketAccelerateConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketAccelerateConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketAccelerateConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,27 +45,24 @@ void GetBucketAccelerateConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketAccelerateConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketAccelerateConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } GetBucketAccelerateConfigurationRequest::EndpointParameters GetBucketAccelerateConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationResult.cpp index 4ede3f6e655..0180844097c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAccelerateConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,31 +24,5 @@ GetBucketAccelerateConfigurationResult::GetBucketAccelerateConfigurationResult(c GetBucketAccelerateConfigurationResult& GetBucketAccelerateConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = BucketAccelerateStatusMapper::GetBucketAccelerateStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclRequest.cpp index 7fd7087f530..956dc3f1734 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketAclRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketAclRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketAclRequest::SerializePayload() const { return {}; } - -void GetBucketAclRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketAclRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketAclRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketAclRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketAclRequest::EndpointParameters GetBucketAclRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclResult.cpp index 1e2a994b227..64bcdd300af 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAclResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,36 +20,4 @@ using namespace Aws; GetBucketAclResult::GetBucketAclResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketAclResult& GetBucketAclResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode grantsNode = resultNode.FirstChild("AccessControlList"); - if (!grantsNode.IsNull()) { - XmlNode grantsMember = grantsNode.FirstChild("Grant"); - m_grantsHasBeenSet = !grantsMember.IsNull(); - while (!grantsMember.IsNull()) { - m_grants.push_back(grantsMember); - grantsMember = grantsMember.NextNode("Grant"); - } - - m_grantsHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketAclResult& GetBucketAclResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationRequest.cpp index 8728f54bc8d..1de322f8b74 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketAnalyticsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketAnalyticsConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketAnalyticsConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketAnalyticsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void GetBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketAnalyticsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketAnalyticsConfigurationRequest::EndpointParameters GetBucketAnalyticsConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationResult.cpp index 8f68a00dbf7..f5a4f757a9a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketAnalyticsConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,21 +24,5 @@ GetBucketAnalyticsConfigurationResult::GetBucketAnalyticsConfigurationResult(con GetBucketAnalyticsConfigurationResult& GetBucketAnalyticsConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_analyticsConfiguration = resultNode; - m_analyticsConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsRequest.cpp index d645ddb532c..94b76d8860a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketCorsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketCorsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketCorsRequest::SerializePayload() const { return {}; } - -void GetBucketCorsRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketCorsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketCorsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketCorsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketCorsRequest::EndpointParameters GetBucketCorsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsResult.cpp index 8af5cf09032..12af69c9cc4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketCorsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,31 +20,4 @@ using namespace Aws; GetBucketCorsResult::GetBucketCorsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketCorsResult& GetBucketCorsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode cORSRulesNode = resultNode.FirstChild("CORSRule"); - if (!cORSRulesNode.IsNull()) { - XmlNode cORSRuleMember = cORSRulesNode; - m_cORSRulesHasBeenSet = !cORSRuleMember.IsNull(); - while (!cORSRuleMember.IsNull()) { - m_cORSRules.push_back(cORSRuleMember); - cORSRuleMember = cORSRuleMember.NextNode("CORSRule"); - } - - m_cORSRulesHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketCorsResult& GetBucketCorsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionRequest.cpp index 51b1cfee349..2e339566885 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketEncryptionRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketEncryptionRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketEncryptionRequest::SerializePayload() const { return {}; } - -void GetBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketEncryptionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketEncryptionRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketEncryptionRequest::EndpointParameters GetBucketEncryptionRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionResult.cpp index bcd111e1394..2886d759170 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketEncryptionResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetBucketEncryptionResult::GetBucketEncryptionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketEncryptionResult& GetBucketEncryptionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_serverSideEncryptionConfiguration = resultNode; - m_serverSideEncryptionConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketEncryptionResult& GetBucketEncryptionResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationRequest.cpp index 444411e4e2e..ecca9966f11 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,34 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketIntelligentTieringConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketIntelligentTieringConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -52,23 +47,25 @@ void GetBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(U collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketIntelligentTieringConfigurationRequest::EndpointParameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationResult.cpp index 5a4d4e202e4..3df1c6b9af5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketIntelligentTieringConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -23,21 +25,5 @@ GetBucketIntelligentTieringConfigurationResult::GetBucketIntelligentTieringConfi GetBucketIntelligentTieringConfigurationResult& GetBucketIntelligentTieringConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_intelligentTieringConfiguration = resultNode; - m_intelligentTieringConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationRequest.cpp index 2045d473ae2..7e264854315 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketInventoryConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketInventoryConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketInventoryConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void GetBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketInventoryConfigurationRequest::EndpointParameters GetBucketInventoryConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationResult.cpp index c2d5afcc5e5..fbf83651478 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketInventoryConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,21 +24,5 @@ GetBucketInventoryConfigurationResult::GetBucketInventoryConfigurationResult(con GetBucketInventoryConfigurationResult& GetBucketInventoryConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_inventoryConfiguration = resultNode; - m_inventoryConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationRequest.cpp index 4f7c0f3e5cf..fe3eb66c4a5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketLifecycleConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketLifecycleConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketLifecycleConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketLifecycleConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketLifecycleConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketLifecycleConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketLifecycleConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketLifecycleConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketLifecycleConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketLifecycleConfigurationRequest::EndpointParameters GetBucketLifecycleConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationResult.cpp index dab36ed78cb..44a0e244013 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLifecycleConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,37 +24,5 @@ GetBucketLifecycleConfigurationResult::GetBucketLifecycleConfigurationResult(con GetBucketLifecycleConfigurationResult& GetBucketLifecycleConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& transitionDefaultMinimumObjectSizeIter = headers.find("x-amz-transition-default-minimum-object-size"); - if (transitionDefaultMinimumObjectSizeIter != headers.end()) { - m_transitionDefaultMinimumObjectSize = TransitionDefaultMinimumObjectSizeMapper::GetTransitionDefaultMinimumObjectSizeForName( - transitionDefaultMinimumObjectSizeIter->second); - m_transitionDefaultMinimumObjectSizeHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationRequest.cpp index 52cf92b97df..0974ebcb44c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketLocationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketLocationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketLocationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketLocationRequest::SerializePayload() const { return {}; } - -void GetBucketLocationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketLocationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketLocationRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketLocationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketLocationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketLocationRequest::EndpointParameters GetBucketLocationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationResult.cpp index 9283fa35509..5b309c0350f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLocationResult.cpp @@ -4,7 +4,10 @@ */ #include +#include #include +#include +#include #include #include @@ -15,19 +18,6 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws; -GetBucketLocationResult::GetBucketLocationResult(const AmazonWebServiceResult& result) - : m_locationConstraint(BucketLocationConstraint::NOT_SET) { - *this = result; -} +GetBucketLocationResult::GetBucketLocationResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketLocationResult& GetBucketLocationResult::operator=(const AmazonWebServiceResult& result) { - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_locationConstraint = - BucketLocationConstraintMapper::GetBucketLocationConstraintForName(StringUtils::Trim(resultNode.GetText().c_str()).c_str()); - } - - return *this; -} +GetBucketLocationResult& GetBucketLocationResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingRequest.cpp index 171c131c7d7..b513642ad1c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketLoggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketLoggingRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketLoggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketLoggingRequest::SerializePayload() const { return {}; } - -void GetBucketLoggingRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketLoggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketLoggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketLoggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketLoggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketLoggingRequest::EndpointParameters GetBucketLoggingRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingResult.cpp index 3a154af9fc7..e9ae1e139b3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketLoggingResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,25 +20,4 @@ using namespace Aws; GetBucketLoggingResult::GetBucketLoggingResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketLoggingResult& GetBucketLoggingResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode loggingEnabledNode = resultNode.FirstChild("LoggingEnabled"); - if (!loggingEnabledNode.IsNull()) { - m_loggingEnabled = loggingEnabledNode; - m_loggingEnabledHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketLoggingResult& GetBucketLoggingResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationRequest.cpp index 928f5bb5200..c0234b5c2ae 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,18 @@ using namespace Aws::Http; Aws::String GetBucketMetadataConfigurationRequest::SerializePayload() const { return {}; } -void GetBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection GetBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void GetBucketMetadataConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,25 +42,12 @@ void GetBucketMetadataConfigurationRequest::AddQueryStringParameters(URI& uri) c collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketMetadataConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - GetBucketMetadataConfigurationRequest::EndpointParameters GetBucketMetadataConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationResult.cpp index 2c5bc53dd33..c988f3d90f9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { GetBucketMetadataConfigurationResult::GetBucketMetadataConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -GetBucketMetadataConfigurationResult& GetBucketMetadataConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode metadataConfigurationResultNode = resultNode.FirstChild("MetadataConfigurationResult"); - if (!metadataConfigurationResultNode.IsNull()) { - m_metadataConfigurationResult = metadataConfigurationResultNode; - m_metadataConfigurationResultHasBeenSet = true; - } - } - - return *this; -} - -void GetBucketMetadataConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_metadataConfigurationResultHasBeenSet) { - XmlNode metadataConfigurationResultNode = parentNode.CreateChildElement("MetadataConfigurationResult"); - m_metadataConfigurationResult.AddToNode(metadataConfigurationResultNode); - } -} +GetBucketMetadataConfigurationResult& GetBucketMetadataConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } + +void GetBucketMetadataConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationSdkResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationSdkResult.cpp index c3137d549df..219dd995f79 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationSdkResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataConfigurationSdkResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,21 +24,5 @@ GetBucketMetadataConfigurationSdkResult::GetBucketMetadataConfigurationSdkResult GetBucketMetadataConfigurationSdkResult& GetBucketMetadataConfigurationSdkResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_getBucketMetadataConfigurationResult = resultNode; - m_getBucketMetadataConfigurationResultHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationRequest.cpp index 485edd4e87c..cd937f9594b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,18 @@ using namespace Aws::Http; Aws::String GetBucketMetadataTableConfigurationRequest::SerializePayload() const { return {}; } -void GetBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection GetBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void GetBucketMetadataTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,25 +42,12 @@ void GetBucketMetadataTableConfigurationRequest::AddQueryStringParameters(URI& u collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketMetadataTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - GetBucketMetadataTableConfigurationRequest::EndpointParameters GetBucketMetadataTableConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationResult.cpp index e42787fb567..36a9f82b485 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { GetBucketMetadataTableConfigurationResult::GetBucketMetadataTableConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -GetBucketMetadataTableConfigurationResult& GetBucketMetadataTableConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +GetBucketMetadataTableConfigurationResult& GetBucketMetadataTableConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode metadataTableConfigurationResultNode = resultNode.FirstChild("MetadataTableConfigurationResult"); - if (!metadataTableConfigurationResultNode.IsNull()) { - m_metadataTableConfigurationResult = metadataTableConfigurationResultNode; - m_metadataTableConfigurationResultHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()); - m_statusHasBeenSet = true; - } - XmlNode errorNode = resultNode.FirstChild("Error"); - if (!errorNode.IsNull()) { - m_error = errorNode; - m_errorHasBeenSet = true; - } - } - - return *this; -} - -void GetBucketMetadataTableConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_metadataTableConfigurationResultHasBeenSet) { - XmlNode metadataTableConfigurationResultNode = parentNode.CreateChildElement("MetadataTableConfigurationResult"); - m_metadataTableConfigurationResult.AddToNode(metadataTableConfigurationResultNode); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(m_status); - } - - if (m_errorHasBeenSet) { - XmlNode errorNode = parentNode.CreateChildElement("Error"); - m_error.AddToNode(errorNode); - } -} +void GetBucketMetadataTableConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationSdkResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationSdkResult.cpp index 36cefa85ec6..e2c2bb57ae6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationSdkResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetadataTableConfigurationSdkResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -23,21 +25,5 @@ GetBucketMetadataTableConfigurationSdkResult::GetBucketMetadataTableConfiguratio GetBucketMetadataTableConfigurationSdkResult& GetBucketMetadataTableConfigurationSdkResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_getBucketMetadataTableConfigurationResult = resultNode; - m_getBucketMetadataTableConfigurationResultHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationRequest.cpp index 9cfa4361087..51775fbcf4e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketMetricsConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketMetricsConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketMetricsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void GetBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) co collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketMetricsConfigurationRequest::EndpointParameters GetBucketMetricsConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationResult.cpp index 31763ea2d65..c28ebf07981 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketMetricsConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,21 +24,5 @@ GetBucketMetricsConfigurationResult::GetBucketMetricsConfigurationResult(const A GetBucketMetricsConfigurationResult& GetBucketMetricsConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_metricsConfiguration = resultNode; - m_metricsConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationRequest.cpp index cc25f922f50..5b8c9027f8a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,27 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketNotificationConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketNotificationConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketNotificationConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketNotificationConfigurationRequest::SerializePayload() const { return {}; } - -void GetBucketNotificationConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketNotificationConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -46,23 +42,25 @@ void GetBucketNotificationConfigurationRequest::AddQueryStringParameters(URI& ur collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketNotificationConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketNotificationConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketNotificationConfigurationRequest::EndpointParameters GetBucketNotificationConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationResult.cpp index d4958f9ea36..5389ba9ef13 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketNotificationConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,57 +24,5 @@ GetBucketNotificationConfigurationResult::GetBucketNotificationConfigurationResu GetBucketNotificationConfigurationResult& GetBucketNotificationConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode topicConfigurationsNode = resultNode.FirstChild("TopicConfiguration"); - if (!topicConfigurationsNode.IsNull()) { - XmlNode topicConfigurationMember = topicConfigurationsNode; - m_topicConfigurationsHasBeenSet = !topicConfigurationMember.IsNull(); - while (!topicConfigurationMember.IsNull()) { - m_topicConfigurations.push_back(topicConfigurationMember); - topicConfigurationMember = topicConfigurationMember.NextNode("TopicConfiguration"); - } - - m_topicConfigurationsHasBeenSet = true; - } - XmlNode queueConfigurationsNode = resultNode.FirstChild("QueueConfiguration"); - if (!queueConfigurationsNode.IsNull()) { - XmlNode queueConfigurationMember = queueConfigurationsNode; - m_queueConfigurationsHasBeenSet = !queueConfigurationMember.IsNull(); - while (!queueConfigurationMember.IsNull()) { - m_queueConfigurations.push_back(queueConfigurationMember); - queueConfigurationMember = queueConfigurationMember.NextNode("QueueConfiguration"); - } - - m_queueConfigurationsHasBeenSet = true; - } - XmlNode lambdaFunctionConfigurationsNode = resultNode.FirstChild("CloudFunctionConfiguration"); - if (!lambdaFunctionConfigurationsNode.IsNull()) { - XmlNode cloudFunctionConfigurationMember = lambdaFunctionConfigurationsNode; - m_lambdaFunctionConfigurationsHasBeenSet = !cloudFunctionConfigurationMember.IsNull(); - while (!cloudFunctionConfigurationMember.IsNull()) { - m_lambdaFunctionConfigurations.push_back(cloudFunctionConfigurationMember); - cloudFunctionConfigurationMember = cloudFunctionConfigurationMember.NextNode("CloudFunctionConfiguration"); - } - - m_lambdaFunctionConfigurationsHasBeenSet = true; - } - XmlNode eventBridgeConfigurationNode = resultNode.FirstChild("EventBridgeConfiguration"); - if (!eventBridgeConfigurationNode.IsNull()) { - m_eventBridgeConfiguration = eventBridgeConfigurationNode; - m_eventBridgeConfigurationHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsRequest.cpp index efedaa766f6..991f80d3abe 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketOwnershipControlsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketOwnershipControlsRequest::SerializePayload() const { return {}; } - -void GetBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketOwnershipControlsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) const collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketOwnershipControlsRequest::EndpointParameters GetBucketOwnershipControlsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsResult.cpp index 31f6937c90f..3096361955a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketOwnershipControlsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -21,21 +23,5 @@ GetBucketOwnershipControlsResult::GetBucketOwnershipControlsResult(const Aws::Am } GetBucketOwnershipControlsResult& GetBucketOwnershipControlsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_ownershipControls = resultNode; - m_ownershipControlsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyRequest.cpp index 5f57986130e..a8bb2f8e079 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketPolicyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketPolicyRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketPolicyRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketPolicyRequest::SerializePayload() const { return {}; } - -void GetBucketPolicyRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketPolicyRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketPolicyRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketPolicyRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketPolicyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketPolicyRequest::EndpointParameters GetBucketPolicyRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyResult.cpp index b0bddc82468..9aa3ca8ca0a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyResult.cpp @@ -4,8 +4,11 @@ */ #include +#include #include +#include #include +#include #include #include @@ -21,13 +24,6 @@ GetBucketPolicyResult& GetBucketPolicyResult::operator=(Aws::AmazonWebServiceRes m_HttpResponseCode = result.GetResponseCode(); m_policy = result.TakeOwnershipOfPayload(); m_policyHasBeenSet = true; - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - + // TODO: header-bound member deserialization return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusRequest.cpp index 88514f358bb..1d16e0adf67 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketPolicyStatusRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketPolicyStatusRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketPolicyStatusRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketPolicyStatusRequest::SerializePayload() const { return {}; } - -void GetBucketPolicyStatusRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketPolicyStatusRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketPolicyStatusRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketPolicyStatusRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketPolicyStatusRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketPolicyStatusRequest::EndpointParameters GetBucketPolicyStatusRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusResult.cpp index 045705d4ea0..cf09236c864 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketPolicyStatusResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,21 +21,5 @@ using namespace Aws; GetBucketPolicyStatusResult::GetBucketPolicyStatusResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetBucketPolicyStatusResult& GetBucketPolicyStatusResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_policyStatus = resultNode; - m_policyStatusHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationRequest.cpp index ac7c6f3494b..347fb46274b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketReplicationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketReplicationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketReplicationRequest::SerializePayload() const { return {}; } - -void GetBucketReplicationRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketReplicationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketReplicationRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketReplicationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketReplicationRequest::EndpointParameters GetBucketReplicationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationResult.cpp index e20c1bf6d54..8a3d4e83947 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketReplicationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetBucketReplicationResult::GetBucketReplicationResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketReplicationResult& GetBucketReplicationResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_replicationConfiguration = resultNode; - m_replicationConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketReplicationResult& GetBucketReplicationResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentRequest.cpp index 07c00f4144a..29c7fa8e60f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketRequestPaymentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketRequestPaymentRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketRequestPaymentRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketRequestPaymentRequest::SerializePayload() const { return {}; } - -void GetBucketRequestPaymentRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketRequestPaymentRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketRequestPaymentRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketRequestPaymentRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketRequestPaymentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketRequestPaymentRequest::EndpointParameters GetBucketRequestPaymentRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentResult.cpp index 372e31607f1..df33979f68e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketRequestPaymentResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,24 +21,5 @@ using namespace Aws; GetBucketRequestPaymentResult::GetBucketRequestPaymentResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetBucketRequestPaymentResult& GetBucketRequestPaymentResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode payerNode = resultNode.FirstChild("Payer"); - if (!payerNode.IsNull()) { - m_payer = PayerMapper::GetPayerForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(payerNode.GetText()).c_str())); - m_payerHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingRequest.cpp index 0d814bd35cb..0d992ae28c3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketTaggingRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketTaggingRequest::SerializePayload() const { return {}; } - -void GetBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketTaggingRequest::EndpointParameters GetBucketTaggingRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingResult.cpp index 0b49078a2af..a9b23304f14 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketTaggingResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,31 +20,4 @@ using namespace Aws; GetBucketTaggingResult::GetBucketTaggingResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketTaggingResult& GetBucketTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode tagSetNode = resultNode.FirstChild("TagSet"); - if (!tagSetNode.IsNull()) { - XmlNode tagSetMember = tagSetNode.FirstChild("Tag"); - m_tagSetHasBeenSet = !tagSetMember.IsNull(); - while (!tagSetMember.IsNull()) { - m_tagSet.push_back(tagSetMember); - tagSetMember = tagSetMember.NextNode("Tag"); - } - - m_tagSetHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketTaggingResult& GetBucketTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningRequest.cpp index bafac2584e1..1fafd9d5c81 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketVersioningRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketVersioningRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketVersioningRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketVersioningRequest::SerializePayload() const { return {}; } - -void GetBucketVersioningRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketVersioningRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketVersioningRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketVersioningRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketVersioningRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketVersioningRequest::EndpointParameters GetBucketVersioningRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningResult.cpp index bfdd5ab57d7..0bb6adb5abf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketVersioningResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,32 +20,4 @@ using namespace Aws; GetBucketVersioningResult::GetBucketVersioningResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketVersioningResult& GetBucketVersioningResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = BucketVersioningStatusMapper::GetBucketVersioningStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode mFADeleteNode = resultNode.FirstChild("MfaDelete"); - if (!mFADeleteNode.IsNull()) { - m_mFADelete = MFADeleteStatusMapper::GetMFADeleteStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(mFADeleteNode.GetText()).c_str())); - m_mFADeleteHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketVersioningResult& GetBucketVersioningResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteRequest.cpp index 5d2a5c81de0..48daaa0d31e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetBucketWebsiteRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetBucketWebsiteRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetBucketWebsiteRequest::SerializePayload() const { return {}; } - -void GetBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { +void GetBucketWebsiteRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetBucketWebsiteRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetBucketWebsiteRequest::EndpointParameters GetBucketWebsiteRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteResult.cpp index 7a24dd9dc31..452d7249d35 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetBucketWebsiteResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,46 +20,4 @@ using namespace Aws; GetBucketWebsiteResult::GetBucketWebsiteResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetBucketWebsiteResult& GetBucketWebsiteResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode redirectAllRequestsToNode = resultNode.FirstChild("RedirectAllRequestsTo"); - if (!redirectAllRequestsToNode.IsNull()) { - m_redirectAllRequestsTo = redirectAllRequestsToNode; - m_redirectAllRequestsToHasBeenSet = true; - } - XmlNode indexDocumentNode = resultNode.FirstChild("IndexDocument"); - if (!indexDocumentNode.IsNull()) { - m_indexDocument = indexDocumentNode; - m_indexDocumentHasBeenSet = true; - } - XmlNode errorDocumentNode = resultNode.FirstChild("ErrorDocument"); - if (!errorDocumentNode.IsNull()) { - m_errorDocument = errorDocumentNode; - m_errorDocumentHasBeenSet = true; - } - XmlNode routingRulesNode = resultNode.FirstChild("RoutingRules"); - if (!routingRulesNode.IsNull()) { - XmlNode routingRulesMember = routingRulesNode.FirstChild("RoutingRule"); - m_routingRulesHasBeenSet = !routingRulesMember.IsNull(); - while (!routingRulesMember.IsNull()) { - m_routingRules.push_back(routingRulesMember); - routingRulesMember = routingRulesMember.NextNode("RoutingRule"); - } - - m_routingRulesHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetBucketWebsiteResult& GetBucketWebsiteResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclRequest.cpp index 051b4888886..e3213ff20e2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,29 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String GetObjectAclRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection GetObjectAclRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetObjectAclRequest::SerializePayload() const { return {}; } - -void GetObjectAclRequest::AddQueryStringParameters(URI& uri) const { +void GetObjectAclRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,27 +50,24 @@ void GetObjectAclRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectAclRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); +bool GetObjectAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } GetObjectAclRequest::EndpointParameters GetObjectAclRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclResult.cpp index 12094e9d3f8..b7616cdcb98 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAclResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,42 +20,4 @@ using namespace Aws; GetObjectAclResult::GetObjectAclResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetObjectAclResult& GetObjectAclResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode grantsNode = resultNode.FirstChild("AccessControlList"); - if (!grantsNode.IsNull()) { - XmlNode grantsMember = grantsNode.FirstChild("Grant"); - m_grantsHasBeenSet = !grantsMember.IsNull(); - while (!grantsMember.IsNull()) { - m_grants.push_back(grantsMember); - grantsMember = grantsMember.NextNode("Grant"); - } - - m_grantsHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetObjectAclResult& GetObjectAclResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationRequest.cpp index bf7c844c475..140fd47cbaa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,20 +21,35 @@ using namespace Aws::Http; Aws::String GetObjectAnnotationRequest::SerializePayload() const { return {}; } -void GetObjectAnnotationRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection GetObjectAnnotationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + if (m_checksumModeHasBeenSet && m_checksumMode != ChecksumMode::NOT_SET) { + headers.emplace("x-amz-checksum-mode", ChecksumModeMapper::GetNameForChecksumMode(m_checksumMode)); + } + return headers; +} + +void GetObjectAnnotationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_annotationNameHasBeenSet) { ss << m_annotationName; uri.AddQueryStringParameter("annotationName", ss.str()); ss.str(""); } - if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -40,44 +58,11 @@ void GetObjectAnnotationRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection GetObjectAnnotationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - if (m_checksumModeHasBeenSet && m_checksumMode != ChecksumMode::NOT_SET) { - headers.emplace("x-amz-checksum-mode", ChecksumModeMapper::GetNameForChecksumMode(m_checksumMode)); - } - - return headers; -} - -GetObjectAnnotationRequest::EndpointParameters GetObjectAnnotationRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); - } - if (KeyHasBeenSet()) { - parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); - } - return parameters; -} bool GetObjectAnnotationRequest::ShouldValidateResponseChecksum() const { return m_checksumMode == ChecksumMode::ENABLED; } Aws::Vector GetObjectAnnotationRequest::GetResponseChecksumAlgorithmNames() const { @@ -94,3 +79,15 @@ Aws::Vector GetObjectAnnotationRequest::GetResponseChecksumAlgorith responseChecksumAlgorithmNames.push_back("XXHASH128"); return responseChecksumAlgorithmNames; } + +GetObjectAnnotationRequest::EndpointParameters GetObjectAnnotationRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + if (KeyHasBeenSet()) { + parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationResult.cpp index 8f7ff15e694..72eec42cfc6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAnnotationResult.cpp @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include @@ -22,125 +24,6 @@ GetObjectAnnotationResult& GetObjectAnnotationResult::operator=(Aws::AmazonWebSe m_HttpResponseCode = result.GetResponseCode(); m_annotationPayload = result.TakeOwnershipOfPayload(); m_annotationPayloadHasBeenSet = true; - - const auto& headers = result.GetHeaderValueCollection(); - const auto& objectVersionIdIter = headers.find("x-amz-object-version-id"); - if (objectVersionIdIter != headers.end()) { - m_objectVersionId = objectVersionIdIter->second; - m_objectVersionIdHasBeenSet = true; - } - - const auto& lastModifiedIter = headers.find("last-modified"); - if (lastModifiedIter != headers.end()) { - m_lastModified = DateTime(lastModifiedIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_lastModified.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::GetObjectAnnotationResult", - "Failed to parse lastModified header as an RFC822 timestamp: " << lastModifiedIter->second.c_str()); - } - m_lastModifiedHasBeenSet = true; - } - - const auto& contentLengthIter = headers.find("content-length"); - if (contentLengthIter != headers.end()) { - m_contentLength = StringUtils::ConvertToInt64(contentLengthIter->second.c_str()); - m_contentLengthHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& replicationStatusIter = headers.find("x-amz-replication-status"); - if (replicationStatusIter != headers.end()) { - m_replicationStatus = ReplicationStatusMapper::GetReplicationStatusForName(replicationStatusIter->second); - m_replicationStatusHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - + // TODO: header-bound member deserialization return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesParts.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesParts.cpp index dd8ee4f5630..67abc500b9d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesParts.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesParts.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,100 +20,9 @@ namespace Model { GetObjectAttributesParts::GetObjectAttributesParts(const XmlNode& xmlNode) { *this = xmlNode; } -GetObjectAttributesParts& GetObjectAttributesParts::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +GetObjectAttributesParts& GetObjectAttributesParts::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode totalPartsCountNode = resultNode.FirstChild("PartsCount"); - if (!totalPartsCountNode.IsNull()) { - m_totalPartsCount = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(totalPartsCountNode.GetText()).c_str()).c_str()); - m_totalPartsCountHasBeenSet = true; - } - XmlNode partNumberMarkerNode = resultNode.FirstChild("PartNumberMarker"); - if (!partNumberMarkerNode.IsNull()) { - m_partNumberMarker = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partNumberMarkerNode.GetText()).c_str()).c_str()); - m_partNumberMarkerHasBeenSet = true; - } - XmlNode nextPartNumberMarkerNode = resultNode.FirstChild("NextPartNumberMarker"); - if (!nextPartNumberMarkerNode.IsNull()) { - m_nextPartNumberMarker = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(nextPartNumberMarkerNode.GetText()).c_str()).c_str()); - m_nextPartNumberMarkerHasBeenSet = true; - } - XmlNode maxPartsNode = resultNode.FirstChild("MaxParts"); - if (!maxPartsNode.IsNull()) { - m_maxParts = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxPartsNode.GetText()).c_str()).c_str()); - m_maxPartsHasBeenSet = true; - } - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode partsNode = resultNode.FirstChild("Part"); - if (!partsNode.IsNull()) { - XmlNode partMember = partsNode; - m_partsHasBeenSet = !partMember.IsNull(); - while (!partMember.IsNull()) { - m_parts.push_back(partMember); - partMember = partMember.NextNode("Part"); - } - - m_partsHasBeenSet = true; - } - } - - return *this; -} - -void GetObjectAttributesParts::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_totalPartsCountHasBeenSet) { - XmlNode totalPartsCountNode = parentNode.CreateChildElement("PartsCount"); - ss << m_totalPartsCount; - totalPartsCountNode.SetText(ss.str()); - ss.str(""); - } - - if (m_partNumberMarkerHasBeenSet) { - XmlNode partNumberMarkerNode = parentNode.CreateChildElement("PartNumberMarker"); - ss << m_partNumberMarker; - partNumberMarkerNode.SetText(ss.str()); - ss.str(""); - } - - if (m_nextPartNumberMarkerHasBeenSet) { - XmlNode nextPartNumberMarkerNode = parentNode.CreateChildElement("NextPartNumberMarker"); - ss << m_nextPartNumberMarker; - nextPartNumberMarkerNode.SetText(ss.str()); - ss.str(""); - } - - if (m_maxPartsHasBeenSet) { - XmlNode maxPartsNode = parentNode.CreateChildElement("MaxParts"); - ss << m_maxParts; - maxPartsNode.SetText(ss.str()); - ss.str(""); - } - - if (m_isTruncatedHasBeenSet) { - XmlNode isTruncatedNode = parentNode.CreateChildElement("IsTruncated"); - ss << std::boolalpha << m_isTruncated; - isTruncatedNode.SetText(ss.str()); - ss.str(""); - } - - if (m_partsHasBeenSet) { - for (const auto& item : m_parts) { - XmlNode partsNode = parentNode.CreateChildElement("Part"); - item.AddToNode(partsNode); - } - } -} +void GetObjectAttributesParts::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesRequest.cpp index 3cf7b03ed12..f1c2b7235fc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesRequest.cpp @@ -4,6 +4,8 @@ */ #include +#include +#include #include #include #include @@ -17,48 +19,8 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectAttributesRequest::HasEmbeddedError(Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String GetObjectAttributesRequest::SerializePayload() const { return {}; } -void GetObjectAttributesRequest::AddQueryStringParameters(URI &uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto &entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection GetObjectAttributesRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -67,53 +29,80 @@ Aws::Http::HeaderValueCollection GetObjectAttributesRequest::GetRequestSpecificH headers.emplace("x-amz-max-parts", ss.str()); ss.str(""); } - if (m_partNumberMarkerHasBeenSet) { ss << m_partNumberMarker; headers.emplace("x-amz-part-number-marker", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_objectAttributesHasBeenSet) { headers.emplace("x-amz-object-attributes", std::accumulate(std::begin(m_objectAttributes), std::end(m_objectAttributes), Aws::String{}, - [](const Aws::String &acc, const ObjectAttributes &item) -> Aws::String { + [](const Aws::String& acc, const ObjectAttributes& item) -> Aws::String { const auto headerValue = ObjectAttributesMapper::GetNameForObjectAttributes(item); return acc.empty() ? headerValue : acc + "," + headerValue; })); } - return headers; } +void GetObjectAttributesRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool GetObjectAttributesRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + GetObjectAttributesRequest::EndpointParameters GetObjectAttributesRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesResult.cpp index 68ed6816b4a..01e659386ea 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectAttributesResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,75 +20,4 @@ using namespace Aws; GetObjectAttributesResult::GetObjectAttributesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetObjectAttributesResult& GetObjectAttributesResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumNode = resultNode.FirstChild("Checksum"); - if (!checksumNode.IsNull()) { - m_checksum = checksumNode; - m_checksumHasBeenSet = true; - } - XmlNode objectPartsNode = resultNode.FirstChild("ObjectParts"); - if (!objectPartsNode.IsNull()) { - m_objectParts = objectPartsNode; - m_objectPartsHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode objectSizeNode = resultNode.FirstChild("ObjectSize"); - if (!objectSizeNode.IsNull()) { - m_objectSize = - StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeNode.GetText()).c_str()).c_str()); - m_objectSizeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& deleteMarkerIter = headers.find("x-amz-delete-marker"); - if (deleteMarkerIter != headers.end()) { - m_deleteMarker = StringUtils::ConvertToBool(deleteMarkerIter->second.c_str()); - m_deleteMarkerHasBeenSet = true; - } - - const auto& lastModifiedIter = headers.find("last-modified"); - if (lastModifiedIter != headers.end()) { - m_lastModified = DateTime(lastModifiedIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_lastModified.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::GetObjectAttributesResult", - "Failed to parse lastModified header as an RFC822 timestamp: " << lastModifiedIter->second.c_str()); - } - m_lastModifiedHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetObjectAttributesResult& GetObjectAttributesResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldRequest.cpp index 2ca5895d810..70bf4f2bbb2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,29 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectLegalHoldRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String GetObjectLegalHoldRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection GetObjectLegalHoldRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetObjectLegalHoldRequest::SerializePayload() const { return {}; } - -void GetObjectLegalHoldRequest::AddQueryStringParameters(URI& uri) const { +void GetObjectLegalHoldRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,27 +50,24 @@ void GetObjectLegalHoldRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectLegalHoldRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); +bool GetObjectLegalHoldRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } GetObjectLegalHoldRequest::EndpointParameters GetObjectLegalHoldRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldResult.cpp index d1d9bbb0ef2..bcdf314bbe9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLegalHoldResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetObjectLegalHoldResult::GetObjectLegalHoldResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetObjectLegalHoldResult& GetObjectLegalHoldResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_legalHold = resultNode; - m_legalHoldHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetObjectLegalHoldResult& GetObjectLegalHoldResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationRequest.cpp index 010a3fd19bf..f5bcff2641b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectLockConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetObjectLockConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetObjectLockConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetObjectLockConfigurationRequest::SerializePayload() const { return {}; } - -void GetObjectLockConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void GetObjectLockConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetObjectLockConfigurationRequest::AddQueryStringParameters(URI& uri) const collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectLockConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetObjectLockConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetObjectLockConfigurationRequest::EndpointParameters GetObjectLockConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationResult.cpp index 680b41f6eea..dcf286474c0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectLockConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -21,21 +23,5 @@ GetObjectLockConfigurationResult::GetObjectLockConfigurationResult(const Aws::Am } GetObjectLockConfigurationResult& GetObjectLockConfigurationResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_objectLockConfiguration = resultNode; - m_objectLockConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRequest.cpp index 0c1178f100c..a5aeafaffde 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,71 +21,6 @@ using namespace Aws::Http; Aws::String GetObjectRequest::SerializePayload() const { return {}; } -void GetObjectRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_responseCacheControlHasBeenSet) { - ss << m_responseCacheControl; - uri.AddQueryStringParameter("response-cache-control", ss.str()); - ss.str(""); - } - - if (m_responseContentDispositionHasBeenSet) { - ss << m_responseContentDisposition; - uri.AddQueryStringParameter("response-content-disposition", ss.str()); - ss.str(""); - } - - if (m_responseContentEncodingHasBeenSet) { - ss << m_responseContentEncoding; - uri.AddQueryStringParameter("response-content-encoding", ss.str()); - ss.str(""); - } - - if (m_responseContentLanguageHasBeenSet) { - ss << m_responseContentLanguage; - uri.AddQueryStringParameter("response-content-language", ss.str()); - ss.str(""); - } - - if (m_responseContentTypeHasBeenSet) { - ss << m_responseContentType; - uri.AddQueryStringParameter("response-content-type", ss.str()); - ss.str(""); - } - - if (m_responseExpiresHasBeenSet) { - ss << m_responseExpires.ToGmtString(Aws::Utils::DateFormat::RFC822); - uri.AddQueryStringParameter("response-expires", ss.str()); - ss.str(""); - } - - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (m_partNumberHasBeenSet) { - ss << m_partNumber; - uri.AddQueryStringParameter("partNumber", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection GetObjectRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -91,72 +29,105 @@ Aws::Http::HeaderValueCollection GetObjectRequest::GetRequestSpecificHeaders() c headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_ifModifiedSinceHasBeenSet) { headers.emplace("if-modified-since", m_ifModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_ifNoneMatchHasBeenSet) { ss << m_ifNoneMatch; headers.emplace("if-none-match", ss.str()); ss.str(""); } - if (m_ifUnmodifiedSinceHasBeenSet) { headers.emplace("if-unmodified-since", m_ifUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_rangeHasBeenSet) { ss << m_range; headers.emplace("range", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_checksumModeHasBeenSet && m_checksumMode != ChecksumMode::NOT_SET) { headers.emplace("x-amz-checksum-mode", ChecksumModeMapper::GetNameForChecksumMode(m_checksumMode)); } - return headers; } -GetObjectRequest::EndpointParameters GetObjectRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void GetObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_responseCacheControlHasBeenSet) { + ss << m_responseCacheControl; + uri.AddQueryStringParameter("response-cache-control", ss.str()); + ss.str(""); } - if (KeyHasBeenSet()) { - parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + if (m_responseContentDispositionHasBeenSet) { + ss << m_responseContentDisposition; + uri.AddQueryStringParameter("response-content-disposition", ss.str()); + ss.str(""); + } + if (m_responseContentEncodingHasBeenSet) { + ss << m_responseContentEncoding; + uri.AddQueryStringParameter("response-content-encoding", ss.str()); + ss.str(""); + } + if (m_responseContentLanguageHasBeenSet) { + ss << m_responseContentLanguage; + uri.AddQueryStringParameter("response-content-language", ss.str()); + ss.str(""); + } + if (m_responseContentTypeHasBeenSet) { + ss << m_responseContentType; + uri.AddQueryStringParameter("response-content-type", ss.str()); + ss.str(""); + } + if (m_responseExpiresHasBeenSet) { + ss << m_responseExpires.ToGmtString(Aws::Utils::DateFormat::RFC822); + uri.AddQueryStringParameter("response-expires", ss.str()); + ss.str(""); + } + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); + } + if (m_partNumberHasBeenSet) { + ss << m_partNumber; + uri.AddQueryStringParameter("partNumber", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } bool GetObjectRequest::ShouldValidateResponseChecksum() const { return m_checksumMode == ChecksumMode::ENABLED; } @@ -174,3 +145,15 @@ Aws::Vector GetObjectRequest::GetResponseChecksumAlgorithmNames() c responseChecksumAlgorithmNames.push_back("XXHASH128"); return responseChecksumAlgorithmNames; } + +GetObjectRequest::EndpointParameters GetObjectRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + if (KeyHasBeenSet()) { + parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectResult.cpp index 2739f19f4e6..5e142696fe4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectResult.cpp @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include @@ -22,293 +24,6 @@ GetObjectResult& GetObjectResult::operator=(Aws::AmazonWebServiceResultsecond.c_str()); - m_deleteMarkerHasBeenSet = true; - } - - const auto& acceptRangesIter = headers.find("accept-ranges"); - if (acceptRangesIter != headers.end()) { - m_acceptRanges = acceptRangesIter->second; - m_acceptRangesHasBeenSet = true; - } - - const auto& expirationIter = headers.find("x-amz-expiration"); - if (expirationIter != headers.end()) { - m_expiration = expirationIter->second; - m_expirationHasBeenSet = true; - } - - const auto& restoreIter = headers.find("x-amz-restore"); - if (restoreIter != headers.end()) { - m_restore = restoreIter->second; - m_restoreHasBeenSet = true; - } - - const auto& lastModifiedIter = headers.find("last-modified"); - if (lastModifiedIter != headers.end()) { - m_lastModified = DateTime(lastModifiedIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_lastModified.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::GetObjectResult", - "Failed to parse lastModified header as an RFC822 timestamp: " << lastModifiedIter->second.c_str()); - } - m_lastModifiedHasBeenSet = true; - } - - const auto& contentLengthIter = headers.find("content-length"); - if (contentLengthIter != headers.end()) { - m_contentLength = StringUtils::ConvertToInt64(contentLengthIter->second.c_str()); - m_contentLengthHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& missingMetaIter = headers.find("x-amz-missing-meta"); - if (missingMetaIter != headers.end()) { - m_missingMeta = StringUtils::ConvertToInt32(missingMetaIter->second.c_str()); - m_missingMetaHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& cacheControlIter = headers.find("cache-control"); - if (cacheControlIter != headers.end()) { - m_cacheControl = cacheControlIter->second; - m_cacheControlHasBeenSet = true; - } - - const auto& contentDispositionIter = headers.find("content-disposition"); - if (contentDispositionIter != headers.end()) { - m_contentDisposition = contentDispositionIter->second; - m_contentDispositionHasBeenSet = true; - } - - const auto& contentEncodingIter = headers.find("content-encoding"); - if (contentEncodingIter != headers.end()) { - m_contentEncoding = contentEncodingIter->second; - m_contentEncodingHasBeenSet = true; - } - - const auto& contentLanguageIter = headers.find("content-language"); - if (contentLanguageIter != headers.end()) { - m_contentLanguage = contentLanguageIter->second; - m_contentLanguageHasBeenSet = true; - } - - const auto& contentRangeIter = headers.find("content-range"); - if (contentRangeIter != headers.end()) { - m_contentRange = contentRangeIter->second; - m_contentRangeHasBeenSet = true; - } - - const auto& contentTypeIter = headers.find("content-type"); - if (contentTypeIter != headers.end()) { - m_contentType = contentTypeIter->second; - m_contentTypeHasBeenSet = true; - } - - const auto& expiresIter = headers.find("expires"); - if (expiresIter != headers.end()) { - m_expires = DateTime(expiresIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_expires.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::GetObjectResult", "Failed to parse expires header as an RFC822 timestamp: " << expiresIter->second.c_str()); - } - m_expiresHasBeenSet = true; - } - - const auto& websiteRedirectLocationIter = headers.find("x-amz-website-redirect-location"); - if (websiteRedirectLocationIter != headers.end()) { - m_websiteRedirectLocation = websiteRedirectLocationIter->second; - m_websiteRedirectLocationHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - std::size_t prefixSize = sizeof("x-amz-meta-") - 1; // subtract the NULL terminator out - for (const auto& item : headers) { - std::size_t foundPrefix = item.first.find("x-amz-meta-"); - - if (foundPrefix != std::string::npos) { - m_metadata[item.first.substr(prefixSize)] = item.second; - m_metadataHasBeenSet = true; - } - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& storageClassIter = headers.find("x-amz-storage-class"); - if (storageClassIter != headers.end()) { - m_storageClass = StorageClassMapper::GetStorageClassForName(storageClassIter->second); - m_storageClassHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& replicationStatusIter = headers.find("x-amz-replication-status"); - if (replicationStatusIter != headers.end()) { - m_replicationStatus = ReplicationStatusMapper::GetReplicationStatusForName(replicationStatusIter->second); - m_replicationStatusHasBeenSet = true; - } - - const auto& partsCountIter = headers.find("x-amz-mp-parts-count"); - if (partsCountIter != headers.end()) { - m_partsCount = StringUtils::ConvertToInt32(partsCountIter->second.c_str()); - m_partsCountHasBeenSet = true; - } - - const auto& tagCountIter = headers.find("x-amz-tagging-count"); - if (tagCountIter != headers.end()) { - m_tagCount = StringUtils::ConvertToInt32(tagCountIter->second.c_str()); - m_tagCountHasBeenSet = true; - } - - const auto& objectLockModeIter = headers.find("x-amz-object-lock-mode"); - if (objectLockModeIter != headers.end()) { - m_objectLockMode = ObjectLockModeMapper::GetObjectLockModeForName(objectLockModeIter->second); - m_objectLockModeHasBeenSet = true; - } - - const auto& objectLockRetainUntilDateIter = headers.find("x-amz-object-lock-retain-until-date"); - if (objectLockRetainUntilDateIter != headers.end()) { - m_objectLockRetainUntilDate = DateTime(objectLockRetainUntilDateIter->second.c_str(), Aws::Utils::DateFormat::ISO_8601); - if (!m_objectLockRetainUntilDate.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::GetObjectResult", "Failed to parse objectLockRetainUntilDate header as an ISO_8601 timestamp: " - << objectLockRetainUntilDateIter->second.c_str()); - } - m_objectLockRetainUntilDateHasBeenSet = true; - } - - const auto& objectLockLegalHoldStatusIter = headers.find("x-amz-object-lock-legal-hold"); - if (objectLockLegalHoldStatusIter != headers.end()) { - m_objectLockLegalHoldStatus = - ObjectLockLegalHoldStatusMapper::GetObjectLockLegalHoldStatusForName(objectLockLegalHoldStatusIter->second); - m_objectLockLegalHoldStatusHasBeenSet = true; - } - - const auto& id2Iter = headers.find("x-amz-id-2"); - if (id2Iter != headers.end()) { - m_id2 = id2Iter->second; - m_id2HasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - const auto& expiresStringIter = headers.find("expires"); - if (expiresStringIter != headers.end()) { - m_expiresString = expiresStringIter->second; - m_expiresStringHasBeenSet = true; - } - + // TODO: header-bound member deserialization return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionRequest.cpp index 1143536d495..ec9f2eab4c5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,29 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectRetentionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String GetObjectRetentionRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection GetObjectRetentionRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetObjectRetentionRequest::SerializePayload() const { return {}; } - -void GetObjectRetentionRequest::AddQueryStringParameters(URI& uri) const { +void GetObjectRetentionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,27 +50,24 @@ void GetObjectRetentionRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectRetentionRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); +bool GetObjectRetentionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } GetObjectRetentionRequest::EndpointParameters GetObjectRetentionRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionResult.cpp index 4e1f606de20..230fb507799 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectRetentionResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetObjectRetentionResult::GetObjectRetentionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetObjectRetentionResult& GetObjectRetentionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_retention = resultNode; - m_retentionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetObjectRetentionResult& GetObjectRetentionResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingRequest.cpp index 3eddffbe989..15dcaa7fc16 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,29 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String GetObjectTaggingRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection GetObjectTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - return false; + return headers; } -Aws::String GetObjectTaggingRequest::SerializePayload() const { return {}; } - -void GetObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { +void GetObjectTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,27 +50,24 @@ void GetObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } GetObjectTaggingRequest::EndpointParameters GetObjectTaggingRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingResult.cpp index 791f77a170d..f7fbec542d7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTaggingResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,37 +20,4 @@ using namespace Aws; GetObjectTaggingResult::GetObjectTaggingResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetObjectTaggingResult& GetObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode tagSetNode = resultNode.FirstChild("TagSet"); - if (!tagSetNode.IsNull()) { - XmlNode tagSetMember = tagSetNode.FirstChild("Tag"); - m_tagSetHasBeenSet = !tagSetMember.IsNull(); - while (!tagSetMember.IsNull()) { - m_tagSet.push_back(tagSetMember); - tagSetMember = tagSetMember.NextNode("Tag"); - } - - m_tagSetHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetObjectTaggingResult& GetObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentRequest.cpp index adef70946c2..7f36ef15306 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,7 +21,21 @@ using namespace Aws::Http; Aws::String GetObjectTorrentRequest::SerializePayload() const { return {}; } -void GetObjectTorrentRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection GetObjectTorrentRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void GetObjectTorrentRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -28,29 +45,12 @@ void GetObjectTorrentRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetObjectTorrentRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - GetObjectTorrentRequest::EndpointParameters GetObjectTorrentRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentResult.cpp index f051e725321..96361fca06a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetObjectTorrentResult.cpp @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include @@ -22,19 +24,6 @@ GetObjectTorrentResult& GetObjectTorrentResult::operator=(Aws::AmazonWebServiceR m_HttpResponseCode = result.GetResponseCode(); m_body = result.TakeOwnershipOfPayload(); m_bodyHasBeenSet = true; - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - + // TODO: header-bound member deserialization return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockRequest.cpp index 4b26d3e58b1..96e31fa3280 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool GetPublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String GetPublicAccessBlockRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection GetPublicAccessBlockRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String GetPublicAccessBlockRequest::SerializePayload() const { return {}; } - -void GetPublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { +void GetPublicAccessBlockRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void GetPublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection GetPublicAccessBlockRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool GetPublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } GetPublicAccessBlockRequest::EndpointParameters GetPublicAccessBlockRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockResult.cpp index a46ab423666..1c34d0a37ca 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GetPublicAccessBlockResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,22 +20,4 @@ using namespace Aws; GetPublicAccessBlockResult::GetPublicAccessBlockResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetPublicAccessBlockResult& GetPublicAccessBlockResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_publicAccessBlockConfiguration = resultNode; - m_publicAccessBlockConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetPublicAccessBlockResult& GetPublicAccessBlockResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/GlacierJobParameters.cpp b/generated/src/aws-cpp-sdk-s3/source/model/GlacierJobParameters.cpp index e5ff2a8a52f..e820c01def7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/GlacierJobParameters.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/GlacierJobParameters.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { GlacierJobParameters::GlacierJobParameters(const XmlNode& xmlNode) { *this = xmlNode; } -GlacierJobParameters& GlacierJobParameters::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode tierNode = resultNode.FirstChild("Tier"); - if (!tierNode.IsNull()) { - m_tier = TierMapper::GetTierForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(tierNode.GetText()).c_str())); - m_tierHasBeenSet = true; - } - } - - return *this; -} - -void GlacierJobParameters::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tierHasBeenSet) { - XmlNode tierNode = parentNode.CreateChildElement("Tier"); - tierNode.SetText(TierMapper::GetNameForTier(m_tier)); - } -} +GlacierJobParameters& GlacierJobParameters::operator=(const XmlNode& xmlNode) { return *this; } + +void GlacierJobParameters::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Grant.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Grant.cpp index b79bc6ef496..b8ce6eb1963 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Grant.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Grant.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { Grant::Grant(const XmlNode& xmlNode) { *this = xmlNode; } -Grant& Grant::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode granteeNode = resultNode.FirstChild("Grantee"); - if (!granteeNode.IsNull()) { - m_grantee = granteeNode; - m_granteeHasBeenSet = true; - } - XmlNode permissionNode = resultNode.FirstChild("Permission"); - if (!permissionNode.IsNull()) { - m_permission = PermissionMapper::GetPermissionForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(permissionNode.GetText()).c_str())); - m_permissionHasBeenSet = true; - } - } - - return *this; -} - -void Grant::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_granteeHasBeenSet) { - XmlNode granteeNode = parentNode.CreateChildElement("Grantee"); - m_grantee.AddToNode(granteeNode); - } - - if (m_permissionHasBeenSet) { - XmlNode permissionNode = parentNode.CreateChildElement("Permission"); - permissionNode.SetText(PermissionMapper::GetNameForPermission(m_permission)); - } -} +Grant& Grant::operator=(const XmlNode& xmlNode) { return *this; } + +void Grant::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Grantee.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Grantee.cpp index bfb556440c0..32e2af7e69a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Grantee.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Grantee.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,67 +20,9 @@ namespace Model { Grantee::Grantee(const XmlNode& xmlNode) { *this = xmlNode; } -Grantee& Grantee::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Grantee& Grantee::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode displayNameNode = resultNode.FirstChild("DisplayName"); - if (!displayNameNode.IsNull()) { - m_displayName = Aws::Utils::Xml::DecodeEscapedXmlText(displayNameNode.GetText()); - m_displayNameHasBeenSet = true; - } - XmlNode emailAddressNode = resultNode.FirstChild("EmailAddress"); - if (!emailAddressNode.IsNull()) { - m_emailAddress = Aws::Utils::Xml::DecodeEscapedXmlText(emailAddressNode.GetText()); - m_emailAddressHasBeenSet = true; - } - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - auto type = resultNode.GetAttributeValue("xsi:type"); - if (!type.empty()) { - m_type = TypeMapper::GetTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(type).c_str())); - m_typeHasBeenSet = true; - } - XmlNode uRINode = resultNode.FirstChild("URI"); - if (!uRINode.IsNull()) { - m_uRI = Aws::Utils::Xml::DecodeEscapedXmlText(uRINode.GetText()); - m_uRIHasBeenSet = true; - } - } - - return *this; -} - -void Grantee::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - parentNode.SetAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); - if (m_displayNameHasBeenSet) { - XmlNode displayNameNode = parentNode.CreateChildElement("DisplayName"); - displayNameNode.SetText(m_displayName); - } - - if (m_emailAddressHasBeenSet) { - XmlNode emailAddressNode = parentNode.CreateChildElement("EmailAddress"); - emailAddressNode.SetText(m_emailAddress); - } - - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_typeHasBeenSet) { - parentNode.SetAttributeValue("xsi:type", TypeMapper::GetNameForType(m_type)); - } - - if (m_uRIHasBeenSet) { - XmlNode uRINode = parentNode.CreateChildElement("URI"); - uRINode.SetText(m_uRI); - } -} +void Grantee::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketRequest.cpp index f547480e1fd..25b1f0f8c30 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,26 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool HeadBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String HeadBucketRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection HeadBucketRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String HeadBucketRequest::SerializePayload() const { return {}; } - -void HeadBucketRequest::AddQueryStringParameters(URI& uri) const { +void HeadBucketRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -45,23 +42,24 @@ void HeadBucketRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection HeadBucketRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool HeadBucketRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } HeadBucketRequest::EndpointParameters HeadBucketRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp index 3f5a7c6d414..b50ef2af9a8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,50 +20,4 @@ using namespace Aws; HeadBucketResult::HeadBucketResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -HeadBucketResult& HeadBucketResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& bucketArnIter = headers.find("x-amz-bucket-arn"); - if (bucketArnIter != headers.end()) { - m_bucketArn = bucketArnIter->second; - m_bucketArnHasBeenSet = true; - } - - const auto& bucketLocationTypeIter = headers.find("x-amz-bucket-location-type"); - if (bucketLocationTypeIter != headers.end()) { - m_bucketLocationType = LocationTypeMapper::GetLocationTypeForName(bucketLocationTypeIter->second); - m_bucketLocationTypeHasBeenSet = true; - } - - const auto& bucketLocationNameIter = headers.find("x-amz-bucket-location-name"); - if (bucketLocationNameIter != headers.end()) { - m_bucketLocationName = bucketLocationNameIter->second; - m_bucketLocationNameHasBeenSet = true; - } - - const auto& bucketRegionIter = headers.find("x-amz-bucket-region"); - if (bucketRegionIter != headers.end()) { - m_bucketRegion = bucketRegionIter->second; - m_bucketRegionHasBeenSet = true; - } - - const auto& accessPointAliasIter = headers.find("x-amz-access-point-alias"); - if (accessPointAliasIter != headers.end()) { - m_accessPointAlias = StringUtils::ConvertToBool(accessPointAliasIter->second.c_str()); - m_accessPointAliasHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +HeadBucketResult& HeadBucketResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectRequest.cpp index bd837d11416..e18936a05ed 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,75 +19,103 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool HeadObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String HeadObjectRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection HeadObjectRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_ifMatchHasBeenSet) { + ss << m_ifMatch; + headers.emplace("if-match", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_ifModifiedSinceHasBeenSet) { + headers.emplace("if-modified-since", m_ifModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - return false; + if (m_ifNoneMatchHasBeenSet) { + ss << m_ifNoneMatch; + headers.emplace("if-none-match", ss.str()); + ss.str(""); + } + if (m_ifUnmodifiedSinceHasBeenSet) { + headers.emplace("if-unmodified-since", m_ifUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); + } + if (m_rangeHasBeenSet) { + ss << m_range; + headers.emplace("range", ss.str()); + ss.str(""); + } + if (m_sSECustomerAlgorithmHasBeenSet) { + ss << m_sSECustomerAlgorithm; + headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); + ss.str(""); + } + if (m_sSECustomerKeyHasBeenSet) { + ss << m_sSECustomerKey; + headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); + ss.str(""); + } + if (m_sSECustomerKeyMD5HasBeenSet) { + ss << m_sSECustomerKeyMD5; + headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); + ss.str(""); + } + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + if (m_checksumModeHasBeenSet && m_checksumMode != ChecksumMode::NOT_SET) { + headers.emplace("x-amz-checksum-mode", ChecksumModeMapper::GetNameForChecksumMode(m_checksumMode)); + } + return headers; } -Aws::String HeadObjectRequest::SerializePayload() const { return {}; } - -void HeadObjectRequest::AddQueryStringParameters(URI& uri) const { +void HeadObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_responseCacheControlHasBeenSet) { ss << m_responseCacheControl; uri.AddQueryStringParameter("response-cache-control", ss.str()); ss.str(""); } - if (m_responseContentDispositionHasBeenSet) { ss << m_responseContentDisposition; uri.AddQueryStringParameter("response-content-disposition", ss.str()); ss.str(""); } - if (m_responseContentEncodingHasBeenSet) { ss << m_responseContentEncoding; uri.AddQueryStringParameter("response-content-encoding", ss.str()); ss.str(""); } - if (m_responseContentLanguageHasBeenSet) { ss << m_responseContentLanguage; uri.AddQueryStringParameter("response-content-language", ss.str()); ss.str(""); } - if (m_responseContentTypeHasBeenSet) { ss << m_responseContentType; uri.AddQueryStringParameter("response-content-type", ss.str()); ss.str(""); } - if (m_responseExpiresHasBeenSet) { ss << m_responseExpires.ToGmtString(Aws::Utils::DateFormat::RFC822); uri.AddQueryStringParameter("response-expires", ss.str()); ss.str(""); } - if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (m_partNumberHasBeenSet) { ss << m_partNumber; uri.AddQueryStringParameter("partNumber", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -93,75 +124,24 @@ void HeadObjectRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection HeadObjectRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_ifMatchHasBeenSet) { - ss << m_ifMatch; - headers.emplace("if-match", ss.str()); - ss.str(""); - } - - if (m_ifModifiedSinceHasBeenSet) { - headers.emplace("if-modified-since", m_ifModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); - } - - if (m_ifNoneMatchHasBeenSet) { - ss << m_ifNoneMatch; - headers.emplace("if-none-match", ss.str()); - ss.str(""); - } - - if (m_ifUnmodifiedSinceHasBeenSet) { - headers.emplace("if-unmodified-since", m_ifUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); - } - - if (m_rangeHasBeenSet) { - ss << m_range; - headers.emplace("range", ss.str()); - ss.str(""); - } - - if (m_sSECustomerAlgorithmHasBeenSet) { - ss << m_sSECustomerAlgorithm; - headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); - ss.str(""); - } - - if (m_sSECustomerKeyHasBeenSet) { - ss << m_sSECustomerKey; - headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); - ss.str(""); - } - - if (m_sSECustomerKeyMD5HasBeenSet) { - ss << m_sSECustomerKeyMD5; - headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); - ss.str(""); - } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool HeadObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumModeHasBeenSet && m_checksumMode != ChecksumMode::NOT_SET) { - headers.emplace("x-amz-checksum-mode", ChecksumModeMapper::GetNameForChecksumMode(m_checksumMode)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } HeadObjectRequest::EndpointParameters HeadObjectRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectResult.cpp index de08ef14c4a..6e1180ac442 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/HeadObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,300 +20,4 @@ using namespace Aws; HeadObjectResult::HeadObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -HeadObjectResult& HeadObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& deleteMarkerIter = headers.find("x-amz-delete-marker"); - if (deleteMarkerIter != headers.end()) { - m_deleteMarker = StringUtils::ConvertToBool(deleteMarkerIter->second.c_str()); - m_deleteMarkerHasBeenSet = true; - } - - const auto& acceptRangesIter = headers.find("accept-ranges"); - if (acceptRangesIter != headers.end()) { - m_acceptRanges = acceptRangesIter->second; - m_acceptRangesHasBeenSet = true; - } - - const auto& expirationIter = headers.find("x-amz-expiration"); - if (expirationIter != headers.end()) { - m_expiration = expirationIter->second; - m_expirationHasBeenSet = true; - } - - const auto& restoreIter = headers.find("x-amz-restore"); - if (restoreIter != headers.end()) { - m_restore = restoreIter->second; - m_restoreHasBeenSet = true; - } - - const auto& archiveStatusIter = headers.find("x-amz-archive-status"); - if (archiveStatusIter != headers.end()) { - m_archiveStatus = ArchiveStatusMapper::GetArchiveStatusForName(archiveStatusIter->second); - m_archiveStatusHasBeenSet = true; - } - - const auto& lastModifiedIter = headers.find("last-modified"); - if (lastModifiedIter != headers.end()) { - m_lastModified = DateTime(lastModifiedIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_lastModified.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::HeadObjectResult", - "Failed to parse lastModified header as an RFC822 timestamp: " << lastModifiedIter->second.c_str()); - } - m_lastModifiedHasBeenSet = true; - } - - const auto& contentLengthIter = headers.find("content-length"); - if (contentLengthIter != headers.end()) { - m_contentLength = StringUtils::ConvertToInt64(contentLengthIter->second.c_str()); - m_contentLengthHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& missingMetaIter = headers.find("x-amz-missing-meta"); - if (missingMetaIter != headers.end()) { - m_missingMeta = StringUtils::ConvertToInt32(missingMetaIter->second.c_str()); - m_missingMetaHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& cacheControlIter = headers.find("cache-control"); - if (cacheControlIter != headers.end()) { - m_cacheControl = cacheControlIter->second; - m_cacheControlHasBeenSet = true; - } - - const auto& contentDispositionIter = headers.find("content-disposition"); - if (contentDispositionIter != headers.end()) { - m_contentDisposition = contentDispositionIter->second; - m_contentDispositionHasBeenSet = true; - } - - const auto& contentEncodingIter = headers.find("content-encoding"); - if (contentEncodingIter != headers.end()) { - m_contentEncoding = contentEncodingIter->second; - m_contentEncodingHasBeenSet = true; - } - - const auto& contentLanguageIter = headers.find("content-language"); - if (contentLanguageIter != headers.end()) { - m_contentLanguage = contentLanguageIter->second; - m_contentLanguageHasBeenSet = true; - } - - const auto& contentTypeIter = headers.find("content-type"); - if (contentTypeIter != headers.end()) { - m_contentType = contentTypeIter->second; - m_contentTypeHasBeenSet = true; - } - - const auto& contentRangeIter = headers.find("content-range"); - if (contentRangeIter != headers.end()) { - m_contentRange = contentRangeIter->second; - m_contentRangeHasBeenSet = true; - } - - const auto& expiresIter = headers.find("expires"); - if (expiresIter != headers.end()) { - m_expires = DateTime(expiresIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_expires.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::HeadObjectResult", "Failed to parse expires header as an RFC822 timestamp: " << expiresIter->second.c_str()); - } - m_expiresHasBeenSet = true; - } - - const auto& websiteRedirectLocationIter = headers.find("x-amz-website-redirect-location"); - if (websiteRedirectLocationIter != headers.end()) { - m_websiteRedirectLocation = websiteRedirectLocationIter->second; - m_websiteRedirectLocationHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - std::size_t prefixSize = sizeof("x-amz-meta-") - 1; // subtract the NULL terminator out - for (const auto& item : headers) { - std::size_t foundPrefix = item.first.find("x-amz-meta-"); - - if (foundPrefix != std::string::npos) { - m_metadata[item.first.substr(prefixSize)] = item.second; - m_metadataHasBeenSet = true; - } - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& storageClassIter = headers.find("x-amz-storage-class"); - if (storageClassIter != headers.end()) { - m_storageClass = StorageClassMapper::GetStorageClassForName(storageClassIter->second); - m_storageClassHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& replicationStatusIter = headers.find("x-amz-replication-status"); - if (replicationStatusIter != headers.end()) { - m_replicationStatus = ReplicationStatusMapper::GetReplicationStatusForName(replicationStatusIter->second); - m_replicationStatusHasBeenSet = true; - } - - const auto& partsCountIter = headers.find("x-amz-mp-parts-count"); - if (partsCountIter != headers.end()) { - m_partsCount = StringUtils::ConvertToInt32(partsCountIter->second.c_str()); - m_partsCountHasBeenSet = true; - } - - const auto& tagCountIter = headers.find("x-amz-tagging-count"); - if (tagCountIter != headers.end()) { - m_tagCount = StringUtils::ConvertToInt32(tagCountIter->second.c_str()); - m_tagCountHasBeenSet = true; - } - - const auto& objectLockModeIter = headers.find("x-amz-object-lock-mode"); - if (objectLockModeIter != headers.end()) { - m_objectLockMode = ObjectLockModeMapper::GetObjectLockModeForName(objectLockModeIter->second); - m_objectLockModeHasBeenSet = true; - } - - const auto& objectLockRetainUntilDateIter = headers.find("x-amz-object-lock-retain-until-date"); - if (objectLockRetainUntilDateIter != headers.end()) { - m_objectLockRetainUntilDate = DateTime(objectLockRetainUntilDateIter->second.c_str(), Aws::Utils::DateFormat::ISO_8601); - if (!m_objectLockRetainUntilDate.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::HeadObjectResult", "Failed to parse objectLockRetainUntilDate header as an ISO_8601 timestamp: " - << objectLockRetainUntilDateIter->second.c_str()); - } - m_objectLockRetainUntilDateHasBeenSet = true; - } - - const auto& objectLockLegalHoldStatusIter = headers.find("x-amz-object-lock-legal-hold"); - if (objectLockLegalHoldStatusIter != headers.end()) { - m_objectLockLegalHoldStatus = - ObjectLockLegalHoldStatusMapper::GetObjectLockLegalHoldStatusForName(objectLockLegalHoldStatusIter->second); - m_objectLockLegalHoldStatusHasBeenSet = true; - } - - const auto& expiresStringIter = headers.find("expires"); - if (expiresStringIter != headers.end()) { - m_expiresString = expiresStringIter->second; - m_expiresStringHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +HeadObjectResult& HeadObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IndexDocument.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IndexDocument.cpp index 5294db6b18a..45d91fa8e84 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IndexDocument.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IndexDocument.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { IndexDocument::IndexDocument(const XmlNode& xmlNode) { *this = xmlNode; } -IndexDocument& IndexDocument::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode suffixNode = resultNode.FirstChild("Suffix"); - if (!suffixNode.IsNull()) { - m_suffix = Aws::Utils::Xml::DecodeEscapedXmlText(suffixNode.GetText()); - m_suffixHasBeenSet = true; - } - } - - return *this; -} - -void IndexDocument::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_suffixHasBeenSet) { - XmlNode suffixNode = parentNode.CreateChildElement("Suffix"); - suffixNode.SetText(m_suffix); - } -} +IndexDocument& IndexDocument::operator=(const XmlNode& xmlNode) { return *this; } + +void IndexDocument::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Initiator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Initiator.cpp index 282f492bd25..6bc4015df0a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Initiator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Initiator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { Initiator::Initiator(const XmlNode& xmlNode) { *this = xmlNode; } -Initiator& Initiator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - XmlNode displayNameNode = resultNode.FirstChild("DisplayName"); - if (!displayNameNode.IsNull()) { - m_displayName = Aws::Utils::Xml::DecodeEscapedXmlText(displayNameNode.GetText()); - m_displayNameHasBeenSet = true; - } - } - - return *this; -} - -void Initiator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_displayNameHasBeenSet) { - XmlNode displayNameNode = parentNode.CreateChildElement("DisplayName"); - displayNameNode.SetText(m_displayName); - } -} +Initiator& Initiator::operator=(const XmlNode& xmlNode) { return *this; } + +void Initiator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InputSerialization.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InputSerialization.cpp index 452d574d963..7cffa744a20 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InputSerialization.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InputSerialization.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,58 +20,9 @@ namespace Model { InputSerialization::InputSerialization(const XmlNode& xmlNode) { *this = xmlNode; } -InputSerialization& InputSerialization::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +InputSerialization& InputSerialization::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode cSVNode = resultNode.FirstChild("CSV"); - if (!cSVNode.IsNull()) { - m_cSV = cSVNode; - m_cSVHasBeenSet = true; - } - XmlNode compressionTypeNode = resultNode.FirstChild("CompressionType"); - if (!compressionTypeNode.IsNull()) { - m_compressionType = CompressionTypeMapper::GetCompressionTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(compressionTypeNode.GetText()).c_str())); - m_compressionTypeHasBeenSet = true; - } - XmlNode jSONNode = resultNode.FirstChild("JSON"); - if (!jSONNode.IsNull()) { - m_jSON = jSONNode; - m_jSONHasBeenSet = true; - } - XmlNode parquetNode = resultNode.FirstChild("Parquet"); - if (!parquetNode.IsNull()) { - m_parquet = parquetNode; - m_parquetHasBeenSet = true; - } - } - - return *this; -} - -void InputSerialization::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_cSVHasBeenSet) { - XmlNode cSVNode = parentNode.CreateChildElement("CSV"); - m_cSV.AddToNode(cSVNode); - } - - if (m_compressionTypeHasBeenSet) { - XmlNode compressionTypeNode = parentNode.CreateChildElement("CompressionType"); - compressionTypeNode.SetText(CompressionTypeMapper::GetNameForCompressionType(m_compressionType)); - } - - if (m_jSONHasBeenSet) { - XmlNode jSONNode = parentNode.CreateChildElement("JSON"); - m_jSON.AddToNode(jSONNode); - } - - if (m_parquetHasBeenSet) { - XmlNode parquetNode = parentNode.CreateChildElement("Parquet"); - m_parquet.AddToNode(parquetNode); - } -} +void InputSerialization::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAccessTier.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAccessTier.cpp index 9c152968762..a05eee7bfcd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAccessTier.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAccessTier.cpp @@ -30,7 +30,6 @@ IntelligentTieringAccessTier GetIntelligentTieringAccessTierForName(const Aws::S overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return IntelligentTieringAccessTier::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForIntelligentTieringAccessTier(IntelligentTieringAccessTier if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAndOperator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAndOperator.cpp index b770cde695a..6bed03884ac 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAndOperator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringAndOperator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,45 +20,9 @@ namespace Model { IntelligentTieringAndOperator::IntelligentTieringAndOperator(const XmlNode& xmlNode) { *this = xmlNode; } -IntelligentTieringAndOperator& IntelligentTieringAndOperator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +IntelligentTieringAndOperator& IntelligentTieringAndOperator::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tag"); - if (!tagsNode.IsNull()) { - XmlNode tagMember = tagsNode; - m_tagsHasBeenSet = !tagMember.IsNull(); - while (!tagMember.IsNull()) { - m_tags.push_back(tagMember); - tagMember = tagMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - } - - return *this; -} - -void IntelligentTieringAndOperator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagsHasBeenSet) { - for (const auto& item : m_tags) { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } -} +void IntelligentTieringAndOperator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringConfiguration.cpp index 57726dbbdf1..c169a22606e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,66 +20,9 @@ namespace Model { IntelligentTieringConfiguration::IntelligentTieringConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -IntelligentTieringConfiguration& IntelligentTieringConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +IntelligentTieringConfiguration& IntelligentTieringConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = IntelligentTieringStatusMapper::GetIntelligentTieringStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode tieringsNode = resultNode.FirstChild("Tiering"); - if (!tieringsNode.IsNull()) { - XmlNode tieringMember = tieringsNode; - m_tieringsHasBeenSet = !tieringMember.IsNull(); - while (!tieringMember.IsNull()) { - m_tierings.push_back(tieringMember); - tieringMember = tieringMember.NextNode("Tiering"); - } - - m_tieringsHasBeenSet = true; - } - } - - return *this; -} - -void IntelligentTieringConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(IntelligentTieringStatusMapper::GetNameForIntelligentTieringStatus(m_status)); - } - - if (m_tieringsHasBeenSet) { - for (const auto& item : m_tierings) { - XmlNode tieringsNode = parentNode.CreateChildElement("Tiering"); - item.AddToNode(tieringsNode); - } - } -} +void IntelligentTieringConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringFilter.cpp index 1a846332476..e650f682500 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { IntelligentTieringFilter::IntelligentTieringFilter(const XmlNode& xmlNode) { *this = xmlNode; } -IntelligentTieringFilter& IntelligentTieringFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +IntelligentTieringFilter& IntelligentTieringFilter::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if (!tagNode.IsNull()) { - m_tag = tagNode; - m_tagHasBeenSet = true; - } - XmlNode andNode = resultNode.FirstChild("And"); - if (!andNode.IsNull()) { - m_and = andNode; - m_andHasBeenSet = true; - } - } - - return *this; -} - -void IntelligentTieringFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); - } - - if (m_andHasBeenSet) { - XmlNode andNode = parentNode.CreateChildElement("And"); - m_and.AddToNode(andNode); - } -} +void IntelligentTieringFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringStatus.cpp index 3299d370770..4ae275aa375 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/IntelligentTieringStatus.cpp @@ -30,7 +30,6 @@ IntelligentTieringStatus GetIntelligentTieringStatusForName(const Aws::String& n overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return IntelligentTieringStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForIntelligentTieringStatus(IntelligentTieringStatus enumValu if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InvalidObjectState.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InvalidObjectState.cpp index e882aea7a24..d5fd779764a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InvalidObjectState.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InvalidObjectState.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,39 +20,9 @@ namespace Model { InvalidObjectState::InvalidObjectState(const XmlNode& xmlNode) { *this = xmlNode; } -InvalidObjectState& InvalidObjectState::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode accessTierNode = resultNode.FirstChild("AccessTier"); - if (!accessTierNode.IsNull()) { - m_accessTier = IntelligentTieringAccessTierMapper::GetIntelligentTieringAccessTierForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(accessTierNode.GetText()).c_str())); - m_accessTierHasBeenSet = true; - } - } - - return *this; -} - -void InvalidObjectState::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(StorageClassMapper::GetNameForStorageClass(m_storageClass)); - } - - if (m_accessTierHasBeenSet) { - XmlNode accessTierNode = parentNode.CreateChildElement("AccessTier"); - accessTierNode.SetText(IntelligentTieringAccessTierMapper::GetNameForIntelligentTieringAccessTier(m_accessTier)); - } -} +InvalidObjectState& InvalidObjectState::operator=(const XmlNode& xmlNode) { return *this; } + +void InvalidObjectState::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfiguration.cpp index 1413ab24718..4fb69115bc1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,102 +20,9 @@ namespace Model { InventoryConfiguration::InventoryConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryConfiguration& InventoryConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +InventoryConfiguration& InventoryConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode destinationNode = resultNode.FirstChild("Destination"); - if (!destinationNode.IsNull()) { - m_destination = destinationNode; - m_destinationHasBeenSet = true; - } - XmlNode isEnabledNode = resultNode.FirstChild("IsEnabled"); - if (!isEnabledNode.IsNull()) { - m_isEnabled = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isEnabledNode.GetText()).c_str()).c_str()); - m_isEnabledHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode includedObjectVersionsNode = resultNode.FirstChild("IncludedObjectVersions"); - if (!includedObjectVersionsNode.IsNull()) { - m_includedObjectVersions = InventoryIncludedObjectVersionsMapper::GetInventoryIncludedObjectVersionsForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(includedObjectVersionsNode.GetText()).c_str())); - m_includedObjectVersionsHasBeenSet = true; - } - XmlNode optionalFieldsNode = resultNode.FirstChild("OptionalFields"); - if (!optionalFieldsNode.IsNull()) { - XmlNode optionalFieldsMember = optionalFieldsNode.FirstChild("Field"); - m_optionalFieldsHasBeenSet = !optionalFieldsMember.IsNull(); - while (!optionalFieldsMember.IsNull()) { - m_optionalFields.push_back( - InventoryOptionalFieldMapper::GetInventoryOptionalFieldForName(StringUtils::Trim(optionalFieldsMember.GetText().c_str()))); - optionalFieldsMember = optionalFieldsMember.NextNode("Field"); - } - - m_optionalFieldsHasBeenSet = true; - } - XmlNode scheduleNode = resultNode.FirstChild("Schedule"); - if (!scheduleNode.IsNull()) { - m_schedule = scheduleNode; - m_scheduleHasBeenSet = true; - } - } - - return *this; -} - -void InventoryConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_destinationHasBeenSet) { - XmlNode destinationNode = parentNode.CreateChildElement("Destination"); - m_destination.AddToNode(destinationNode); - } - - if (m_isEnabledHasBeenSet) { - XmlNode isEnabledNode = parentNode.CreateChildElement("IsEnabled"); - ss << std::boolalpha << m_isEnabled; - isEnabledNode.SetText(ss.str()); - ss.str(""); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } - - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_includedObjectVersionsHasBeenSet) { - XmlNode includedObjectVersionsNode = parentNode.CreateChildElement("IncludedObjectVersions"); - includedObjectVersionsNode.SetText( - InventoryIncludedObjectVersionsMapper::GetNameForInventoryIncludedObjectVersions(m_includedObjectVersions)); - } - - if (m_optionalFieldsHasBeenSet) { - XmlNode optionalFieldsParentNode = parentNode.CreateChildElement("OptionalFields"); - for (const auto& item : m_optionalFields) { - XmlNode optionalFieldsNode = optionalFieldsParentNode.CreateChildElement("Field"); - optionalFieldsNode.SetText(InventoryOptionalFieldMapper::GetNameForInventoryOptionalField(item)); - } - } - - if (m_scheduleHasBeenSet) { - XmlNode scheduleNode = parentNode.CreateChildElement("Schedule"); - m_schedule.AddToNode(scheduleNode); - } -} +void InventoryConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfigurationState.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfigurationState.cpp index 33178c372e2..36d295aa11f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfigurationState.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryConfigurationState.cpp @@ -30,7 +30,6 @@ InventoryConfigurationState GetInventoryConfigurationStateForName(const Aws::Str overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InventoryConfigurationState::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForInventoryConfigurationState(InventoryConfigurationState en if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryDestination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryDestination.cpp index 2c36d1677c2..8456616ae2a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryDestination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryDestination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { InventoryDestination::InventoryDestination(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryDestination& InventoryDestination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode s3BucketDestinationNode = resultNode.FirstChild("S3BucketDestination"); - if (!s3BucketDestinationNode.IsNull()) { - m_s3BucketDestination = s3BucketDestinationNode; - m_s3BucketDestinationHasBeenSet = true; - } - } - - return *this; -} - -void InventoryDestination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_s3BucketDestinationHasBeenSet) { - XmlNode s3BucketDestinationNode = parentNode.CreateChildElement("S3BucketDestination"); - m_s3BucketDestination.AddToNode(s3BucketDestinationNode); - } -} +InventoryDestination& InventoryDestination::operator=(const XmlNode& xmlNode) { return *this; } + +void InventoryDestination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryEncryption.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryEncryption.cpp index 8c83b832e97..bb99fadf4ae 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryEncryption.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryEncryption.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { InventoryEncryption::InventoryEncryption(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryEncryption& InventoryEncryption::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode sSES3Node = resultNode.FirstChild("SSE-S3"); - if (!sSES3Node.IsNull()) { - m_sSES3 = sSES3Node; - m_sSES3HasBeenSet = true; - } - XmlNode sSEKMSNode = resultNode.FirstChild("SSE-KMS"); - if (!sSEKMSNode.IsNull()) { - m_sSEKMS = sSEKMSNode; - m_sSEKMSHasBeenSet = true; - } - } - - return *this; -} - -void InventoryEncryption::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_sSES3HasBeenSet) { - XmlNode sSES3Node = parentNode.CreateChildElement("SSE-S3"); - m_sSES3.AddToNode(sSES3Node); - } - - if (m_sSEKMSHasBeenSet) { - XmlNode sSEKMSNode = parentNode.CreateChildElement("SSE-KMS"); - m_sSEKMS.AddToNode(sSEKMSNode); - } -} +InventoryEncryption& InventoryEncryption::operator=(const XmlNode& xmlNode) { return *this; } + +void InventoryEncryption::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFilter.cpp index 316a92230dd..81822f8918c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { InventoryFilter::InventoryFilter(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryFilter& InventoryFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - } - - return *this; -} - -void InventoryFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } -} +InventoryFilter& InventoryFilter::operator=(const XmlNode& xmlNode) { return *this; } + +void InventoryFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFormat.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFormat.cpp index 9c76623ce9d..48aa6a62efe 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFormat.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFormat.cpp @@ -33,7 +33,6 @@ InventoryFormat GetInventoryFormatForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InventoryFormat::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForInventoryFormat(InventoryFormat enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFrequency.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFrequency.cpp index 608adf021d2..8c90d53b112 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryFrequency.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryFrequency.cpp @@ -30,7 +30,6 @@ InventoryFrequency GetInventoryFrequencyForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InventoryFrequency::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForInventoryFrequency(InventoryFrequency enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryIncludedObjectVersions.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryIncludedObjectVersions.cpp index 99416332275..fddfed3f6f5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryIncludedObjectVersions.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryIncludedObjectVersions.cpp @@ -30,7 +30,6 @@ InventoryIncludedObjectVersions GetInventoryIncludedObjectVersionsForName(const overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InventoryIncludedObjectVersions::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForInventoryIncludedObjectVersions(InventoryIncludedObjectVer if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryOptionalField.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryOptionalField.cpp index 777aa853784..99b4a343eca 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryOptionalField.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryOptionalField.cpp @@ -72,7 +72,6 @@ InventoryOptionalField GetInventoryOptionalFieldForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InventoryOptionalField::NOT_SET; } @@ -117,7 +116,6 @@ Aws::String GetNameForInventoryOptionalField(InventoryOptionalField enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryS3BucketDestination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryS3BucketDestination.cpp index 7818699946d..f1384af8f26 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryS3BucketDestination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryS3BucketDestination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,68 +20,9 @@ namespace Model { InventoryS3BucketDestination::InventoryS3BucketDestination(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryS3BucketDestination& InventoryS3BucketDestination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +InventoryS3BucketDestination& InventoryS3BucketDestination::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode accountIdNode = resultNode.FirstChild("AccountId"); - if (!accountIdNode.IsNull()) { - m_accountId = Aws::Utils::Xml::DecodeEscapedXmlText(accountIdNode.GetText()); - m_accountIdHasBeenSet = true; - } - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode formatNode = resultNode.FirstChild("Format"); - if (!formatNode.IsNull()) { - m_format = InventoryFormatMapper::GetInventoryFormatForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(formatNode.GetText()).c_str())); - m_formatHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode encryptionNode = resultNode.FirstChild("Encryption"); - if (!encryptionNode.IsNull()) { - m_encryption = encryptionNode; - m_encryptionHasBeenSet = true; - } - } - - return *this; -} - -void InventoryS3BucketDestination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_accountIdHasBeenSet) { - XmlNode accountIdNode = parentNode.CreateChildElement("AccountId"); - accountIdNode.SetText(m_accountId); - } - - if (m_bucketHasBeenSet) { - XmlNode bucketNode = parentNode.CreateChildElement("Bucket"); - bucketNode.SetText(m_bucket); - } - - if (m_formatHasBeenSet) { - XmlNode formatNode = parentNode.CreateChildElement("Format"); - formatNode.SetText(InventoryFormatMapper::GetNameForInventoryFormat(m_format)); - } - - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_encryptionHasBeenSet) { - XmlNode encryptionNode = parentNode.CreateChildElement("Encryption"); - m_encryption.AddToNode(encryptionNode); - } -} +void InventoryS3BucketDestination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventorySchedule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventorySchedule.cpp index 41db3e1974a..62203952a77 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventorySchedule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventorySchedule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { InventorySchedule::InventorySchedule(const XmlNode& xmlNode) { *this = xmlNode; } -InventorySchedule& InventorySchedule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode frequencyNode = resultNode.FirstChild("Frequency"); - if (!frequencyNode.IsNull()) { - m_frequency = InventoryFrequencyMapper::GetInventoryFrequencyForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(frequencyNode.GetText()).c_str())); - m_frequencyHasBeenSet = true; - } - } - - return *this; -} - -void InventorySchedule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_frequencyHasBeenSet) { - XmlNode frequencyNode = parentNode.CreateChildElement("Frequency"); - frequencyNode.SetText(InventoryFrequencyMapper::GetNameForInventoryFrequency(m_frequency)); - } -} +InventorySchedule& InventorySchedule::operator=(const XmlNode& xmlNode) { return *this; } + +void InventorySchedule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfiguration.cpp index 28acca79f2a..bdbe7029df9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { InventoryTableConfiguration::InventoryTableConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryTableConfiguration& InventoryTableConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = InventoryConfigurationStateMapper::GetInventoryConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void InventoryTableConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(InventoryConfigurationStateMapper::GetNameForInventoryConfigurationState(m_configurationState)); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } -} +InventoryTableConfiguration& InventoryTableConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void InventoryTableConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationResult.cpp index cae2f9a28bc..0c9adf97a8a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,68 +20,9 @@ namespace Model { InventoryTableConfigurationResult::InventoryTableConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryTableConfigurationResult& InventoryTableConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +InventoryTableConfigurationResult& InventoryTableConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = InventoryConfigurationStateMapper::GetInventoryConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode tableStatusNode = resultNode.FirstChild("TableStatus"); - if (!tableStatusNode.IsNull()) { - m_tableStatus = Aws::Utils::Xml::DecodeEscapedXmlText(tableStatusNode.GetText()); - m_tableStatusHasBeenSet = true; - } - XmlNode errorNode = resultNode.FirstChild("Error"); - if (!errorNode.IsNull()) { - m_error = errorNode; - m_errorHasBeenSet = true; - } - XmlNode tableNameNode = resultNode.FirstChild("TableName"); - if (!tableNameNode.IsNull()) { - m_tableName = Aws::Utils::Xml::DecodeEscapedXmlText(tableNameNode.GetText()); - m_tableNameHasBeenSet = true; - } - XmlNode tableArnNode = resultNode.FirstChild("TableArn"); - if (!tableArnNode.IsNull()) { - m_tableArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableArnNode.GetText()); - m_tableArnHasBeenSet = true; - } - } - - return *this; -} - -void InventoryTableConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(InventoryConfigurationStateMapper::GetNameForInventoryConfigurationState(m_configurationState)); - } - - if (m_tableStatusHasBeenSet) { - XmlNode tableStatusNode = parentNode.CreateChildElement("TableStatus"); - tableStatusNode.SetText(m_tableStatus); - } - - if (m_errorHasBeenSet) { - XmlNode errorNode = parentNode.CreateChildElement("Error"); - m_error.AddToNode(errorNode); - } - - if (m_tableNameHasBeenSet) { - XmlNode tableNameNode = parentNode.CreateChildElement("TableName"); - tableNameNode.SetText(m_tableName); - } - - if (m_tableArnHasBeenSet) { - XmlNode tableArnNode = parentNode.CreateChildElement("TableArn"); - tableArnNode.SetText(m_tableArn); - } -} +void InventoryTableConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationUpdates.cpp b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationUpdates.cpp index 3e03afbab7a..0c4b24cb225 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationUpdates.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/InventoryTableConfigurationUpdates.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { InventoryTableConfigurationUpdates::InventoryTableConfigurationUpdates(const XmlNode& xmlNode) { *this = xmlNode; } -InventoryTableConfigurationUpdates& InventoryTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode configurationStateNode = resultNode.FirstChild("ConfigurationState"); - if (!configurationStateNode.IsNull()) { - m_configurationState = InventoryConfigurationStateMapper::GetInventoryConfigurationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(configurationStateNode.GetText()).c_str())); - m_configurationStateHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void InventoryTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_configurationStateHasBeenSet) { - XmlNode configurationStateNode = parentNode.CreateChildElement("ConfigurationState"); - configurationStateNode.SetText(InventoryConfigurationStateMapper::GetNameForInventoryConfigurationState(m_configurationState)); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } -} +InventoryTableConfigurationUpdates& InventoryTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { return *this; } + +void InventoryTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JSONInput.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JSONInput.cpp index e60a43ff278..56f7a437e64 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JSONInput.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JSONInput.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { JSONInput::JSONInput(const XmlNode& xmlNode) { *this = xmlNode; } -JSONInput& JSONInput::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode typeNode = resultNode.FirstChild("Type"); - if (!typeNode.IsNull()) { - m_type = JSONTypeMapper::GetJSONTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(typeNode.GetText()).c_str())); - m_typeHasBeenSet = true; - } - } - - return *this; -} - -void JSONInput::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_typeHasBeenSet) { - XmlNode typeNode = parentNode.CreateChildElement("Type"); - typeNode.SetText(JSONTypeMapper::GetNameForJSONType(m_type)); - } -} +JSONInput& JSONInput::operator=(const XmlNode& xmlNode) { return *this; } + +void JSONInput::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JSONOutput.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JSONOutput.cpp index feedb063228..30818a12bb3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JSONOutput.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JSONOutput.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { JSONOutput::JSONOutput(const XmlNode& xmlNode) { *this = xmlNode; } -JSONOutput& JSONOutput::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode recordDelimiterNode = resultNode.FirstChild("RecordDelimiter"); - if (!recordDelimiterNode.IsNull()) { - m_recordDelimiter = Aws::Utils::Xml::DecodeEscapedXmlText(recordDelimiterNode.GetText()); - m_recordDelimiterHasBeenSet = true; - } - } - - return *this; -} - -void JSONOutput::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_recordDelimiterHasBeenSet) { - XmlNode recordDelimiterNode = parentNode.CreateChildElement("RecordDelimiter"); - recordDelimiterNode.SetText(m_recordDelimiter); - } -} +JSONOutput& JSONOutput::operator=(const XmlNode& xmlNode) { return *this; } + +void JSONOutput::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JSONType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JSONType.cpp index d4bae377426..11324f0e378 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JSONType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JSONType.cpp @@ -30,7 +30,6 @@ JSONType GetJSONTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return JSONType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForJSONType(JSONType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfiguration.cpp index 315c4f04425..90272547d5c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { JournalTableConfiguration::JournalTableConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -JournalTableConfiguration& JournalTableConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode recordExpirationNode = resultNode.FirstChild("RecordExpiration"); - if (!recordExpirationNode.IsNull()) { - m_recordExpiration = recordExpirationNode; - m_recordExpirationHasBeenSet = true; - } - XmlNode encryptionConfigurationNode = resultNode.FirstChild("EncryptionConfiguration"); - if (!encryptionConfigurationNode.IsNull()) { - m_encryptionConfiguration = encryptionConfigurationNode; - m_encryptionConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void JournalTableConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_recordExpirationHasBeenSet) { - XmlNode recordExpirationNode = parentNode.CreateChildElement("RecordExpiration"); - m_recordExpiration.AddToNode(recordExpirationNode); - } - - if (m_encryptionConfigurationHasBeenSet) { - XmlNode encryptionConfigurationNode = parentNode.CreateChildElement("EncryptionConfiguration"); - m_encryptionConfiguration.AddToNode(encryptionConfigurationNode); - } -} +JournalTableConfiguration& JournalTableConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void JournalTableConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationResult.cpp index 76b6525c16d..a0d1a28ee59 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,67 +20,9 @@ namespace Model { JournalTableConfigurationResult::JournalTableConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -JournalTableConfigurationResult& JournalTableConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +JournalTableConfigurationResult& JournalTableConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode tableStatusNode = resultNode.FirstChild("TableStatus"); - if (!tableStatusNode.IsNull()) { - m_tableStatus = Aws::Utils::Xml::DecodeEscapedXmlText(tableStatusNode.GetText()); - m_tableStatusHasBeenSet = true; - } - XmlNode errorNode = resultNode.FirstChild("Error"); - if (!errorNode.IsNull()) { - m_error = errorNode; - m_errorHasBeenSet = true; - } - XmlNode tableNameNode = resultNode.FirstChild("TableName"); - if (!tableNameNode.IsNull()) { - m_tableName = Aws::Utils::Xml::DecodeEscapedXmlText(tableNameNode.GetText()); - m_tableNameHasBeenSet = true; - } - XmlNode tableArnNode = resultNode.FirstChild("TableArn"); - if (!tableArnNode.IsNull()) { - m_tableArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableArnNode.GetText()); - m_tableArnHasBeenSet = true; - } - XmlNode recordExpirationNode = resultNode.FirstChild("RecordExpiration"); - if (!recordExpirationNode.IsNull()) { - m_recordExpiration = recordExpirationNode; - m_recordExpirationHasBeenSet = true; - } - } - - return *this; -} - -void JournalTableConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tableStatusHasBeenSet) { - XmlNode tableStatusNode = parentNode.CreateChildElement("TableStatus"); - tableStatusNode.SetText(m_tableStatus); - } - - if (m_errorHasBeenSet) { - XmlNode errorNode = parentNode.CreateChildElement("Error"); - m_error.AddToNode(errorNode); - } - - if (m_tableNameHasBeenSet) { - XmlNode tableNameNode = parentNode.CreateChildElement("TableName"); - tableNameNode.SetText(m_tableName); - } - - if (m_tableArnHasBeenSet) { - XmlNode tableArnNode = parentNode.CreateChildElement("TableArn"); - tableArnNode.SetText(m_tableArn); - } - - if (m_recordExpirationHasBeenSet) { - XmlNode recordExpirationNode = parentNode.CreateChildElement("RecordExpiration"); - m_recordExpiration.AddToNode(recordExpirationNode); - } -} +void JournalTableConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationUpdates.cpp b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationUpdates.cpp index b635fc47215..f359c9ddaf4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationUpdates.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/JournalTableConfigurationUpdates.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { JournalTableConfigurationUpdates::JournalTableConfigurationUpdates(const XmlNode& xmlNode) { *this = xmlNode; } -JournalTableConfigurationUpdates& JournalTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode recordExpirationNode = resultNode.FirstChild("RecordExpiration"); - if (!recordExpirationNode.IsNull()) { - m_recordExpiration = recordExpirationNode; - m_recordExpirationHasBeenSet = true; - } - } - - return *this; -} - -void JournalTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_recordExpirationHasBeenSet) { - XmlNode recordExpirationNode = parentNode.CreateChildElement("RecordExpiration"); - m_recordExpiration.AddToNode(recordExpirationNode); - } -} +JournalTableConfigurationUpdates& JournalTableConfigurationUpdates::operator=(const XmlNode& xmlNode) { return *this; } + +void JournalTableConfigurationUpdates::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LambdaFunctionConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LambdaFunctionConfiguration.cpp index 404d66d7646..a8e5f432110 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LambdaFunctionConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LambdaFunctionConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,65 +20,9 @@ namespace Model { LambdaFunctionConfiguration::LambdaFunctionConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -LambdaFunctionConfiguration& LambdaFunctionConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LambdaFunctionConfiguration& LambdaFunctionConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode lambdaFunctionArnNode = resultNode.FirstChild("CloudFunction"); - if (!lambdaFunctionArnNode.IsNull()) { - m_lambdaFunctionArn = Aws::Utils::Xml::DecodeEscapedXmlText(lambdaFunctionArnNode.GetText()); - m_lambdaFunctionArnHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - } - - return *this; -} - -void LambdaFunctionConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_lambdaFunctionArnHasBeenSet) { - XmlNode lambdaFunctionArnNode = parentNode.CreateChildElement("CloudFunction"); - lambdaFunctionArnNode.SetText(m_lambdaFunctionArn); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } -} +void LambdaFunctionConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleConfiguration.cpp deleted file mode 100644 index 4a32999bd04..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleConfiguration.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -LifecycleConfiguration::LifecycleConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } - -LifecycleConfiguration& LifecycleConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - return *this; -} - -void LifecycleConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_rulesHasBeenSet) { - for (const auto& item : m_rules) { - XmlNode rulesNode = parentNode.CreateChildElement("Rule"); - item.AddToNode(rulesNode); - } - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleExpiration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleExpiration.cpp index 211639de999..f5e0374118f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleExpiration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleExpiration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,53 +20,9 @@ namespace Model { LifecycleExpiration::LifecycleExpiration(const XmlNode& xmlNode) { *this = xmlNode; } -LifecycleExpiration& LifecycleExpiration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LifecycleExpiration& LifecycleExpiration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode dateNode = resultNode.FirstChild("Date"); - if (!dateNode.IsNull()) { - m_date = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(dateNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_dateHasBeenSet = true; - } - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - XmlNode expiredObjectDeleteMarkerNode = resultNode.FirstChild("ExpiredObjectDeleteMarker"); - if (!expiredObjectDeleteMarkerNode.IsNull()) { - m_expiredObjectDeleteMarker = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(expiredObjectDeleteMarkerNode.GetText()).c_str()).c_str()); - m_expiredObjectDeleteMarkerHasBeenSet = true; - } - } - - return *this; -} - -void LifecycleExpiration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_dateHasBeenSet) { - XmlNode dateNode = parentNode.CreateChildElement("Date"); - dateNode.SetText(m_date.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_expiredObjectDeleteMarkerHasBeenSet) { - XmlNode expiredObjectDeleteMarkerNode = parentNode.CreateChildElement("ExpiredObjectDeleteMarker"); - ss << std::boolalpha << m_expiredObjectDeleteMarker; - expiredObjectDeleteMarkerNode.SetText(ss.str()); - ss.str(""); - } -} +void LifecycleExpiration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRule.cpp index aa2db7eeb85..32fdecdc131 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,114 +20,9 @@ namespace Model { LifecycleRule::LifecycleRule(const XmlNode& xmlNode) { *this = xmlNode; } -LifecycleRule& LifecycleRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LifecycleRule& LifecycleRule::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode expirationNode = resultNode.FirstChild("Expiration"); - if (!expirationNode.IsNull()) { - m_expiration = expirationNode; - m_expirationHasBeenSet = true; - } - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ExpirationStatusMapper::GetExpirationStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode transitionsNode = resultNode.FirstChild("Transition"); - if (!transitionsNode.IsNull()) { - XmlNode transitionMember = transitionsNode; - m_transitionsHasBeenSet = !transitionMember.IsNull(); - while (!transitionMember.IsNull()) { - m_transitions.push_back(transitionMember); - transitionMember = transitionMember.NextNode("Transition"); - } - - m_transitionsHasBeenSet = true; - } - XmlNode noncurrentVersionTransitionsNode = resultNode.FirstChild("NoncurrentVersionTransition"); - if (!noncurrentVersionTransitionsNode.IsNull()) { - XmlNode noncurrentVersionTransitionMember = noncurrentVersionTransitionsNode; - m_noncurrentVersionTransitionsHasBeenSet = !noncurrentVersionTransitionMember.IsNull(); - while (!noncurrentVersionTransitionMember.IsNull()) { - m_noncurrentVersionTransitions.push_back(noncurrentVersionTransitionMember); - noncurrentVersionTransitionMember = noncurrentVersionTransitionMember.NextNode("NoncurrentVersionTransition"); - } - - m_noncurrentVersionTransitionsHasBeenSet = true; - } - XmlNode noncurrentVersionExpirationNode = resultNode.FirstChild("NoncurrentVersionExpiration"); - if (!noncurrentVersionExpirationNode.IsNull()) { - m_noncurrentVersionExpiration = noncurrentVersionExpirationNode; - m_noncurrentVersionExpirationHasBeenSet = true; - } - XmlNode abortIncompleteMultipartUploadNode = resultNode.FirstChild("AbortIncompleteMultipartUpload"); - if (!abortIncompleteMultipartUploadNode.IsNull()) { - m_abortIncompleteMultipartUpload = abortIncompleteMultipartUploadNode; - m_abortIncompleteMultipartUploadHasBeenSet = true; - } - } - - return *this; -} - -void LifecycleRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_expirationHasBeenSet) { - XmlNode expirationNode = parentNode.CreateChildElement("Expiration"); - m_expiration.AddToNode(expirationNode); - } - - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ExpirationStatusMapper::GetNameForExpirationStatus(m_status)); - } - - if (m_transitionsHasBeenSet) { - for (const auto& item : m_transitions) { - XmlNode transitionsNode = parentNode.CreateChildElement("Transition"); - item.AddToNode(transitionsNode); - } - } - - if (m_noncurrentVersionTransitionsHasBeenSet) { - for (const auto& item : m_noncurrentVersionTransitions) { - XmlNode noncurrentVersionTransitionsNode = parentNode.CreateChildElement("NoncurrentVersionTransition"); - item.AddToNode(noncurrentVersionTransitionsNode); - } - } - - if (m_noncurrentVersionExpirationHasBeenSet) { - XmlNode noncurrentVersionExpirationNode = parentNode.CreateChildElement("NoncurrentVersionExpiration"); - m_noncurrentVersionExpiration.AddToNode(noncurrentVersionExpirationNode); - } - - if (m_abortIncompleteMultipartUploadHasBeenSet) { - XmlNode abortIncompleteMultipartUploadNode = parentNode.CreateChildElement("AbortIncompleteMultipartUpload"); - m_abortIncompleteMultipartUpload.AddToNode(abortIncompleteMultipartUploadNode); - } -} +void LifecycleRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleAndOperator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleAndOperator.cpp index cf60cd16597..5eebebf6c30 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleAndOperator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleAndOperator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,71 +20,9 @@ namespace Model { LifecycleRuleAndOperator::LifecycleRuleAndOperator(const XmlNode& xmlNode) { *this = xmlNode; } -LifecycleRuleAndOperator& LifecycleRuleAndOperator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LifecycleRuleAndOperator& LifecycleRuleAndOperator::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tag"); - if (!tagsNode.IsNull()) { - XmlNode tagMember = tagsNode; - m_tagsHasBeenSet = !tagMember.IsNull(); - while (!tagMember.IsNull()) { - m_tags.push_back(tagMember); - tagMember = tagMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - XmlNode objectSizeGreaterThanNode = resultNode.FirstChild("ObjectSizeGreaterThan"); - if (!objectSizeGreaterThanNode.IsNull()) { - m_objectSizeGreaterThan = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeGreaterThanNode.GetText()).c_str()).c_str()); - m_objectSizeGreaterThanHasBeenSet = true; - } - XmlNode objectSizeLessThanNode = resultNode.FirstChild("ObjectSizeLessThan"); - if (!objectSizeLessThanNode.IsNull()) { - m_objectSizeLessThan = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeLessThanNode.GetText()).c_str()).c_str()); - m_objectSizeLessThanHasBeenSet = true; - } - } - - return *this; -} - -void LifecycleRuleAndOperator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagsHasBeenSet) { - for (const auto& item : m_tags) { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } - - if (m_objectSizeGreaterThanHasBeenSet) { - XmlNode objectSizeGreaterThanNode = parentNode.CreateChildElement("ObjectSizeGreaterThan"); - ss << m_objectSizeGreaterThan; - objectSizeGreaterThanNode.SetText(ss.str()); - ss.str(""); - } - - if (m_objectSizeLessThanHasBeenSet) { - XmlNode objectSizeLessThanNode = parentNode.CreateChildElement("ObjectSizeLessThan"); - ss << m_objectSizeLessThan; - objectSizeLessThanNode.SetText(ss.str()); - ss.str(""); - } -} +void LifecycleRuleAndOperator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp index 5c7f137d206..8f58663dcaa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,73 +20,9 @@ namespace Model { LifecycleRuleFilter::LifecycleRuleFilter(const XmlNode& xmlNode) { *this = xmlNode; } -LifecycleRuleFilter& LifecycleRuleFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LifecycleRuleFilter& LifecycleRuleFilter::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if (!tagNode.IsNull()) { - m_tag = tagNode; - m_tagHasBeenSet = true; - } - XmlNode objectSizeGreaterThanNode = resultNode.FirstChild("ObjectSizeGreaterThan"); - if (!objectSizeGreaterThanNode.IsNull()) { - m_objectSizeGreaterThan = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeGreaterThanNode.GetText()).c_str()).c_str()); - m_objectSizeGreaterThanHasBeenSet = true; - } - XmlNode objectSizeLessThanNode = resultNode.FirstChild("ObjectSizeLessThan"); - if (!objectSizeLessThanNode.IsNull()) { - m_objectSizeLessThan = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectSizeLessThanNode.GetText()).c_str()).c_str()); - m_objectSizeLessThanHasBeenSet = true; - } - XmlNode andNode = resultNode.FirstChild("And"); - if (!andNode.IsNull()) { - m_and = andNode; - m_andHasBeenSet = true; - } - } - - return *this; -} - -void LifecycleRuleFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); - } - - if (m_objectSizeGreaterThanHasBeenSet) { - XmlNode objectSizeGreaterThanNode = parentNode.CreateChildElement("ObjectSizeGreaterThan"); - ss << m_objectSizeGreaterThan; - objectSizeGreaterThanNode.SetText(ss.str()); - ss.str(""); - } - - if (m_objectSizeLessThanHasBeenSet) { - XmlNode objectSizeLessThanNode = parentNode.CreateChildElement("ObjectSizeLessThan"); - ss << m_objectSizeLessThan; - objectSizeLessThanNode.SetText(ss.str()); - ss.str(""); - } - - if (m_andHasBeenSet) { - XmlNode andNode = parentNode.CreateChildElement("And"); - m_and.AddToNode(andNode); - } -} +void LifecycleRuleFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsRequest.cpp index 7116aabcaf6..e1da39af201 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListBucketAnalyticsConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String ListBucketAnalyticsConfigurationsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection ListBucketAnalyticsConfigurationsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String ListBucketAnalyticsConfigurationsRequest::SerializePayload() const { return {}; } - -void ListBucketAnalyticsConfigurationsRequest::AddQueryStringParameters(URI& uri) const { +void ListBucketAnalyticsConfigurationsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void ListBucketAnalyticsConfigurationsRequest::AddQueryStringParameters(URI& uri collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListBucketAnalyticsConfigurationsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListBucketAnalyticsConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } ListBucketAnalyticsConfigurationsRequest::EndpointParameters ListBucketAnalyticsConfigurationsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsResult.cpp index 003b40fbf3c..403d5a22e04 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketAnalyticsConfigurationsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,46 +24,5 @@ ListBucketAnalyticsConfigurationsResult::ListBucketAnalyticsConfigurationsResult ListBucketAnalyticsConfigurationsResult& ListBucketAnalyticsConfigurationsResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - XmlNode analyticsConfigurationListNode = resultNode.FirstChild("AnalyticsConfiguration"); - if (!analyticsConfigurationListNode.IsNull()) { - XmlNode analyticsConfigurationMember = analyticsConfigurationListNode; - m_analyticsConfigurationListHasBeenSet = !analyticsConfigurationMember.IsNull(); - while (!analyticsConfigurationMember.IsNull()) { - m_analyticsConfigurationList.push_back(analyticsConfigurationMember); - analyticsConfigurationMember = analyticsConfigurationMember.NextNode("AnalyticsConfiguration"); - } - - m_analyticsConfigurationListHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsRequest.cpp index 362c30e5a6f..61816d9e96f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,34 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListBucketIntelligentTieringConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String ListBucketIntelligentTieringConfigurationsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection ListBucketIntelligentTieringConfigurationsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String ListBucketIntelligentTieringConfigurationsRequest::SerializePayload() const { return {}; } - -void ListBucketIntelligentTieringConfigurationsRequest::AddQueryStringParameters(URI& uri) const { +void ListBucketIntelligentTieringConfigurationsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -52,23 +47,25 @@ void ListBucketIntelligentTieringConfigurationsRequest::AddQueryStringParameters collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListBucketIntelligentTieringConfigurationsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListBucketIntelligentTieringConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } ListBucketIntelligentTieringConfigurationsRequest::EndpointParameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsResult.cpp index 82b427be5ae..7bbd199d949 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketIntelligentTieringConfigurationsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -23,46 +25,5 @@ ListBucketIntelligentTieringConfigurationsResult::ListBucketIntelligentTieringCo ListBucketIntelligentTieringConfigurationsResult& ListBucketIntelligentTieringConfigurationsResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - XmlNode intelligentTieringConfigurationListNode = resultNode.FirstChild("IntelligentTieringConfiguration"); - if (!intelligentTieringConfigurationListNode.IsNull()) { - XmlNode intelligentTieringConfigurationMember = intelligentTieringConfigurationListNode; - m_intelligentTieringConfigurationListHasBeenSet = !intelligentTieringConfigurationMember.IsNull(); - while (!intelligentTieringConfigurationMember.IsNull()) { - m_intelligentTieringConfigurationList.push_back(intelligentTieringConfigurationMember); - intelligentTieringConfigurationMember = intelligentTieringConfigurationMember.NextNode("IntelligentTieringConfiguration"); - } - - m_intelligentTieringConfigurationListHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsRequest.cpp index 2de374d604d..2d42e463ee6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListBucketInventoryConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String ListBucketInventoryConfigurationsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection ListBucketInventoryConfigurationsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String ListBucketInventoryConfigurationsRequest::SerializePayload() const { return {}; } - -void ListBucketInventoryConfigurationsRequest::AddQueryStringParameters(URI& uri) const { +void ListBucketInventoryConfigurationsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void ListBucketInventoryConfigurationsRequest::AddQueryStringParameters(URI& uri collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListBucketInventoryConfigurationsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListBucketInventoryConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } ListBucketInventoryConfigurationsRequest::EndpointParameters ListBucketInventoryConfigurationsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsResult.cpp index 601c2e78eb9..40aa43be924 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketInventoryConfigurationsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,46 +24,5 @@ ListBucketInventoryConfigurationsResult::ListBucketInventoryConfigurationsResult ListBucketInventoryConfigurationsResult& ListBucketInventoryConfigurationsResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode inventoryConfigurationListNode = resultNode.FirstChild("InventoryConfiguration"); - if (!inventoryConfigurationListNode.IsNull()) { - XmlNode inventoryConfigurationMember = inventoryConfigurationListNode; - m_inventoryConfigurationListHasBeenSet = !inventoryConfigurationMember.IsNull(); - while (!inventoryConfigurationMember.IsNull()) { - m_inventoryConfigurationList.push_back(inventoryConfigurationMember); - inventoryConfigurationMember = inventoryConfigurationMember.NextNode("InventoryConfiguration"); - } - - m_inventoryConfigurationListHasBeenSet = true; - } - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsRequest.cpp index cd0a708545f..ef678109b72 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,33 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListBucketMetricsConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String ListBucketMetricsConfigurationsRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection ListBucketMetricsConfigurationsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + return headers; } -Aws::String ListBucketMetricsConfigurationsRequest::SerializePayload() const { return {}; } - -void ListBucketMetricsConfigurationsRequest::AddQueryStringParameters(URI& uri) const { +void ListBucketMetricsConfigurationsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -51,23 +47,24 @@ void ListBucketMetricsConfigurationsRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListBucketMetricsConfigurationsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListBucketMetricsConfigurationsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } ListBucketMetricsConfigurationsRequest::EndpointParameters ListBucketMetricsConfigurationsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsResult.cpp index 19f227f5474..bd131224628 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketMetricsConfigurationsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,46 +24,5 @@ ListBucketMetricsConfigurationsResult::ListBucketMetricsConfigurationsResult(con ListBucketMetricsConfigurationsResult& ListBucketMetricsConfigurationsResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - XmlNode metricsConfigurationListNode = resultNode.FirstChild("MetricsConfiguration"); - if (!metricsConfigurationListNode.IsNull()) { - XmlNode metricsConfigurationMember = metricsConfigurationListNode; - m_metricsConfigurationListHasBeenSet = !metricsConfigurationMember.IsNull(); - while (!metricsConfigurationMember.IsNull()) { - m_metricsConfigurationList.push_back(metricsConfigurationMember); - metricsConfigurationMember = metricsConfigurationMember.NextNode("MetricsConfiguration"); - } - - m_metricsConfigurationListHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsRequest.cpp index 3772874c0e1..78f72e2c4ef 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,51 +19,30 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListBucketsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String ListBucketsRequest::SerializePayload() const { return {}; } -void ListBucketsRequest::AddQueryStringParameters(URI& uri) const { +void ListBucketsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_maxBucketsHasBeenSet) { ss << m_maxBuckets; uri.AddQueryStringParameter("max-buckets", ss.str()); ss.str(""); } - if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (m_prefixHasBeenSet) { ss << m_prefix; uri.AddQueryStringParameter("prefix", ss.str()); ss.str(""); } - if (m_bucketRegionHasBeenSet) { ss << m_bucketRegion; uri.AddQueryStringParameter("bucket-region", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -69,9 +51,22 @@ void ListBucketsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } + +bool ListBucketsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsResult.cpp index 4ee9451e76d..1677764d5c9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListBucketsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,46 +20,4 @@ using namespace Aws; ListBucketsResult::ListBucketsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListBucketsResult& ListBucketsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode bucketsNode = resultNode.FirstChild("Buckets"); - if (!bucketsNode.IsNull()) { - XmlNode bucketsMember = bucketsNode.FirstChild("Bucket"); - m_bucketsHasBeenSet = !bucketsMember.IsNull(); - while (!bucketsMember.IsNull()) { - m_buckets.push_back(bucketsMember); - bucketsMember = bucketsMember.NextNode("Bucket"); - } - - m_bucketsHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListBucketsResult& ListBucketsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsRequest.cpp index 6ee43aa2ec2..403aaa9b1f9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,39 +19,20 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListDirectoryBucketsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String ListDirectoryBucketsRequest::SerializePayload() const { return {}; } -void ListDirectoryBucketsRequest::AddQueryStringParameters(URI& uri) const { +void ListDirectoryBucketsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (m_maxDirectoryBucketsHasBeenSet) { ss << m_maxDirectoryBuckets; uri.AddQueryStringParameter("max-directory-buckets", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -57,13 +41,26 @@ void ListDirectoryBucketsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } +bool ListDirectoryBucketsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + ListDirectoryBucketsRequest::EndpointParameters ListDirectoryBucketsRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsResult.cpp index cbceabe258c..cc44603f94d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListDirectoryBucketsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,36 +20,4 @@ using namespace Aws; ListDirectoryBucketsResult::ListDirectoryBucketsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListDirectoryBucketsResult& ListDirectoryBucketsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode bucketsNode = resultNode.FirstChild("Buckets"); - if (!bucketsNode.IsNull()) { - XmlNode bucketsMember = bucketsNode.FirstChild("Bucket"); - m_bucketsHasBeenSet = !bucketsMember.IsNull(); - while (!bucketsMember.IsNull()) { - m_buckets.push_back(bucketsMember); - bucketsMember = bucketsMember.NextNode("Bucket"); - } - - m_bucketsHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListDirectoryBucketsResult& ListDirectoryBucketsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsRequest.cpp index 5b43f0c1622..ebba14e3d86 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,63 +19,54 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListMultipartUploadsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String ListMultipartUploadsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection ListMultipartUploadsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - return false; + return headers; } -Aws::String ListMultipartUploadsRequest::SerializePayload() const { return {}; } - -void ListMultipartUploadsRequest::AddQueryStringParameters(URI& uri) const { +void ListMultipartUploadsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_delimiterHasBeenSet) { ss << m_delimiter; uri.AddQueryStringParameter("delimiter", ss.str()); ss.str(""); } - if (m_encodingTypeHasBeenSet) { ss << EncodingTypeMapper::GetNameForEncodingType(m_encodingType); uri.AddQueryStringParameter("encoding-type", ss.str()); ss.str(""); } - if (m_keyMarkerHasBeenSet) { ss << m_keyMarker; uri.AddQueryStringParameter("key-marker", ss.str()); ss.str(""); } - if (m_maxUploadsHasBeenSet) { ss << m_maxUploads; uri.AddQueryStringParameter("max-uploads", ss.str()); ss.str(""); } - if (m_prefixHasBeenSet) { ss << m_prefix; uri.AddQueryStringParameter("prefix", ss.str()); ss.str(""); } - if (m_uploadIdMarkerHasBeenSet) { ss << m_uploadIdMarker; uri.AddQueryStringParameter("upload-id-marker", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -81,27 +75,24 @@ void ListMultipartUploadsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListMultipartUploadsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListMultipartUploadsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } ListMultipartUploadsRequest::EndpointParameters ListMultipartUploadsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsResult.cpp index f1eab7d90c9..6a287232353 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListMultipartUploadsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,101 +20,4 @@ using namespace Aws; ListMultipartUploadsResult::ListMultipartUploadsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListMultipartUploadsResult& ListMultipartUploadsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode keyMarkerNode = resultNode.FirstChild("KeyMarker"); - if (!keyMarkerNode.IsNull()) { - m_keyMarker = Aws::Utils::Xml::DecodeEscapedXmlText(keyMarkerNode.GetText()); - m_keyMarkerHasBeenSet = true; - } - XmlNode uploadIdMarkerNode = resultNode.FirstChild("UploadIdMarker"); - if (!uploadIdMarkerNode.IsNull()) { - m_uploadIdMarker = Aws::Utils::Xml::DecodeEscapedXmlText(uploadIdMarkerNode.GetText()); - m_uploadIdMarkerHasBeenSet = true; - } - XmlNode nextKeyMarkerNode = resultNode.FirstChild("NextKeyMarker"); - if (!nextKeyMarkerNode.IsNull()) { - m_nextKeyMarker = Aws::Utils::Xml::DecodeEscapedXmlText(nextKeyMarkerNode.GetText()); - m_nextKeyMarkerHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode delimiterNode = resultNode.FirstChild("Delimiter"); - if (!delimiterNode.IsNull()) { - m_delimiter = Aws::Utils::Xml::DecodeEscapedXmlText(delimiterNode.GetText()); - m_delimiterHasBeenSet = true; - } - XmlNode nextUploadIdMarkerNode = resultNode.FirstChild("NextUploadIdMarker"); - if (!nextUploadIdMarkerNode.IsNull()) { - m_nextUploadIdMarker = Aws::Utils::Xml::DecodeEscapedXmlText(nextUploadIdMarkerNode.GetText()); - m_nextUploadIdMarkerHasBeenSet = true; - } - XmlNode maxUploadsNode = resultNode.FirstChild("MaxUploads"); - if (!maxUploadsNode.IsNull()) { - m_maxUploads = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxUploadsNode.GetText()).c_str()).c_str()); - m_maxUploadsHasBeenSet = true; - } - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode uploadsNode = resultNode.FirstChild("Upload"); - if (!uploadsNode.IsNull()) { - XmlNode uploadMember = uploadsNode; - m_uploadsHasBeenSet = !uploadMember.IsNull(); - while (!uploadMember.IsNull()) { - m_uploads.push_back(uploadMember); - uploadMember = uploadMember.NextNode("Upload"); - } - - m_uploadsHasBeenSet = true; - } - XmlNode commonPrefixesNode = resultNode.FirstChild("CommonPrefixes"); - if (!commonPrefixesNode.IsNull()) { - XmlNode commonPrefixesMember = commonPrefixesNode; - m_commonPrefixesHasBeenSet = !commonPrefixesMember.IsNull(); - while (!commonPrefixesMember.IsNull()) { - m_commonPrefixes.push_back(commonPrefixesMember); - commonPrefixesMember = commonPrefixesMember.NextNode("CommonPrefixes"); - } - - m_commonPrefixesHasBeenSet = true; - } - XmlNode encodingTypeNode = resultNode.FirstChild("EncodingType"); - if (!encodingTypeNode.IsNull()) { - m_encodingType = EncodingTypeMapper::GetEncodingTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encodingTypeNode.GetText()).c_str())); - m_encodingTypeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListMultipartUploadsResult& ListMultipartUploadsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsRequest.cpp index b98910a68ee..6f3f77cdeac 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,32 +21,42 @@ using namespace Aws::Http; Aws::String ListObjectAnnotationsRequest::SerializePayload() const { return {}; } -void ListObjectAnnotationsRequest::AddQueryStringParameters(URI& uri) const { +Aws::Http::HeaderValueCollection ListObjectAnnotationsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; +} + +void ListObjectAnnotationsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (m_maxAnnotationResultsHasBeenSet) { ss << m_maxAnnotationResults; uri.AddQueryStringParameter("max-annotation-results", ss.str()); ss.str(""); } - if (m_annotationPrefixHasBeenSet) { ss << m_annotationPrefix; uri.AddQueryStringParameter("annotation-prefix", ss.str()); ss.str(""); } - if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -52,29 +65,12 @@ void ListObjectAnnotationsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListObjectAnnotationsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - return headers; -} - ListObjectAnnotationsRequest::EndpointParameters ListObjectAnnotationsRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsResult.cpp index c5f51b1840f..5e43b072ea7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectAnnotationsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,79 +21,5 @@ using namespace Aws; ListObjectAnnotationsResult::ListObjectAnnotationsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } ListObjectAnnotationsResult& ListObjectAnnotationsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode annotationsNode = resultNode.FirstChild("Annotations"); - if (!annotationsNode.IsNull()) { - XmlNode annotationsMember = annotationsNode.FirstChild("AnnotationEntry"); - m_annotationsHasBeenSet = !annotationsMember.IsNull(); - while (!annotationsMember.IsNull()) { - m_annotations.push_back(annotationsMember); - annotationsMember = annotationsMember.NextNode("AnnotationEntry"); - } - - m_annotationsHasBeenSet = true; - } - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode annotationPrefixNode = resultNode.FirstChild("AnnotationPrefix"); - if (!annotationPrefixNode.IsNull()) { - m_annotationPrefix = Aws::Utils::Xml::DecodeEscapedXmlText(annotationPrefixNode.GetText()); - m_annotationPrefixHasBeenSet = true; - } - XmlNode maxAnnotationResultsNode = resultNode.FirstChild("MaxAnnotationResults"); - if (!maxAnnotationResultsNode.IsNull()) { - m_maxAnnotationResults = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxAnnotationResultsNode.GetText()).c_str()).c_str()); - m_maxAnnotationResultsHasBeenSet = true; - } - XmlNode annotationCountNode = resultNode.FirstChild("AnnotationCount"); - if (!annotationCountNode.IsNull()) { - m_annotationCount = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(annotationCountNode.GetText()).c_str()).c_str()); - m_annotationCountHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& objectVersionIdIter = headers.find("x-amz-object-version-id"); - if (objectVersionIdIter != headers.end()) { - m_objectVersionId = objectVersionIdIter->second; - m_objectVersionIdHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsRequest.cpp index 74e851b4f7c..ec93e0da5f8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsRequest.cpp @@ -4,6 +4,8 @@ */ #include +#include +#include #include #include #include @@ -17,101 +19,88 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListObjectVersionsRequest::HasEmbeddedError(Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String ListObjectVersionsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection ListObjectVersionsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - return false; + if (m_optionalObjectAttributesHasBeenSet) { + headers.emplace("x-amz-optional-object-attributes", + std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, + [](const Aws::String& acc, const OptionalObjectAttributes& item) -> Aws::String { + const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); + return acc.empty() ? headerValue : acc + "," + headerValue; + })); + } + return headers; } -Aws::String ListObjectVersionsRequest::SerializePayload() const { return {}; } - -void ListObjectVersionsRequest::AddQueryStringParameters(URI &uri) const { +void ListObjectVersionsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_delimiterHasBeenSet) { ss << m_delimiter; uri.AddQueryStringParameter("delimiter", ss.str()); ss.str(""); } - if (m_encodingTypeHasBeenSet) { ss << EncodingTypeMapper::GetNameForEncodingType(m_encodingType); uri.AddQueryStringParameter("encoding-type", ss.str()); ss.str(""); } - if (m_keyMarkerHasBeenSet) { ss << m_keyMarker; uri.AddQueryStringParameter("key-marker", ss.str()); ss.str(""); } - if (m_maxKeysHasBeenSet) { ss << m_maxKeys; uri.AddQueryStringParameter("max-keys", ss.str()); ss.str(""); } - if (m_prefixHasBeenSet) { ss << m_prefix; uri.AddQueryStringParameter("prefix", ss.str()); ss.str(""); } - if (m_versionIdMarkerHasBeenSet) { ss << m_versionIdMarker; uri.AddQueryStringParameter("version-id-marker", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; - for (const auto &entry : m_customizedAccessLogTag) { + for (const auto& entry : m_customizedAccessLogTag) { if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListObjectVersionsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); +bool ListObjectVersionsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_optionalObjectAttributesHasBeenSet) { - headers.emplace("x-amz-optional-object-attributes", - std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, - [](const Aws::String &acc, const OptionalObjectAttributes &item) -> Aws::String { - const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); - return acc.empty() ? headerValue : acc + "," + headerValue; - })); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } ListObjectVersionsRequest::EndpointParameters ListObjectVersionsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsResult.cpp index 8ff150baf7b..0e8097f8481 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectVersionsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,112 +20,4 @@ using namespace Aws; ListObjectVersionsResult::ListObjectVersionsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListObjectVersionsResult& ListObjectVersionsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode keyMarkerNode = resultNode.FirstChild("KeyMarker"); - if (!keyMarkerNode.IsNull()) { - m_keyMarker = Aws::Utils::Xml::DecodeEscapedXmlText(keyMarkerNode.GetText()); - m_keyMarkerHasBeenSet = true; - } - XmlNode versionIdMarkerNode = resultNode.FirstChild("VersionIdMarker"); - if (!versionIdMarkerNode.IsNull()) { - m_versionIdMarker = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdMarkerNode.GetText()); - m_versionIdMarkerHasBeenSet = true; - } - XmlNode nextKeyMarkerNode = resultNode.FirstChild("NextKeyMarker"); - if (!nextKeyMarkerNode.IsNull()) { - m_nextKeyMarker = Aws::Utils::Xml::DecodeEscapedXmlText(nextKeyMarkerNode.GetText()); - m_nextKeyMarkerHasBeenSet = true; - } - XmlNode nextVersionIdMarkerNode = resultNode.FirstChild("NextVersionIdMarker"); - if (!nextVersionIdMarkerNode.IsNull()) { - m_nextVersionIdMarker = Aws::Utils::Xml::DecodeEscapedXmlText(nextVersionIdMarkerNode.GetText()); - m_nextVersionIdMarkerHasBeenSet = true; - } - XmlNode versionsNode = resultNode.FirstChild("Version"); - if (!versionsNode.IsNull()) { - XmlNode versionMember = versionsNode; - m_versionsHasBeenSet = !versionMember.IsNull(); - while (!versionMember.IsNull()) { - m_versions.push_back(versionMember); - versionMember = versionMember.NextNode("Version"); - } - - m_versionsHasBeenSet = true; - } - XmlNode deleteMarkersNode = resultNode.FirstChild("DeleteMarker"); - if (!deleteMarkersNode.IsNull()) { - XmlNode deleteMarkerMember = deleteMarkersNode; - m_deleteMarkersHasBeenSet = !deleteMarkerMember.IsNull(); - while (!deleteMarkerMember.IsNull()) { - m_deleteMarkers.push_back(deleteMarkerMember); - deleteMarkerMember = deleteMarkerMember.NextNode("DeleteMarker"); - } - - m_deleteMarkersHasBeenSet = true; - } - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode delimiterNode = resultNode.FirstChild("Delimiter"); - if (!delimiterNode.IsNull()) { - m_delimiter = Aws::Utils::Xml::DecodeEscapedXmlText(delimiterNode.GetText()); - m_delimiterHasBeenSet = true; - } - XmlNode maxKeysNode = resultNode.FirstChild("MaxKeys"); - if (!maxKeysNode.IsNull()) { - m_maxKeys = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxKeysNode.GetText()).c_str()).c_str()); - m_maxKeysHasBeenSet = true; - } - XmlNode commonPrefixesNode = resultNode.FirstChild("CommonPrefixes"); - if (!commonPrefixesNode.IsNull()) { - XmlNode commonPrefixesMember = commonPrefixesNode; - m_commonPrefixesHasBeenSet = !commonPrefixesMember.IsNull(); - while (!commonPrefixesMember.IsNull()) { - m_commonPrefixes.push_back(commonPrefixesMember); - commonPrefixesMember = commonPrefixesMember.NextNode("CommonPrefixes"); - } - - m_commonPrefixesHasBeenSet = true; - } - XmlNode encodingTypeNode = resultNode.FirstChild("EncodingType"); - if (!encodingTypeNode.IsNull()) { - m_encodingType = EncodingTypeMapper::GetEncodingTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encodingTypeNode.GetText()).c_str())); - m_encodingTypeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListObjectVersionsResult& ListObjectVersionsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsRequest.cpp index acb32605e44..a02ad20c041 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsRequest.cpp @@ -4,6 +4,8 @@ */ #include +#include +#include #include #include #include @@ -17,95 +19,83 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListObjectsRequest::HasEmbeddedError(Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String ListObjectsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection ListObjectsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + if (m_optionalObjectAttributesHasBeenSet) { + headers.emplace("x-amz-optional-object-attributes", + std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, + [](const Aws::String& acc, const OptionalObjectAttributes& item) -> Aws::String { + const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); + return acc.empty() ? headerValue : acc + "," + headerValue; + })); + } + return headers; } -Aws::String ListObjectsRequest::SerializePayload() const { return {}; } - -void ListObjectsRequest::AddQueryStringParameters(URI &uri) const { +void ListObjectsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_delimiterHasBeenSet) { ss << m_delimiter; uri.AddQueryStringParameter("delimiter", ss.str()); ss.str(""); } - if (m_encodingTypeHasBeenSet) { ss << EncodingTypeMapper::GetNameForEncodingType(m_encodingType); uri.AddQueryStringParameter("encoding-type", ss.str()); ss.str(""); } - if (m_markerHasBeenSet) { ss << m_marker; uri.AddQueryStringParameter("marker", ss.str()); ss.str(""); } - if (m_maxKeysHasBeenSet) { ss << m_maxKeys; uri.AddQueryStringParameter("max-keys", ss.str()); ss.str(""); } - if (m_prefixHasBeenSet) { ss << m_prefix; uri.AddQueryStringParameter("prefix", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; - for (const auto &entry : m_customizedAccessLogTag) { + for (const auto& entry : m_customizedAccessLogTag) { if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListObjectsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListObjectsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_optionalObjectAttributesHasBeenSet) { - headers.emplace("x-amz-optional-object-attributes", - std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, - [](const Aws::String &acc, const OptionalObjectAttributes &item) -> Aws::String { - const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); - return acc.empty() ? headerValue : acc + "," + headerValue; - })); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } ListObjectsRequest::EndpointParameters ListObjectsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsResult.cpp index ceb2641270b..3d3c54dc1bd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,91 +20,4 @@ using namespace Aws; ListObjectsResult::ListObjectsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListObjectsResult& ListObjectsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode markerNode = resultNode.FirstChild("Marker"); - if (!markerNode.IsNull()) { - m_marker = Aws::Utils::Xml::DecodeEscapedXmlText(markerNode.GetText()); - m_markerHasBeenSet = true; - } - XmlNode nextMarkerNode = resultNode.FirstChild("NextMarker"); - if (!nextMarkerNode.IsNull()) { - m_nextMarker = Aws::Utils::Xml::DecodeEscapedXmlText(nextMarkerNode.GetText()); - m_nextMarkerHasBeenSet = true; - } - XmlNode contentsNode = resultNode.FirstChild("Contents"); - if (!contentsNode.IsNull()) { - XmlNode contentsMember = contentsNode; - m_contentsHasBeenSet = !contentsMember.IsNull(); - while (!contentsMember.IsNull()) { - m_contents.push_back(contentsMember); - contentsMember = contentsMember.NextNode("Contents"); - } - - m_contentsHasBeenSet = true; - } - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode delimiterNode = resultNode.FirstChild("Delimiter"); - if (!delimiterNode.IsNull()) { - m_delimiter = Aws::Utils::Xml::DecodeEscapedXmlText(delimiterNode.GetText()); - m_delimiterHasBeenSet = true; - } - XmlNode maxKeysNode = resultNode.FirstChild("MaxKeys"); - if (!maxKeysNode.IsNull()) { - m_maxKeys = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxKeysNode.GetText()).c_str()).c_str()); - m_maxKeysHasBeenSet = true; - } - XmlNode commonPrefixesNode = resultNode.FirstChild("CommonPrefixes"); - if (!commonPrefixesNode.IsNull()) { - XmlNode commonPrefixesMember = commonPrefixesNode; - m_commonPrefixesHasBeenSet = !commonPrefixesMember.IsNull(); - while (!commonPrefixesMember.IsNull()) { - m_commonPrefixes.push_back(commonPrefixesMember); - commonPrefixesMember = commonPrefixesMember.NextNode("CommonPrefixes"); - } - - m_commonPrefixesHasBeenSet = true; - } - XmlNode encodingTypeNode = resultNode.FirstChild("EncodingType"); - if (!encodingTypeNode.IsNull()) { - m_encodingType = EncodingTypeMapper::GetEncodingTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encodingTypeNode.GetText()).c_str())); - m_encodingTypeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListObjectsResult& ListObjectsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Request.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Request.cpp index a61ba95cdae..2832cba21ff 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Request.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Request.cpp @@ -4,6 +4,8 @@ */ #include +#include +#include #include #include #include @@ -17,107 +19,93 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListObjectsV2Request::HasEmbeddedError(Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String ListObjectsV2Request::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection ListObjectsV2Request::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + if (m_optionalObjectAttributesHasBeenSet) { + headers.emplace("x-amz-optional-object-attributes", + std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, + [](const Aws::String& acc, const OptionalObjectAttributes& item) -> Aws::String { + const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); + return acc.empty() ? headerValue : acc + "," + headerValue; + })); + } + return headers; } -Aws::String ListObjectsV2Request::SerializePayload() const { return {}; } - -void ListObjectsV2Request::AddQueryStringParameters(URI &uri) const { +void ListObjectsV2Request::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_delimiterHasBeenSet) { ss << m_delimiter; uri.AddQueryStringParameter("delimiter", ss.str()); ss.str(""); } - if (m_encodingTypeHasBeenSet) { ss << EncodingTypeMapper::GetNameForEncodingType(m_encodingType); uri.AddQueryStringParameter("encoding-type", ss.str()); ss.str(""); } - if (m_maxKeysHasBeenSet) { ss << m_maxKeys; uri.AddQueryStringParameter("max-keys", ss.str()); ss.str(""); } - if (m_prefixHasBeenSet) { ss << m_prefix; uri.AddQueryStringParameter("prefix", ss.str()); ss.str(""); } - if (m_continuationTokenHasBeenSet) { ss << m_continuationToken; uri.AddQueryStringParameter("continuation-token", ss.str()); ss.str(""); } - if (m_fetchOwnerHasBeenSet) { ss << m_fetchOwner; uri.AddQueryStringParameter("fetch-owner", ss.str()); ss.str(""); } - if (m_startAfterHasBeenSet) { ss << m_startAfter; uri.AddQueryStringParameter("start-after", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; - for (const auto &entry : m_customizedAccessLogTag) { + for (const auto& entry : m_customizedAccessLogTag) { if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListObjectsV2Request::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool ListObjectsV2Request::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_optionalObjectAttributesHasBeenSet) { - headers.emplace("x-amz-optional-object-attributes", - std::accumulate(std::begin(m_optionalObjectAttributes), std::end(m_optionalObjectAttributes), Aws::String{}, - [](const Aws::String &acc, const OptionalObjectAttributes &item) -> Aws::String { - const auto headerValue = OptionalObjectAttributesMapper::GetNameForOptionalObjectAttributes(item); - return acc.empty() ? headerValue : acc + "," + headerValue; - })); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } ListObjectsV2Request::EndpointParameters ListObjectsV2Request::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Result.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Result.cpp index d9d071eabe2..afe89bbc463 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Result.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListObjectsV2Result.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,102 +20,4 @@ using namespace Aws; ListObjectsV2Result::ListObjectsV2Result(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListObjectsV2Result& ListObjectsV2Result::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode contentsNode = resultNode.FirstChild("Contents"); - if (!contentsNode.IsNull()) { - XmlNode contentsMember = contentsNode; - m_contentsHasBeenSet = !contentsMember.IsNull(); - while (!contentsMember.IsNull()) { - m_contents.push_back(contentsMember); - contentsMember = contentsMember.NextNode("Contents"); - } - - m_contentsHasBeenSet = true; - } - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode delimiterNode = resultNode.FirstChild("Delimiter"); - if (!delimiterNode.IsNull()) { - m_delimiter = Aws::Utils::Xml::DecodeEscapedXmlText(delimiterNode.GetText()); - m_delimiterHasBeenSet = true; - } - XmlNode maxKeysNode = resultNode.FirstChild("MaxKeys"); - if (!maxKeysNode.IsNull()) { - m_maxKeys = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxKeysNode.GetText()).c_str()).c_str()); - m_maxKeysHasBeenSet = true; - } - XmlNode commonPrefixesNode = resultNode.FirstChild("CommonPrefixes"); - if (!commonPrefixesNode.IsNull()) { - XmlNode commonPrefixesMember = commonPrefixesNode; - m_commonPrefixesHasBeenSet = !commonPrefixesMember.IsNull(); - while (!commonPrefixesMember.IsNull()) { - m_commonPrefixes.push_back(commonPrefixesMember); - commonPrefixesMember = commonPrefixesMember.NextNode("CommonPrefixes"); - } - - m_commonPrefixesHasBeenSet = true; - } - XmlNode encodingTypeNode = resultNode.FirstChild("EncodingType"); - if (!encodingTypeNode.IsNull()) { - m_encodingType = EncodingTypeMapper::GetEncodingTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encodingTypeNode.GetText()).c_str())); - m_encodingTypeHasBeenSet = true; - } - XmlNode keyCountNode = resultNode.FirstChild("KeyCount"); - if (!keyCountNode.IsNull()) { - m_keyCount = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(keyCountNode.GetText()).c_str()).c_str()); - m_keyCountHasBeenSet = true; - } - XmlNode continuationTokenNode = resultNode.FirstChild("ContinuationToken"); - if (!continuationTokenNode.IsNull()) { - m_continuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(continuationTokenNode.GetText()); - m_continuationTokenHasBeenSet = true; - } - XmlNode nextContinuationTokenNode = resultNode.FirstChild("NextContinuationToken"); - if (!nextContinuationTokenNode.IsNull()) { - m_nextContinuationToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextContinuationTokenNode.GetText()); - m_nextContinuationTokenHasBeenSet = true; - } - XmlNode startAfterNode = resultNode.FirstChild("StartAfter"); - if (!startAfterNode.IsNull()) { - m_startAfter = Aws::Utils::Xml::DecodeEscapedXmlText(startAfterNode.GetText()); - m_startAfterHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListObjectsV2Result& ListObjectsV2Result::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListPartsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListPartsRequest.cpp index 43f9964f7df..b672ef39a43 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListPartsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListPartsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,54 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool ListPartsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String ListPartsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection ListPartsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; + if (m_sSECustomerAlgorithmHasBeenSet) { + ss << m_sSECustomerAlgorithm; + headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); + ss.str(""); + } + if (m_sSECustomerKeyHasBeenSet) { + ss << m_sSECustomerKey; + headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); + ss.str(""); + } + if (m_sSECustomerKeyMD5HasBeenSet) { + ss << m_sSECustomerKeyMD5; + headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); + ss.str(""); + } + return headers; } -Aws::String ListPartsRequest::SerializePayload() const { return {}; } - -void ListPartsRequest::AddQueryStringParameters(URI& uri) const { +void ListPartsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_maxPartsHasBeenSet) { ss << m_maxParts; uri.AddQueryStringParameter("max-parts", ss.str()); ss.str(""); } - if (m_partNumberMarkerHasBeenSet) { ss << m_partNumberMarker; uri.AddQueryStringParameter("part-number-marker", ss.str()); ss.str(""); } - if (m_uploadIdHasBeenSet) { ss << m_uploadId; uri.AddQueryStringParameter("uploadId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,45 +75,24 @@ void ListPartsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection ListPartsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - if (m_sSECustomerAlgorithmHasBeenSet) { - ss << m_sSECustomerAlgorithm; - headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); - ss.str(""); - } - - if (m_sSECustomerKeyHasBeenSet) { - ss << m_sSECustomerKey; - headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); - ss.str(""); +bool ListPartsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_sSECustomerKeyMD5HasBeenSet) { - ss << m_sSECustomerKeyMD5; - headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - return headers; + return false; } ListPartsRequest::EndpointParameters ListPartsRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ListPartsResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ListPartsResult.cpp index 915c77775de..bc242898f37 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ListPartsResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ListPartsResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,120 +20,4 @@ using namespace Aws; ListPartsResult::ListPartsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListPartsResult& ListPartsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNode.GetText()); - m_bucketHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode uploadIdNode = resultNode.FirstChild("UploadId"); - if (!uploadIdNode.IsNull()) { - m_uploadId = Aws::Utils::Xml::DecodeEscapedXmlText(uploadIdNode.GetText()); - m_uploadIdHasBeenSet = true; - } - XmlNode partNumberMarkerNode = resultNode.FirstChild("PartNumberMarker"); - if (!partNumberMarkerNode.IsNull()) { - m_partNumberMarker = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partNumberMarkerNode.GetText()).c_str()).c_str()); - m_partNumberMarkerHasBeenSet = true; - } - XmlNode nextPartNumberMarkerNode = resultNode.FirstChild("NextPartNumberMarker"); - if (!nextPartNumberMarkerNode.IsNull()) { - m_nextPartNumberMarker = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(nextPartNumberMarkerNode.GetText()).c_str()).c_str()); - m_nextPartNumberMarkerHasBeenSet = true; - } - XmlNode maxPartsNode = resultNode.FirstChild("MaxParts"); - if (!maxPartsNode.IsNull()) { - m_maxParts = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxPartsNode.GetText()).c_str()).c_str()); - m_maxPartsHasBeenSet = true; - } - XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); - if (!isTruncatedNode.IsNull()) { - m_isTruncated = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); - m_isTruncatedHasBeenSet = true; - } - XmlNode partsNode = resultNode.FirstChild("Part"); - if (!partsNode.IsNull()) { - XmlNode partMember = partsNode; - m_partsHasBeenSet = !partMember.IsNull(); - while (!partMember.IsNull()) { - m_parts.push_back(partMember); - partMember = partMember.NextNode("Part"); - } - - m_partsHasBeenSet = true; - } - XmlNode initiatorNode = resultNode.FirstChild("Initiator"); - if (!initiatorNode.IsNull()) { - m_initiator = initiatorNode; - m_initiatorHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode checksumAlgorithmNode = resultNode.FirstChild("ChecksumAlgorithm"); - if (!checksumAlgorithmNode.IsNull()) { - m_checksumAlgorithm = ChecksumAlgorithmMapper::GetChecksumAlgorithmForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumAlgorithmNode.GetText()).c_str())); - m_checksumAlgorithmHasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& abortDateIter = headers.find("x-amz-abort-date"); - if (abortDateIter != headers.end()) { - m_abortDate = DateTime(abortDateIter->second.c_str(), Aws::Utils::DateFormat::RFC822); - if (!m_abortDate.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN("S3::ListPartsResult", - "Failed to parse abortDate header as an RFC822 timestamp: " << abortDateIter->second.c_str()); - } - m_abortDateHasBeenSet = true; - } - - const auto& abortRuleIdIter = headers.find("x-amz-abort-rule-id"); - if (abortRuleIdIter != headers.end()) { - m_abortRuleId = abortRuleIdIter->second; - m_abortRuleIdHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListPartsResult& ListPartsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LocationInfo.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LocationInfo.cpp index b489d4b67b6..18145f50dcc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LocationInfo.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LocationInfo.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { LocationInfo::LocationInfo(const XmlNode& xmlNode) { *this = xmlNode; } -LocationInfo& LocationInfo::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode typeNode = resultNode.FirstChild("Type"); - if (!typeNode.IsNull()) { - m_type = - LocationTypeMapper::GetLocationTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(typeNode.GetText()).c_str())); - m_typeHasBeenSet = true; - } - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - } - - return *this; -} - -void LocationInfo::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_typeHasBeenSet) { - XmlNode typeNode = parentNode.CreateChildElement("Type"); - typeNode.SetText(LocationTypeMapper::GetNameForLocationType(m_type)); - } - - if (m_nameHasBeenSet) { - XmlNode nameNode = parentNode.CreateChildElement("Name"); - nameNode.SetText(m_name); - } -} +LocationInfo& LocationInfo::operator=(const XmlNode& xmlNode) { return *this; } + +void LocationInfo::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LocationType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LocationType.cpp index 2bd87771d52..4157401b71f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LocationType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LocationType.cpp @@ -30,7 +30,6 @@ LocationType GetLocationTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return LocationType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForLocationType(LocationType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/LoggingEnabled.cpp b/generated/src/aws-cpp-sdk-s3/source/model/LoggingEnabled.cpp index dd6f00e3c89..16d0140b1f7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/LoggingEnabled.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/LoggingEnabled.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,66 +20,9 @@ namespace Model { LoggingEnabled::LoggingEnabled(const XmlNode& xmlNode) { *this = xmlNode; } -LoggingEnabled& LoggingEnabled::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +LoggingEnabled& LoggingEnabled::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode targetBucketNode = resultNode.FirstChild("TargetBucket"); - if (!targetBucketNode.IsNull()) { - m_targetBucket = Aws::Utils::Xml::DecodeEscapedXmlText(targetBucketNode.GetText()); - m_targetBucketHasBeenSet = true; - } - XmlNode targetGrantsNode = resultNode.FirstChild("TargetGrants"); - if (!targetGrantsNode.IsNull()) { - XmlNode targetGrantsMember = targetGrantsNode.FirstChild("Grant"); - m_targetGrantsHasBeenSet = !targetGrantsMember.IsNull(); - while (!targetGrantsMember.IsNull()) { - m_targetGrants.push_back(targetGrantsMember); - targetGrantsMember = targetGrantsMember.NextNode("Grant"); - } - - m_targetGrantsHasBeenSet = true; - } - XmlNode targetPrefixNode = resultNode.FirstChild("TargetPrefix"); - if (!targetPrefixNode.IsNull()) { - m_targetPrefix = Aws::Utils::Xml::DecodeEscapedXmlText(targetPrefixNode.GetText()); - m_targetPrefixHasBeenSet = true; - } - XmlNode targetObjectKeyFormatNode = resultNode.FirstChild("TargetObjectKeyFormat"); - if (!targetObjectKeyFormatNode.IsNull()) { - m_targetObjectKeyFormat = targetObjectKeyFormatNode; - m_targetObjectKeyFormatHasBeenSet = true; - } - } - - return *this; -} - -void LoggingEnabled::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_targetBucketHasBeenSet) { - XmlNode targetBucketNode = parentNode.CreateChildElement("TargetBucket"); - targetBucketNode.SetText(m_targetBucket); - } - - if (m_targetGrantsHasBeenSet) { - XmlNode targetGrantsParentNode = parentNode.CreateChildElement("TargetGrants"); - for (const auto& item : m_targetGrants) { - XmlNode targetGrantsNode = targetGrantsParentNode.CreateChildElement("Grant"); - item.AddToNode(targetGrantsNode); - } - } - - if (m_targetPrefixHasBeenSet) { - XmlNode targetPrefixNode = parentNode.CreateChildElement("TargetPrefix"); - targetPrefixNode.SetText(m_targetPrefix); - } - - if (m_targetObjectKeyFormatHasBeenSet) { - XmlNode targetObjectKeyFormatNode = parentNode.CreateChildElement("TargetObjectKeyFormat"); - m_targetObjectKeyFormat.AddToNode(targetObjectKeyFormatNode); - } -} +void LoggingEnabled::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MFADelete.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MFADelete.cpp index 75ecbc689d9..c46e87494a0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MFADelete.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MFADelete.cpp @@ -30,7 +30,6 @@ MFADelete GetMFADeleteForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return MFADelete::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForMFADelete(MFADelete enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MFADeleteStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MFADeleteStatus.cpp index 4b3ec1e4ad8..7d0c1f27c54 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MFADeleteStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MFADeleteStatus.cpp @@ -30,7 +30,6 @@ MFADeleteStatus GetMFADeleteStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return MFADeleteStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForMFADeleteStatus(MFADeleteStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfiguration.cpp index b4768a15a70..ffe45f84e2c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { MetadataConfiguration::MetadataConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataConfiguration& MetadataConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +MetadataConfiguration& MetadataConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode journalTableConfigurationNode = resultNode.FirstChild("JournalTableConfiguration"); - if (!journalTableConfigurationNode.IsNull()) { - m_journalTableConfiguration = journalTableConfigurationNode; - m_journalTableConfigurationHasBeenSet = true; - } - XmlNode inventoryTableConfigurationNode = resultNode.FirstChild("InventoryTableConfiguration"); - if (!inventoryTableConfigurationNode.IsNull()) { - m_inventoryTableConfiguration = inventoryTableConfigurationNode; - m_inventoryTableConfigurationHasBeenSet = true; - } - XmlNode annotationTableConfigurationNode = resultNode.FirstChild("AnnotationTableConfiguration"); - if (!annotationTableConfigurationNode.IsNull()) { - m_annotationTableConfiguration = annotationTableConfigurationNode; - m_annotationTableConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void MetadataConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_journalTableConfigurationHasBeenSet) { - XmlNode journalTableConfigurationNode = parentNode.CreateChildElement("JournalTableConfiguration"); - m_journalTableConfiguration.AddToNode(journalTableConfigurationNode); - } - - if (m_inventoryTableConfigurationHasBeenSet) { - XmlNode inventoryTableConfigurationNode = parentNode.CreateChildElement("InventoryTableConfiguration"); - m_inventoryTableConfiguration.AddToNode(inventoryTableConfigurationNode); - } - - if (m_annotationTableConfigurationHasBeenSet) { - XmlNode annotationTableConfigurationNode = parentNode.CreateChildElement("AnnotationTableConfiguration"); - m_annotationTableConfiguration.AddToNode(annotationTableConfigurationNode); - } -} +void MetadataConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfigurationResult.cpp index 2efdad697c8..31711240766 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,57 +20,9 @@ namespace Model { MetadataConfigurationResult::MetadataConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataConfigurationResult& MetadataConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +MetadataConfigurationResult& MetadataConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode destinationResultNode = resultNode.FirstChild("DestinationResult"); - if (!destinationResultNode.IsNull()) { - m_destinationResult = destinationResultNode; - m_destinationResultHasBeenSet = true; - } - XmlNode journalTableConfigurationResultNode = resultNode.FirstChild("JournalTableConfigurationResult"); - if (!journalTableConfigurationResultNode.IsNull()) { - m_journalTableConfigurationResult = journalTableConfigurationResultNode; - m_journalTableConfigurationResultHasBeenSet = true; - } - XmlNode inventoryTableConfigurationResultNode = resultNode.FirstChild("InventoryTableConfigurationResult"); - if (!inventoryTableConfigurationResultNode.IsNull()) { - m_inventoryTableConfigurationResult = inventoryTableConfigurationResultNode; - m_inventoryTableConfigurationResultHasBeenSet = true; - } - XmlNode annotationTableConfigurationResultNode = resultNode.FirstChild("AnnotationTableConfigurationResult"); - if (!annotationTableConfigurationResultNode.IsNull()) { - m_annotationTableConfigurationResult = annotationTableConfigurationResultNode; - m_annotationTableConfigurationResultHasBeenSet = true; - } - } - - return *this; -} - -void MetadataConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_destinationResultHasBeenSet) { - XmlNode destinationResultNode = parentNode.CreateChildElement("DestinationResult"); - m_destinationResult.AddToNode(destinationResultNode); - } - - if (m_journalTableConfigurationResultHasBeenSet) { - XmlNode journalTableConfigurationResultNode = parentNode.CreateChildElement("JournalTableConfigurationResult"); - m_journalTableConfigurationResult.AddToNode(journalTableConfigurationResultNode); - } - - if (m_inventoryTableConfigurationResultHasBeenSet) { - XmlNode inventoryTableConfigurationResultNode = parentNode.CreateChildElement("InventoryTableConfigurationResult"); - m_inventoryTableConfigurationResult.AddToNode(inventoryTableConfigurationResultNode); - } - - if (m_annotationTableConfigurationResultHasBeenSet) { - XmlNode annotationTableConfigurationResultNode = parentNode.CreateChildElement("AnnotationTableConfigurationResult"); - m_annotationTableConfigurationResult.AddToNode(annotationTableConfigurationResultNode); - } -} +void MetadataConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataDirective.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataDirective.cpp index 79d83c8c97b..0f3236cdf6f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataDirective.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataDirective.cpp @@ -30,7 +30,6 @@ MetadataDirective GetMetadataDirectiveForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return MetadataDirective::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForMetadataDirective(MetadataDirective enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataEntry.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataEntry.cpp index e863e524d40..f8e9e428f86 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataEntry.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataEntry.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { MetadataEntry::MetadataEntry(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataEntry& MetadataEntry::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode nameNode = resultNode.FirstChild("Name"); - if (!nameNode.IsNull()) { - m_name = Aws::Utils::Xml::DecodeEscapedXmlText(nameNode.GetText()); - m_nameHasBeenSet = true; - } - XmlNode valueNode = resultNode.FirstChild("Value"); - if (!valueNode.IsNull()) { - m_value = Aws::Utils::Xml::DecodeEscapedXmlText(valueNode.GetText()); - m_valueHasBeenSet = true; - } - } - - return *this; -} - -void MetadataEntry::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_nameHasBeenSet) { - XmlNode nameNode = parentNode.CreateChildElement("Name"); - nameNode.SetText(m_name); - } - - if (m_valueHasBeenSet) { - XmlNode valueNode = parentNode.CreateChildElement("Value"); - valueNode.SetText(m_value); - } -} +MetadataEntry& MetadataEntry::operator=(const XmlNode& xmlNode) { return *this; } + +void MetadataEntry::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfiguration.cpp index b60cb3e0cf2..75ddf0f9543 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { MetadataTableConfiguration::MetadataTableConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataTableConfiguration& MetadataTableConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode s3TablesDestinationNode = resultNode.FirstChild("S3TablesDestination"); - if (!s3TablesDestinationNode.IsNull()) { - m_s3TablesDestination = s3TablesDestinationNode; - m_s3TablesDestinationHasBeenSet = true; - } - } - - return *this; -} - -void MetadataTableConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_s3TablesDestinationHasBeenSet) { - XmlNode s3TablesDestinationNode = parentNode.CreateChildElement("S3TablesDestination"); - m_s3TablesDestination.AddToNode(s3TablesDestinationNode); - } -} +MetadataTableConfiguration& MetadataTableConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void MetadataTableConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfigurationResult.cpp index 40f633bf96c..8ad9d0c9acf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableConfigurationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { MetadataTableConfigurationResult::MetadataTableConfigurationResult(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataTableConfigurationResult& MetadataTableConfigurationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode s3TablesDestinationResultNode = resultNode.FirstChild("S3TablesDestinationResult"); - if (!s3TablesDestinationResultNode.IsNull()) { - m_s3TablesDestinationResult = s3TablesDestinationResultNode; - m_s3TablesDestinationResultHasBeenSet = true; - } - } - - return *this; -} - -void MetadataTableConfigurationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_s3TablesDestinationResultHasBeenSet) { - XmlNode s3TablesDestinationResultNode = parentNode.CreateChildElement("S3TablesDestinationResult"); - m_s3TablesDestinationResult.AddToNode(s3TablesDestinationResultNode); - } -} +MetadataTableConfigurationResult& MetadataTableConfigurationResult::operator=(const XmlNode& xmlNode) { return *this; } + +void MetadataTableConfigurationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableEncryptionConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableEncryptionConfiguration.cpp index 994ca03ae74..b73c9d0daeb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableEncryptionConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetadataTableEncryptionConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { MetadataTableEncryptionConfiguration::MetadataTableEncryptionConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -MetadataTableEncryptionConfiguration& MetadataTableEncryptionConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode sseAlgorithmNode = resultNode.FirstChild("SseAlgorithm"); - if (!sseAlgorithmNode.IsNull()) { - m_sseAlgorithm = TableSseAlgorithmMapper::GetTableSseAlgorithmForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sseAlgorithmNode.GetText()).c_str())); - m_sseAlgorithmHasBeenSet = true; - } - XmlNode kmsKeyArnNode = resultNode.FirstChild("KmsKeyArn"); - if (!kmsKeyArnNode.IsNull()) { - m_kmsKeyArn = Aws::Utils::Xml::DecodeEscapedXmlText(kmsKeyArnNode.GetText()); - m_kmsKeyArnHasBeenSet = true; - } - } - - return *this; -} - -void MetadataTableEncryptionConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_sseAlgorithmHasBeenSet) { - XmlNode sseAlgorithmNode = parentNode.CreateChildElement("SseAlgorithm"); - sseAlgorithmNode.SetText(TableSseAlgorithmMapper::GetNameForTableSseAlgorithm(m_sseAlgorithm)); - } - - if (m_kmsKeyArnHasBeenSet) { - XmlNode kmsKeyArnNode = parentNode.CreateChildElement("KmsKeyArn"); - kmsKeyArnNode.SetText(m_kmsKeyArn); - } -} +MetadataTableEncryptionConfiguration& MetadataTableEncryptionConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void MetadataTableEncryptionConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Metrics.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Metrics.cpp index 60934b8ef52..147bee7ab3f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Metrics.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Metrics.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { Metrics::Metrics(const XmlNode& xmlNode) { *this = xmlNode; } -Metrics& Metrics::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = MetricsStatusMapper::GetMetricsStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode eventThresholdNode = resultNode.FirstChild("EventThreshold"); - if (!eventThresholdNode.IsNull()) { - m_eventThreshold = eventThresholdNode; - m_eventThresholdHasBeenSet = true; - } - } - - return *this; -} - -void Metrics::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(MetricsStatusMapper::GetNameForMetricsStatus(m_status)); - } - - if (m_eventThresholdHasBeenSet) { - XmlNode eventThresholdNode = parentNode.CreateChildElement("EventThreshold"); - m_eventThreshold.AddToNode(eventThresholdNode); - } -} +Metrics& Metrics::operator=(const XmlNode& xmlNode) { return *this; } + +void Metrics::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetricsAndOperator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetricsAndOperator.cpp index 1643ffff17d..08040a9993c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetricsAndOperator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetricsAndOperator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,55 +20,9 @@ namespace Model { MetricsAndOperator::MetricsAndOperator(const XmlNode& xmlNode) { *this = xmlNode; } -MetricsAndOperator& MetricsAndOperator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +MetricsAndOperator& MetricsAndOperator::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tag"); - if (!tagsNode.IsNull()) { - XmlNode tagMember = tagsNode; - m_tagsHasBeenSet = !tagMember.IsNull(); - while (!tagMember.IsNull()) { - m_tags.push_back(tagMember); - tagMember = tagMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - XmlNode accessPointArnNode = resultNode.FirstChild("AccessPointArn"); - if (!accessPointArnNode.IsNull()) { - m_accessPointArn = Aws::Utils::Xml::DecodeEscapedXmlText(accessPointArnNode.GetText()); - m_accessPointArnHasBeenSet = true; - } - } - - return *this; -} - -void MetricsAndOperator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagsHasBeenSet) { - for (const auto& item : m_tags) { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } - - if (m_accessPointArnHasBeenSet) { - XmlNode accessPointArnNode = parentNode.CreateChildElement("AccessPointArn"); - accessPointArnNode.SetText(m_accessPointArn); - } -} +void MetricsAndOperator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetricsConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetricsConfiguration.cpp index 66d5afb9997..8a4f7f80d2f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetricsConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetricsConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { MetricsConfiguration::MetricsConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -MetricsConfiguration& MetricsConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - } - - return *this; -} - -void MetricsConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } -} +MetricsConfiguration& MetricsConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void MetricsConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetricsFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetricsFilter.cpp index 5512d85d71d..b5e370537db 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetricsFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetricsFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,57 +20,9 @@ namespace Model { MetricsFilter::MetricsFilter(const XmlNode& xmlNode) { *this = xmlNode; } -MetricsFilter& MetricsFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +MetricsFilter& MetricsFilter::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if (!tagNode.IsNull()) { - m_tag = tagNode; - m_tagHasBeenSet = true; - } - XmlNode accessPointArnNode = resultNode.FirstChild("AccessPointArn"); - if (!accessPointArnNode.IsNull()) { - m_accessPointArn = Aws::Utils::Xml::DecodeEscapedXmlText(accessPointArnNode.GetText()); - m_accessPointArnHasBeenSet = true; - } - XmlNode andNode = resultNode.FirstChild("And"); - if (!andNode.IsNull()) { - m_and = andNode; - m_andHasBeenSet = true; - } - } - - return *this; -} - -void MetricsFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); - } - - if (m_accessPointArnHasBeenSet) { - XmlNode accessPointArnNode = parentNode.CreateChildElement("AccessPointArn"); - accessPointArnNode.SetText(m_accessPointArn); - } - - if (m_andHasBeenSet) { - XmlNode andNode = parentNode.CreateChildElement("And"); - m_and.AddToNode(andNode); - } -} +void MetricsFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MetricsStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MetricsStatus.cpp index 17a81dfd0be..d332b4e236d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MetricsStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MetricsStatus.cpp @@ -30,7 +30,6 @@ MetricsStatus GetMetricsStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return MetricsStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForMetricsStatus(MetricsStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/MultipartUpload.cpp b/generated/src/aws-cpp-sdk-s3/source/model/MultipartUpload.cpp index 38e9c9f9c10..e104af1cf9d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/MultipartUpload.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/MultipartUpload.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,101 +20,9 @@ namespace Model { MultipartUpload::MultipartUpload(const XmlNode& xmlNode) { *this = xmlNode; } -MultipartUpload& MultipartUpload::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +MultipartUpload& MultipartUpload::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode uploadIdNode = resultNode.FirstChild("UploadId"); - if (!uploadIdNode.IsNull()) { - m_uploadId = Aws::Utils::Xml::DecodeEscapedXmlText(uploadIdNode.GetText()); - m_uploadIdHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode initiatedNode = resultNode.FirstChild("Initiated"); - if (!initiatedNode.IsNull()) { - m_initiated = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(initiatedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_initiatedHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode initiatorNode = resultNode.FirstChild("Initiator"); - if (!initiatorNode.IsNull()) { - m_initiator = initiatorNode; - m_initiatorHasBeenSet = true; - } - XmlNode checksumAlgorithmNode = resultNode.FirstChild("ChecksumAlgorithm"); - if (!checksumAlgorithmNode.IsNull()) { - m_checksumAlgorithm = ChecksumAlgorithmMapper::GetChecksumAlgorithmForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumAlgorithmNode.GetText()).c_str())); - m_checksumAlgorithmHasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - } - - return *this; -} - -void MultipartUpload::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_uploadIdHasBeenSet) { - XmlNode uploadIdNode = parentNode.CreateChildElement("UploadId"); - uploadIdNode.SetText(m_uploadId); - } - - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_initiatedHasBeenSet) { - XmlNode initiatedNode = parentNode.CreateChildElement("Initiated"); - initiatedNode.SetText(m_initiated.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(StorageClassMapper::GetNameForStorageClass(m_storageClass)); - } - - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - m_owner.AddToNode(ownerNode); - } - - if (m_initiatorHasBeenSet) { - XmlNode initiatorNode = parentNode.CreateChildElement("Initiator"); - m_initiator.AddToNode(initiatorNode); - } - - if (m_checksumAlgorithmHasBeenSet) { - XmlNode checksumAlgorithmNode = parentNode.CreateChildElement("ChecksumAlgorithm"); - checksumAlgorithmNode.SetText(ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_checksumTypeHasBeenSet) { - XmlNode checksumTypeNode = parentNode.CreateChildElement("ChecksumType"); - checksumTypeNode.SetText(ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); - } -} +void MultipartUpload::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionExpiration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionExpiration.cpp index 3506dabf2ca..d4f5597a23c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionExpiration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionExpiration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,43 +20,9 @@ namespace Model { NoncurrentVersionExpiration::NoncurrentVersionExpiration(const XmlNode& xmlNode) { *this = xmlNode; } -NoncurrentVersionExpiration& NoncurrentVersionExpiration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode noncurrentDaysNode = resultNode.FirstChild("NoncurrentDays"); - if (!noncurrentDaysNode.IsNull()) { - m_noncurrentDays = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(noncurrentDaysNode.GetText()).c_str()).c_str()); - m_noncurrentDaysHasBeenSet = true; - } - XmlNode newerNoncurrentVersionsNode = resultNode.FirstChild("NewerNoncurrentVersions"); - if (!newerNoncurrentVersionsNode.IsNull()) { - m_newerNoncurrentVersions = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(newerNoncurrentVersionsNode.GetText()).c_str()).c_str()); - m_newerNoncurrentVersionsHasBeenSet = true; - } - } - - return *this; -} - -void NoncurrentVersionExpiration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_noncurrentDaysHasBeenSet) { - XmlNode noncurrentDaysNode = parentNode.CreateChildElement("NoncurrentDays"); - ss << m_noncurrentDays; - noncurrentDaysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_newerNoncurrentVersionsHasBeenSet) { - XmlNode newerNoncurrentVersionsNode = parentNode.CreateChildElement("NewerNoncurrentVersions"); - ss << m_newerNoncurrentVersions; - newerNoncurrentVersionsNode.SetText(ss.str()); - ss.str(""); - } -} +NoncurrentVersionExpiration& NoncurrentVersionExpiration::operator=(const XmlNode& xmlNode) { return *this; } + +void NoncurrentVersionExpiration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionTransition.cpp b/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionTransition.cpp index 012b2a99e5f..18ef0e05cd8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionTransition.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/NoncurrentVersionTransition.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,54 +20,9 @@ namespace Model { NoncurrentVersionTransition::NoncurrentVersionTransition(const XmlNode& xmlNode) { *this = xmlNode; } -NoncurrentVersionTransition& NoncurrentVersionTransition::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +NoncurrentVersionTransition& NoncurrentVersionTransition::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode noncurrentDaysNode = resultNode.FirstChild("NoncurrentDays"); - if (!noncurrentDaysNode.IsNull()) { - m_noncurrentDays = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(noncurrentDaysNode.GetText()).c_str()).c_str()); - m_noncurrentDaysHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = TransitionStorageClassMapper::GetTransitionStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode newerNoncurrentVersionsNode = resultNode.FirstChild("NewerNoncurrentVersions"); - if (!newerNoncurrentVersionsNode.IsNull()) { - m_newerNoncurrentVersions = StringUtils::ConvertToInt32( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(newerNoncurrentVersionsNode.GetText()).c_str()).c_str()); - m_newerNoncurrentVersionsHasBeenSet = true; - } - } - - return *this; -} - -void NoncurrentVersionTransition::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_noncurrentDaysHasBeenSet) { - XmlNode noncurrentDaysNode = parentNode.CreateChildElement("NoncurrentDays"); - ss << m_noncurrentDays; - noncurrentDaysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(TransitionStorageClassMapper::GetNameForTransitionStorageClass(m_storageClass)); - } - - if (m_newerNoncurrentVersionsHasBeenSet) { - XmlNode newerNoncurrentVersionsNode = parentNode.CreateChildElement("NewerNoncurrentVersions"); - ss << m_newerNoncurrentVersions; - newerNoncurrentVersionsNode.SetText(ss.str()); - ss.str(""); - } -} +void NoncurrentVersionTransition::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfiguration.cpp index 149db76c6e4..24d0eac97f9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,81 +20,9 @@ namespace Model { NotificationConfiguration::NotificationConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -NotificationConfiguration& NotificationConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +NotificationConfiguration& NotificationConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode topicConfigurationsNode = resultNode.FirstChild("TopicConfiguration"); - if (!topicConfigurationsNode.IsNull()) { - XmlNode topicConfigurationMember = topicConfigurationsNode; - m_topicConfigurationsHasBeenSet = !topicConfigurationMember.IsNull(); - while (!topicConfigurationMember.IsNull()) { - m_topicConfigurations.push_back(topicConfigurationMember); - topicConfigurationMember = topicConfigurationMember.NextNode("TopicConfiguration"); - } - - m_topicConfigurationsHasBeenSet = true; - } - XmlNode queueConfigurationsNode = resultNode.FirstChild("QueueConfiguration"); - if (!queueConfigurationsNode.IsNull()) { - XmlNode queueConfigurationMember = queueConfigurationsNode; - m_queueConfigurationsHasBeenSet = !queueConfigurationMember.IsNull(); - while (!queueConfigurationMember.IsNull()) { - m_queueConfigurations.push_back(queueConfigurationMember); - queueConfigurationMember = queueConfigurationMember.NextNode("QueueConfiguration"); - } - - m_queueConfigurationsHasBeenSet = true; - } - XmlNode lambdaFunctionConfigurationsNode = resultNode.FirstChild("CloudFunctionConfiguration"); - if (!lambdaFunctionConfigurationsNode.IsNull()) { - XmlNode cloudFunctionConfigurationMember = lambdaFunctionConfigurationsNode; - m_lambdaFunctionConfigurationsHasBeenSet = !cloudFunctionConfigurationMember.IsNull(); - while (!cloudFunctionConfigurationMember.IsNull()) { - m_lambdaFunctionConfigurations.push_back(cloudFunctionConfigurationMember); - cloudFunctionConfigurationMember = cloudFunctionConfigurationMember.NextNode("CloudFunctionConfiguration"); - } - - m_lambdaFunctionConfigurationsHasBeenSet = true; - } - XmlNode eventBridgeConfigurationNode = resultNode.FirstChild("EventBridgeConfiguration"); - if (!eventBridgeConfigurationNode.IsNull()) { - m_eventBridgeConfiguration = eventBridgeConfigurationNode; - m_eventBridgeConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void NotificationConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_topicConfigurationsHasBeenSet) { - for (const auto& item : m_topicConfigurations) { - XmlNode topicConfigurationsNode = parentNode.CreateChildElement("TopicConfiguration"); - item.AddToNode(topicConfigurationsNode); - } - } - - if (m_queueConfigurationsHasBeenSet) { - for (const auto& item : m_queueConfigurations) { - XmlNode queueConfigurationsNode = parentNode.CreateChildElement("QueueConfiguration"); - item.AddToNode(queueConfigurationsNode); - } - } - - if (m_lambdaFunctionConfigurationsHasBeenSet) { - for (const auto& item : m_lambdaFunctionConfigurations) { - XmlNode lambdaFunctionConfigurationsNode = parentNode.CreateChildElement("CloudFunctionConfiguration"); - item.AddToNode(lambdaFunctionConfigurationsNode); - } - } - - if (m_eventBridgeConfigurationHasBeenSet) { - XmlNode eventBridgeConfigurationNode = parentNode.CreateChildElement("EventBridgeConfiguration"); - m_eventBridgeConfiguration.AddToNode(eventBridgeConfigurationNode); - } -} +void NotificationConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationDeprecated.cpp b/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationDeprecated.cpp deleted file mode 100644 index b8fa9b049a6..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationDeprecated.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -NotificationConfigurationDeprecated::NotificationConfigurationDeprecated(const XmlNode& xmlNode) { *this = xmlNode; } - -NotificationConfigurationDeprecated& NotificationConfigurationDeprecated::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode topicConfigurationNode = resultNode.FirstChild("TopicConfiguration"); - if (!topicConfigurationNode.IsNull()) { - m_topicConfiguration = topicConfigurationNode; - m_topicConfigurationHasBeenSet = true; - } - XmlNode queueConfigurationNode = resultNode.FirstChild("QueueConfiguration"); - if (!queueConfigurationNode.IsNull()) { - m_queueConfiguration = queueConfigurationNode; - m_queueConfigurationHasBeenSet = true; - } - XmlNode cloudFunctionConfigurationNode = resultNode.FirstChild("CloudFunctionConfiguration"); - if (!cloudFunctionConfigurationNode.IsNull()) { - m_cloudFunctionConfiguration = cloudFunctionConfigurationNode; - m_cloudFunctionConfigurationHasBeenSet = true; - } - } - - return *this; -} - -void NotificationConfigurationDeprecated::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_topicConfigurationHasBeenSet) { - XmlNode topicConfigurationNode = parentNode.CreateChildElement("TopicConfiguration"); - m_topicConfiguration.AddToNode(topicConfigurationNode); - } - - if (m_queueConfigurationHasBeenSet) { - XmlNode queueConfigurationNode = parentNode.CreateChildElement("QueueConfiguration"); - m_queueConfiguration.AddToNode(queueConfigurationNode); - } - - if (m_cloudFunctionConfigurationHasBeenSet) { - XmlNode cloudFunctionConfigurationNode = parentNode.CreateChildElement("CloudFunctionConfiguration"); - m_cloudFunctionConfiguration.AddToNode(cloudFunctionConfigurationNode); - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationFilter.cpp index b1cf4bf323c..829b2582767 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/NotificationConfigurationFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { NotificationConfigurationFilter::NotificationConfigurationFilter(const XmlNode& xmlNode) { *this = xmlNode; } -NotificationConfigurationFilter& NotificationConfigurationFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("S3Key"); - if (!keyNode.IsNull()) { - m_key = keyNode; - m_keyHasBeenSet = true; - } - } - - return *this; -} - -void NotificationConfigurationFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("S3Key"); - m_key.AddToNode(keyNode); - } -} +NotificationConfigurationFilter& NotificationConfigurationFilter::operator=(const XmlNode& xmlNode) { return *this; } + +void NotificationConfigurationFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Object.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Object.cpp index 18c6aca8132..6851c2bbab5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Object.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Object.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,122 +20,9 @@ namespace Model { Object::Object(const XmlNode& xmlNode) { *this = xmlNode; } -Object& Object::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Object& Object::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumAlgorithmNode = resultNode.FirstChild("ChecksumAlgorithm"); - if (!checksumAlgorithmNode.IsNull()) { - XmlNode checksumAlgorithmMember = checksumAlgorithmNode; - m_checksumAlgorithmHasBeenSet = !checksumAlgorithmMember.IsNull(); - while (!checksumAlgorithmMember.IsNull()) { - m_checksumAlgorithm.push_back( - ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(StringUtils::Trim(checksumAlgorithmMember.GetText().c_str()))); - checksumAlgorithmMember = checksumAlgorithmMember.NextNode("ChecksumAlgorithm"); - } - - m_checksumAlgorithmHasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = ObjectStorageClassMapper::GetObjectStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode restoreStatusNode = resultNode.FirstChild("RestoreStatus"); - if (!restoreStatusNode.IsNull()) { - m_restoreStatus = restoreStatusNode; - m_restoreStatusHasBeenSet = true; - } - } - - return *this; -} - -void Object::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_checksumAlgorithmHasBeenSet) { - XmlNode checksumAlgorithmParentNode = parentNode.CreateChildElement("ChecksumAlgorithm"); - for (const auto& item : m_checksumAlgorithm) { - XmlNode checksumAlgorithmNode = checksumAlgorithmParentNode.CreateChildElement("ChecksumAlgorithm"); - checksumAlgorithmNode.SetText(ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(item)); - } - } - - if (m_checksumTypeHasBeenSet) { - XmlNode checksumTypeNode = parentNode.CreateChildElement("ChecksumType"); - checksumTypeNode.SetText(ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(ObjectStorageClassMapper::GetNameForObjectStorageClass(m_storageClass)); - } - - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - m_owner.AddToNode(ownerNode); - } - - if (m_restoreStatusHasBeenSet) { - XmlNode restoreStatusNode = parentNode.CreateChildElement("RestoreStatus"); - m_restoreStatus.AddToNode(restoreStatusNode); - } -} +void Object::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectAttributes.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectAttributes.cpp index 517a9d537c9..a1144683913 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectAttributes.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectAttributes.cpp @@ -39,7 +39,6 @@ ObjectAttributes GetObjectAttributesForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectAttributes::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForObjectAttributes(ObjectAttributes enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectCannedACL.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectCannedACL.cpp index 1898eea7b6b..0c5126819fa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectCannedACL.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectCannedACL.cpp @@ -45,7 +45,6 @@ ObjectCannedACL GetObjectCannedACLForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectCannedACL::NOT_SET; } @@ -72,7 +71,6 @@ Aws::String GetNameForObjectCannedACL(ObjectCannedACL enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectEncryption.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectEncryption.cpp index cf4e41ab99c..7918b03850d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectEncryption.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectEncryption.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { ObjectEncryption::ObjectEncryption(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectEncryption& ObjectEncryption::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode sSEKMSNode = resultNode.FirstChild("SSE-KMS"); - if (!sSEKMSNode.IsNull()) { - m_sSEKMS = sSEKMSNode; - m_sSEKMSHasBeenSet = true; - } - } - - return *this; -} - -void ObjectEncryption::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_sSEKMSHasBeenSet) { - XmlNode sSEKMSNode = parentNode.CreateChildElement("SSE-KMS"); - m_sSEKMS.AddToNode(sSEKMSNode); - } -} +ObjectEncryption& ObjectEncryption::operator=(const XmlNode& xmlNode) { return *this; } + +void ObjectEncryption::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectIdentifier.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectIdentifier.cpp index 82549059ef6..f45ca441efe 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectIdentifier.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectIdentifier.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,71 +20,9 @@ namespace Model { ObjectIdentifier::ObjectIdentifier(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectIdentifier& ObjectIdentifier::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ObjectIdentifier& ObjectIdentifier::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode versionIdNode = resultNode.FirstChild("VersionId"); - if (!versionIdNode.IsNull()) { - m_versionId = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdNode.GetText()); - m_versionIdHasBeenSet = true; - } - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode lastModifiedTimeNode = resultNode.FirstChild("LastModifiedTime"); - if (!lastModifiedTimeNode.IsNull()) { - m_lastModifiedTime = - DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedTimeNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::RFC822); - m_lastModifiedTimeHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - } - - return *this; -} - -void ObjectIdentifier::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_versionIdHasBeenSet) { - XmlNode versionIdNode = parentNode.CreateChildElement("VersionId"); - versionIdNode.SetText(m_versionId); - } - - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_lastModifiedTimeHasBeenSet) { - XmlNode lastModifiedTimeNode = parentNode.CreateChildElement("LastModifiedTime"); - lastModifiedTimeNode.SetText(m_lastModifiedTime.ToGmtString(Aws::Utils::DateFormat::RFC822)); - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } -} +void ObjectIdentifier::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockConfiguration.cpp index 4dfd70848e1..c3bc093e699 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { ObjectLockConfiguration::ObjectLockConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectLockConfiguration& ObjectLockConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode objectLockEnabledNode = resultNode.FirstChild("ObjectLockEnabled"); - if (!objectLockEnabledNode.IsNull()) { - m_objectLockEnabled = ObjectLockEnabledMapper::GetObjectLockEnabledForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectLockEnabledNode.GetText()).c_str())); - m_objectLockEnabledHasBeenSet = true; - } - XmlNode ruleNode = resultNode.FirstChild("Rule"); - if (!ruleNode.IsNull()) { - m_rule = ruleNode; - m_ruleHasBeenSet = true; - } - } - - return *this; -} - -void ObjectLockConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_objectLockEnabledHasBeenSet) { - XmlNode objectLockEnabledNode = parentNode.CreateChildElement("ObjectLockEnabled"); - objectLockEnabledNode.SetText(ObjectLockEnabledMapper::GetNameForObjectLockEnabled(m_objectLockEnabled)); - } - - if (m_ruleHasBeenSet) { - XmlNode ruleNode = parentNode.CreateChildElement("Rule"); - m_rule.AddToNode(ruleNode); - } -} +ObjectLockConfiguration& ObjectLockConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void ObjectLockConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockEnabled.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockEnabled.cpp index 043c818298b..744c1bd1eec 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockEnabled.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockEnabled.cpp @@ -27,7 +27,6 @@ ObjectLockEnabled GetObjectLockEnabledForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectLockEnabled::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForObjectLockEnabled(ObjectLockEnabled enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHold.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHold.cpp index ab4523cbbea..825fea5ec0b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHold.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHold.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { ObjectLockLegalHold::ObjectLockLegalHold(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectLockLegalHold& ObjectLockLegalHold::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ObjectLockLegalHoldStatusMapper::GetObjectLockLegalHoldStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void ObjectLockLegalHold::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ObjectLockLegalHoldStatusMapper::GetNameForObjectLockLegalHoldStatus(m_status)); - } -} +ObjectLockLegalHold& ObjectLockLegalHold::operator=(const XmlNode& xmlNode) { return *this; } + +void ObjectLockLegalHold::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHoldStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHoldStatus.cpp index 741c7b4afcf..cb942dbe7c7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHoldStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockLegalHoldStatus.cpp @@ -30,7 +30,6 @@ ObjectLockLegalHoldStatus GetObjectLockLegalHoldStatusForName(const Aws::String& overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectLockLegalHoldStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus enumVa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockMode.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockMode.cpp index f31fd79a624..f61dcaf6887 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockMode.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockMode.cpp @@ -30,7 +30,6 @@ ObjectLockMode GetObjectLockModeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectLockMode::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForObjectLockMode(ObjectLockMode enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetention.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetention.cpp index 9e56fd70d27..b2942e20384 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetention.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetention.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,39 +20,9 @@ namespace Model { ObjectLockRetention::ObjectLockRetention(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectLockRetention& ObjectLockRetention::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode modeNode = resultNode.FirstChild("Mode"); - if (!modeNode.IsNull()) { - m_mode = ObjectLockRetentionModeMapper::GetObjectLockRetentionModeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(modeNode.GetText()).c_str())); - m_modeHasBeenSet = true; - } - XmlNode retainUntilDateNode = resultNode.FirstChild("RetainUntilDate"); - if (!retainUntilDateNode.IsNull()) { - m_retainUntilDate = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(retainUntilDateNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_retainUntilDateHasBeenSet = true; - } - } - - return *this; -} - -void ObjectLockRetention::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_modeHasBeenSet) { - XmlNode modeNode = parentNode.CreateChildElement("Mode"); - modeNode.SetText(ObjectLockRetentionModeMapper::GetNameForObjectLockRetentionMode(m_mode)); - } - - if (m_retainUntilDateHasBeenSet) { - XmlNode retainUntilDateNode = parentNode.CreateChildElement("RetainUntilDate"); - retainUntilDateNode.SetText(m_retainUntilDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } -} +ObjectLockRetention& ObjectLockRetention::operator=(const XmlNode& xmlNode) { return *this; } + +void ObjectLockRetention::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetentionMode.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetentionMode.cpp index 6a501b17611..8709b101fa8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetentionMode.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRetentionMode.cpp @@ -30,7 +30,6 @@ ObjectLockRetentionMode GetObjectLockRetentionModeForName(const Aws::String& nam overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectLockRetentionMode::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForObjectLockRetentionMode(ObjectLockRetentionMode enumValue) if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRule.cpp index 20ee5b8a674..d22a3f18d00 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectLockRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { ObjectLockRule::ObjectLockRule(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectLockRule& ObjectLockRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode defaultRetentionNode = resultNode.FirstChild("DefaultRetention"); - if (!defaultRetentionNode.IsNull()) { - m_defaultRetention = defaultRetentionNode; - m_defaultRetentionHasBeenSet = true; - } - } - - return *this; -} - -void ObjectLockRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_defaultRetentionHasBeenSet) { - XmlNode defaultRetentionNode = parentNode.CreateChildElement("DefaultRetention"); - m_defaultRetention.AddToNode(defaultRetentionNode); - } -} +ObjectLockRule& ObjectLockRule::operator=(const XmlNode& xmlNode) { return *this; } + +void ObjectLockRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectOwnership.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectOwnership.cpp index c6af1037d7a..4b4adb5325a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectOwnership.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectOwnership.cpp @@ -33,7 +33,6 @@ ObjectOwnership GetObjectOwnershipForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectOwnership::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForObjectOwnership(ObjectOwnership enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectPart.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectPart.cpp index 94abf893d79..a971e96b835 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectPart.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectPart.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,142 +20,9 @@ namespace Model { ObjectPart::ObjectPart(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectPart& ObjectPart::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ObjectPart& ObjectPart::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode partNumberNode = resultNode.FirstChild("PartNumber"); - if (!partNumberNode.IsNull()) { - m_partNumber = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partNumberNode.GetText()).c_str()).c_str()); - m_partNumberHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - } - - return *this; -} - -void ObjectPart::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_partNumberHasBeenSet) { - XmlNode partNumberNode = parentNode.CreateChildElement("PartNumber"); - ss << m_partNumber; - partNumberNode.SetText(ss.str()); - ss.str(""); - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } - - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } -} +void ObjectPart::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectStorageClass.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectStorageClass.cpp index 3870a462254..87724ebec27 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectStorageClass.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectStorageClass.cpp @@ -69,7 +69,6 @@ ObjectStorageClass GetObjectStorageClassForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectStorageClass::NOT_SET; } @@ -112,7 +111,6 @@ Aws::String GetNameForObjectStorageClass(ObjectStorageClass enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersion.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersion.cpp index 90c75268555..7c42bbea5bd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersion.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersion.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,145 +20,9 @@ namespace Model { ObjectVersion::ObjectVersion(const XmlNode& xmlNode) { *this = xmlNode; } -ObjectVersion& ObjectVersion::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ObjectVersion& ObjectVersion::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode checksumAlgorithmNode = resultNode.FirstChild("ChecksumAlgorithm"); - if (!checksumAlgorithmNode.IsNull()) { - XmlNode checksumAlgorithmMember = checksumAlgorithmNode; - m_checksumAlgorithmHasBeenSet = !checksumAlgorithmMember.IsNull(); - while (!checksumAlgorithmMember.IsNull()) { - m_checksumAlgorithm.push_back( - ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(StringUtils::Trim(checksumAlgorithmMember.GetText().c_str()))); - checksumAlgorithmMember = checksumAlgorithmMember.NextNode("ChecksumAlgorithm"); - } - - m_checksumAlgorithmHasBeenSet = true; - } - XmlNode checksumTypeNode = resultNode.FirstChild("ChecksumType"); - if (!checksumTypeNode.IsNull()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(checksumTypeNode.GetText()).c_str())); - m_checksumTypeHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = ObjectVersionStorageClassMapper::GetObjectVersionStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode versionIdNode = resultNode.FirstChild("VersionId"); - if (!versionIdNode.IsNull()) { - m_versionId = Aws::Utils::Xml::DecodeEscapedXmlText(versionIdNode.GetText()); - m_versionIdHasBeenSet = true; - } - XmlNode isLatestNode = resultNode.FirstChild("IsLatest"); - if (!isLatestNode.IsNull()) { - m_isLatest = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isLatestNode.GetText()).c_str()).c_str()); - m_isLatestHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode ownerNode = resultNode.FirstChild("Owner"); - if (!ownerNode.IsNull()) { - m_owner = ownerNode; - m_ownerHasBeenSet = true; - } - XmlNode restoreStatusNode = resultNode.FirstChild("RestoreStatus"); - if (!restoreStatusNode.IsNull()) { - m_restoreStatus = restoreStatusNode; - m_restoreStatusHasBeenSet = true; - } - } - - return *this; -} - -void ObjectVersion::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_checksumAlgorithmHasBeenSet) { - XmlNode checksumAlgorithmParentNode = parentNode.CreateChildElement("ChecksumAlgorithm"); - for (const auto& item : m_checksumAlgorithm) { - XmlNode checksumAlgorithmNode = checksumAlgorithmParentNode.CreateChildElement("ChecksumAlgorithm"); - checksumAlgorithmNode.SetText(ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(item)); - } - } - - if (m_checksumTypeHasBeenSet) { - XmlNode checksumTypeNode = parentNode.CreateChildElement("ChecksumType"); - checksumTypeNode.SetText(ChecksumTypeMapper::GetNameForChecksumType(m_checksumType)); - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(ObjectVersionStorageClassMapper::GetNameForObjectVersionStorageClass(m_storageClass)); - } - - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_versionIdHasBeenSet) { - XmlNode versionIdNode = parentNode.CreateChildElement("VersionId"); - versionIdNode.SetText(m_versionId); - } - - if (m_isLatestHasBeenSet) { - XmlNode isLatestNode = parentNode.CreateChildElement("IsLatest"); - ss << std::boolalpha << m_isLatest; - isLatestNode.SetText(ss.str()); - ss.str(""); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_ownerHasBeenSet) { - XmlNode ownerNode = parentNode.CreateChildElement("Owner"); - m_owner.AddToNode(ownerNode); - } - - if (m_restoreStatusHasBeenSet) { - XmlNode restoreStatusNode = parentNode.CreateChildElement("RestoreStatus"); - m_restoreStatus.AddToNode(restoreStatusNode); - } -} +void ObjectVersion::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersionStorageClass.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersionStorageClass.cpp index 610e37287e3..0d3ffeb01d0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersionStorageClass.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ObjectVersionStorageClass.cpp @@ -27,7 +27,6 @@ ObjectVersionStorageClass GetObjectVersionStorageClassForName(const Aws::String& overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ObjectVersionStorageClass::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForObjectVersionStorageClass(ObjectVersionStorageClass enumVa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OptionalObjectAttributes.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OptionalObjectAttributes.cpp index d296d76f94f..0cc43da24c2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OptionalObjectAttributes.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OptionalObjectAttributes.cpp @@ -27,7 +27,6 @@ OptionalObjectAttributes GetOptionalObjectAttributesForName(const Aws::String& n overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return OptionalObjectAttributes::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForOptionalObjectAttributes(OptionalObjectAttributes enumValu if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OutputLocation.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OutputLocation.cpp index 83f322c755d..71839cbb05f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OutputLocation.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OutputLocation.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { OutputLocation::OutputLocation(const XmlNode& xmlNode) { *this = xmlNode; } -OutputLocation& OutputLocation::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode s3Node = resultNode.FirstChild("S3"); - if (!s3Node.IsNull()) { - m_s3 = s3Node; - m_s3HasBeenSet = true; - } - } - - return *this; -} - -void OutputLocation::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_s3HasBeenSet) { - XmlNode s3Node = parentNode.CreateChildElement("S3"); - m_s3.AddToNode(s3Node); - } -} +OutputLocation& OutputLocation::operator=(const XmlNode& xmlNode) { return *this; } + +void OutputLocation::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OutputSerialization.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OutputSerialization.cpp index 854fe8c3f27..4d3d54e28c5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OutputSerialization.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OutputSerialization.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { OutputSerialization::OutputSerialization(const XmlNode& xmlNode) { *this = xmlNode; } -OutputSerialization& OutputSerialization::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode cSVNode = resultNode.FirstChild("CSV"); - if (!cSVNode.IsNull()) { - m_cSV = cSVNode; - m_cSVHasBeenSet = true; - } - XmlNode jSONNode = resultNode.FirstChild("JSON"); - if (!jSONNode.IsNull()) { - m_jSON = jSONNode; - m_jSONHasBeenSet = true; - } - } - - return *this; -} - -void OutputSerialization::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_cSVHasBeenSet) { - XmlNode cSVNode = parentNode.CreateChildElement("CSV"); - m_cSV.AddToNode(cSVNode); - } - - if (m_jSONHasBeenSet) { - XmlNode jSONNode = parentNode.CreateChildElement("JSON"); - m_jSON.AddToNode(jSONNode); - } -} +OutputSerialization& OutputSerialization::operator=(const XmlNode& xmlNode) { return *this; } + +void OutputSerialization::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Owner.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Owner.cpp index 8c2c85efed8..12b893394d6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Owner.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Owner.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { Owner::Owner(const XmlNode& xmlNode) { *this = xmlNode; } -Owner& Owner::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode displayNameNode = resultNode.FirstChild("DisplayName"); - if (!displayNameNode.IsNull()) { - m_displayName = Aws::Utils::Xml::DecodeEscapedXmlText(displayNameNode.GetText()); - m_displayNameHasBeenSet = true; - } - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - } - - return *this; -} - -void Owner::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_displayNameHasBeenSet) { - XmlNode displayNameNode = parentNode.CreateChildElement("DisplayName"); - displayNameNode.SetText(m_displayName); - } - - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } -} +Owner& Owner::operator=(const XmlNode& xmlNode) { return *this; } + +void Owner::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OwnerOverride.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OwnerOverride.cpp index 5542c1baac8..223e035dd8b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OwnerOverride.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OwnerOverride.cpp @@ -27,7 +27,6 @@ OwnerOverride GetOwnerOverrideForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return OwnerOverride::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForOwnerOverride(OwnerOverride enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControls.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControls.cpp index 66134c9d4c3..e4dab953292 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControls.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControls.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { OwnershipControls::OwnershipControls(const XmlNode& xmlNode) { *this = xmlNode; } -OwnershipControls& OwnershipControls::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - return *this; -} - -void OwnershipControls::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_rulesHasBeenSet) { - for (const auto& item : m_rules) { - XmlNode rulesNode = parentNode.CreateChildElement("Rule"); - item.AddToNode(rulesNode); - } - } -} +OwnershipControls& OwnershipControls::operator=(const XmlNode& xmlNode) { return *this; } + +void OwnershipControls::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControlsRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControlsRule.cpp index 99d698693fd..8c32a1d95f9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControlsRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/OwnershipControlsRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { OwnershipControlsRule::OwnershipControlsRule(const XmlNode& xmlNode) { *this = xmlNode; } -OwnershipControlsRule& OwnershipControlsRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode objectOwnershipNode = resultNode.FirstChild("ObjectOwnership"); - if (!objectOwnershipNode.IsNull()) { - m_objectOwnership = ObjectOwnershipMapper::GetObjectOwnershipForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(objectOwnershipNode.GetText()).c_str())); - m_objectOwnershipHasBeenSet = true; - } - } - - return *this; -} - -void OwnershipControlsRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_objectOwnershipHasBeenSet) { - XmlNode objectOwnershipNode = parentNode.CreateChildElement("ObjectOwnership"); - objectOwnershipNode.SetText(ObjectOwnershipMapper::GetNameForObjectOwnership(m_objectOwnership)); - } -} +OwnershipControlsRule& OwnershipControlsRule::operator=(const XmlNode& xmlNode) { return *this; } + +void OwnershipControlsRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ParquetInput.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ParquetInput.cpp index a15a855253a..df68b67cec3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ParquetInput.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ParquetInput.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,19 +20,9 @@ namespace Model { ParquetInput::ParquetInput(const XmlNode& xmlNode) { *this = xmlNode; } -ParquetInput& ParquetInput::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ParquetInput& ParquetInput::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - } - - return *this; -} - -void ParquetInput::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - AWS_UNREFERENCED_PARAM(parentNode); -} +void ParquetInput::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Part.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Part.cpp index 91c2f9e5594..35b641d14ec 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Part.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Part.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,163 +20,9 @@ namespace Model { Part::Part(const XmlNode& xmlNode) { *this = xmlNode; } -Part& Part::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Part& Part::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode partNumberNode = resultNode.FirstChild("PartNumber"); - if (!partNumberNode.IsNull()) { - m_partNumber = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partNumberNode.GetText()).c_str()).c_str()); - m_partNumberHasBeenSet = true; - } - XmlNode lastModifiedNode = resultNode.FirstChild("LastModified"); - if (!lastModifiedNode.IsNull()) { - m_lastModified = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastModifiedNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_lastModifiedHasBeenSet = true; - } - XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - m_eTagHasBeenSet = true; - } - XmlNode sizeNode = resultNode.FirstChild("Size"); - if (!sizeNode.IsNull()) { - m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str()); - m_sizeHasBeenSet = true; - } - XmlNode checksumCRC32Node = resultNode.FirstChild("ChecksumCRC32"); - if (!checksumCRC32Node.IsNull()) { - m_checksumCRC32 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32Node.GetText()); - m_checksumCRC32HasBeenSet = true; - } - XmlNode checksumCRC32CNode = resultNode.FirstChild("ChecksumCRC32C"); - if (!checksumCRC32CNode.IsNull()) { - m_checksumCRC32C = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC32CNode.GetText()); - m_checksumCRC32CHasBeenSet = true; - } - XmlNode checksumCRC64NVMENode = resultNode.FirstChild("ChecksumCRC64NVME"); - if (!checksumCRC64NVMENode.IsNull()) { - m_checksumCRC64NVME = Aws::Utils::Xml::DecodeEscapedXmlText(checksumCRC64NVMENode.GetText()); - m_checksumCRC64NVMEHasBeenSet = true; - } - XmlNode checksumSHA1Node = resultNode.FirstChild("ChecksumSHA1"); - if (!checksumSHA1Node.IsNull()) { - m_checksumSHA1 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA1Node.GetText()); - m_checksumSHA1HasBeenSet = true; - } - XmlNode checksumSHA256Node = resultNode.FirstChild("ChecksumSHA256"); - if (!checksumSHA256Node.IsNull()) { - m_checksumSHA256 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA256Node.GetText()); - m_checksumSHA256HasBeenSet = true; - } - XmlNode checksumSHA512Node = resultNode.FirstChild("ChecksumSHA512"); - if (!checksumSHA512Node.IsNull()) { - m_checksumSHA512 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumSHA512Node.GetText()); - m_checksumSHA512HasBeenSet = true; - } - XmlNode checksumMD5Node = resultNode.FirstChild("ChecksumMD5"); - if (!checksumMD5Node.IsNull()) { - m_checksumMD5 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumMD5Node.GetText()); - m_checksumMD5HasBeenSet = true; - } - XmlNode checksumXXHASH64Node = resultNode.FirstChild("ChecksumXXHASH64"); - if (!checksumXXHASH64Node.IsNull()) { - m_checksumXXHASH64 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH64Node.GetText()); - m_checksumXXHASH64HasBeenSet = true; - } - XmlNode checksumXXHASH3Node = resultNode.FirstChild("ChecksumXXHASH3"); - if (!checksumXXHASH3Node.IsNull()) { - m_checksumXXHASH3 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH3Node.GetText()); - m_checksumXXHASH3HasBeenSet = true; - } - XmlNode checksumXXHASH128Node = resultNode.FirstChild("ChecksumXXHASH128"); - if (!checksumXXHASH128Node.IsNull()) { - m_checksumXXHASH128 = Aws::Utils::Xml::DecodeEscapedXmlText(checksumXXHASH128Node.GetText()); - m_checksumXXHASH128HasBeenSet = true; - } - } - - return *this; -} - -void Part::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_partNumberHasBeenSet) { - XmlNode partNumberNode = parentNode.CreateChildElement("PartNumber"); - ss << m_partNumber; - partNumberNode.SetText(ss.str()); - ss.str(""); - } - - if (m_lastModifiedHasBeenSet) { - XmlNode lastModifiedNode = parentNode.CreateChildElement("LastModified"); - lastModifiedNode.SetText(m_lastModified.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_eTagHasBeenSet) { - XmlNode eTagNode = parentNode.CreateChildElement("ETag"); - eTagNode.SetText(m_eTag); - } - - if (m_sizeHasBeenSet) { - XmlNode sizeNode = parentNode.CreateChildElement("Size"); - ss << m_size; - sizeNode.SetText(ss.str()); - ss.str(""); - } - - if (m_checksumCRC32HasBeenSet) { - XmlNode checksumCRC32Node = parentNode.CreateChildElement("ChecksumCRC32"); - checksumCRC32Node.SetText(m_checksumCRC32); - } - - if (m_checksumCRC32CHasBeenSet) { - XmlNode checksumCRC32CNode = parentNode.CreateChildElement("ChecksumCRC32C"); - checksumCRC32CNode.SetText(m_checksumCRC32C); - } - - if (m_checksumCRC64NVMEHasBeenSet) { - XmlNode checksumCRC64NVMENode = parentNode.CreateChildElement("ChecksumCRC64NVME"); - checksumCRC64NVMENode.SetText(m_checksumCRC64NVME); - } - - if (m_checksumSHA1HasBeenSet) { - XmlNode checksumSHA1Node = parentNode.CreateChildElement("ChecksumSHA1"); - checksumSHA1Node.SetText(m_checksumSHA1); - } - - if (m_checksumSHA256HasBeenSet) { - XmlNode checksumSHA256Node = parentNode.CreateChildElement("ChecksumSHA256"); - checksumSHA256Node.SetText(m_checksumSHA256); - } - - if (m_checksumSHA512HasBeenSet) { - XmlNode checksumSHA512Node = parentNode.CreateChildElement("ChecksumSHA512"); - checksumSHA512Node.SetText(m_checksumSHA512); - } - - if (m_checksumMD5HasBeenSet) { - XmlNode checksumMD5Node = parentNode.CreateChildElement("ChecksumMD5"); - checksumMD5Node.SetText(m_checksumMD5); - } - - if (m_checksumXXHASH64HasBeenSet) { - XmlNode checksumXXHASH64Node = parentNode.CreateChildElement("ChecksumXXHASH64"); - checksumXXHASH64Node.SetText(m_checksumXXHASH64); - } - - if (m_checksumXXHASH3HasBeenSet) { - XmlNode checksumXXHASH3Node = parentNode.CreateChildElement("ChecksumXXHASH3"); - checksumXXHASH3Node.SetText(m_checksumXXHASH3); - } - - if (m_checksumXXHASH128HasBeenSet) { - XmlNode checksumXXHASH128Node = parentNode.CreateChildElement("ChecksumXXHASH128"); - checksumXXHASH128Node.SetText(m_checksumXXHASH128); - } -} +void Part::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PartitionDateSource.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PartitionDateSource.cpp index f485e5c2406..1e0f130ac19 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PartitionDateSource.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PartitionDateSource.cpp @@ -30,7 +30,6 @@ PartitionDateSource GetPartitionDateSourceForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return PartitionDateSource::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForPartitionDateSource(PartitionDateSource enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PartitionedPrefix.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PartitionedPrefix.cpp index d1b88db0844..46177d436f9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PartitionedPrefix.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PartitionedPrefix.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { PartitionedPrefix::PartitionedPrefix(const XmlNode& xmlNode) { *this = xmlNode; } -PartitionedPrefix& PartitionedPrefix::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode partitionDateSourceNode = resultNode.FirstChild("PartitionDateSource"); - if (!partitionDateSourceNode.IsNull()) { - m_partitionDateSource = PartitionDateSourceMapper::GetPartitionDateSourceForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(partitionDateSourceNode.GetText()).c_str())); - m_partitionDateSourceHasBeenSet = true; - } - } - - return *this; -} - -void PartitionedPrefix::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_partitionDateSourceHasBeenSet) { - XmlNode partitionDateSourceNode = parentNode.CreateChildElement("PartitionDateSource"); - partitionDateSourceNode.SetText(PartitionDateSourceMapper::GetNameForPartitionDateSource(m_partitionDateSource)); - } -} +PartitionedPrefix& PartitionedPrefix::operator=(const XmlNode& xmlNode) { return *this; } + +void PartitionedPrefix::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Payer.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Payer.cpp index 50dcb3f697e..91db404d226 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Payer.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Payer.cpp @@ -30,7 +30,6 @@ Payer GetPayerForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Payer::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForPayer(Payer enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Permission.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Permission.cpp index 51ca3620deb..599d2a4dbbf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Permission.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Permission.cpp @@ -39,7 +39,6 @@ Permission GetPermissionForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Permission::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForPermission(Permission enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PolicyStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PolicyStatus.cpp index 83b835c2990..2aaf1748939 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PolicyStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PolicyStatus.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,30 +20,9 @@ namespace Model { PolicyStatus::PolicyStatus(const XmlNode& xmlNode) { *this = xmlNode; } -PolicyStatus& PolicyStatus::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode isPublicNode = resultNode.FirstChild("IsPublic"); - if (!isPublicNode.IsNull()) { - m_isPublic = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isPublicNode.GetText()).c_str()).c_str()); - m_isPublicHasBeenSet = true; - } - } - - return *this; -} - -void PolicyStatus::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_isPublicHasBeenSet) { - XmlNode isPublicNode = parentNode.CreateChildElement("IsPublic"); - ss << std::boolalpha << m_isPublic; - isPublicNode.SetText(ss.str()); - ss.str(""); - } -} +PolicyStatus& PolicyStatus::operator=(const XmlNode& xmlNode) { return *this; } + +void PolicyStatus::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Progress.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Progress.cpp index b258cddc57e..bc9a5a85efc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Progress.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Progress.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,56 +20,9 @@ namespace Model { Progress::Progress(const XmlNode& xmlNode) { *this = xmlNode; } -Progress& Progress::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Progress& Progress::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode bytesScannedNode = resultNode.FirstChild("BytesScanned"); - if (!bytesScannedNode.IsNull()) { - m_bytesScanned = - StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesScannedNode.GetText()).c_str()).c_str()); - m_bytesScannedHasBeenSet = true; - } - XmlNode bytesProcessedNode = resultNode.FirstChild("BytesProcessed"); - if (!bytesProcessedNode.IsNull()) { - m_bytesProcessed = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesProcessedNode.GetText()).c_str()).c_str()); - m_bytesProcessedHasBeenSet = true; - } - XmlNode bytesReturnedNode = resultNode.FirstChild("BytesReturned"); - if (!bytesReturnedNode.IsNull()) { - m_bytesReturned = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesReturnedNode.GetText()).c_str()).c_str()); - m_bytesReturnedHasBeenSet = true; - } - } - - return *this; -} - -void Progress::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_bytesScannedHasBeenSet) { - XmlNode bytesScannedNode = parentNode.CreateChildElement("BytesScanned"); - ss << m_bytesScanned; - bytesScannedNode.SetText(ss.str()); - ss.str(""); - } - - if (m_bytesProcessedHasBeenSet) { - XmlNode bytesProcessedNode = parentNode.CreateChildElement("BytesProcessed"); - ss << m_bytesProcessed; - bytesProcessedNode.SetText(ss.str()); - ss.str(""); - } - - if (m_bytesReturnedHasBeenSet) { - XmlNode bytesReturnedNode = parentNode.CreateChildElement("BytesReturned"); - ss << m_bytesReturned; - bytesReturnedNode.SetText(ss.str()); - ss.str(""); - } -} +void Progress::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ProgressEvent.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ProgressEvent.cpp index 509d5c8ff9c..3b32a01c614 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ProgressEvent.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ProgressEvent.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { ProgressEvent::ProgressEvent(const XmlNode& xmlNode) { *this = xmlNode; } -ProgressEvent& ProgressEvent::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode detailsNode = resultNode; - if (!detailsNode.IsNull()) { - m_details = detailsNode; - m_detailsHasBeenSet = true; - } - } - - return *this; -} - -void ProgressEvent::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_detailsHasBeenSet) { - XmlNode detailsNode = parentNode.CreateChildElement("Details"); - m_details.AddToNode(detailsNode); - } -} +ProgressEvent& ProgressEvent::operator=(const XmlNode& xmlNode) { return *this; } + +void ProgressEvent::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Protocol.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Protocol.cpp index 5d982d3f15e..0ba9cad4eef 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Protocol.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Protocol.cpp @@ -30,7 +30,6 @@ Protocol GetProtocolForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Protocol::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForProtocol(Protocol enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PublicAccessBlockConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PublicAccessBlockConfiguration.cpp index 7b8143a0429..da9e046b6fa 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PublicAccessBlockConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PublicAccessBlockConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,69 +20,9 @@ namespace Model { PublicAccessBlockConfiguration::PublicAccessBlockConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -PublicAccessBlockConfiguration& PublicAccessBlockConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +PublicAccessBlockConfiguration& PublicAccessBlockConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode blockPublicAclsNode = resultNode.FirstChild("BlockPublicAcls"); - if (!blockPublicAclsNode.IsNull()) { - m_blockPublicAcls = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(blockPublicAclsNode.GetText()).c_str()).c_str()); - m_blockPublicAclsHasBeenSet = true; - } - XmlNode ignorePublicAclsNode = resultNode.FirstChild("IgnorePublicAcls"); - if (!ignorePublicAclsNode.IsNull()) { - m_ignorePublicAcls = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(ignorePublicAclsNode.GetText()).c_str()).c_str()); - m_ignorePublicAclsHasBeenSet = true; - } - XmlNode blockPublicPolicyNode = resultNode.FirstChild("BlockPublicPolicy"); - if (!blockPublicPolicyNode.IsNull()) { - m_blockPublicPolicy = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(blockPublicPolicyNode.GetText()).c_str()).c_str()); - m_blockPublicPolicyHasBeenSet = true; - } - XmlNode restrictPublicBucketsNode = resultNode.FirstChild("RestrictPublicBuckets"); - if (!restrictPublicBucketsNode.IsNull()) { - m_restrictPublicBuckets = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(restrictPublicBucketsNode.GetText()).c_str()).c_str()); - m_restrictPublicBucketsHasBeenSet = true; - } - } - - return *this; -} - -void PublicAccessBlockConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_blockPublicAclsHasBeenSet) { - XmlNode blockPublicAclsNode = parentNode.CreateChildElement("BlockPublicAcls"); - ss << std::boolalpha << m_blockPublicAcls; - blockPublicAclsNode.SetText(ss.str()); - ss.str(""); - } - - if (m_ignorePublicAclsHasBeenSet) { - XmlNode ignorePublicAclsNode = parentNode.CreateChildElement("IgnorePublicAcls"); - ss << std::boolalpha << m_ignorePublicAcls; - ignorePublicAclsNode.SetText(ss.str()); - ss.str(""); - } - - if (m_blockPublicPolicyHasBeenSet) { - XmlNode blockPublicPolicyNode = parentNode.CreateChildElement("BlockPublicPolicy"); - ss << std::boolalpha << m_blockPublicPolicy; - blockPublicPolicyNode.SetText(ss.str()); - ss.str(""); - } - - if (m_restrictPublicBucketsHasBeenSet) { - XmlNode restrictPublicBucketsNode = parentNode.CreateChildElement("RestrictPublicBuckets"); - ss << std::boolalpha << m_restrictPublicBuckets; - restrictPublicBucketsNode.SetText(ss.str()); - ss.str(""); - } -} +void PublicAccessBlockConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAbacRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAbacRequest.cpp index b87c40b4a78..78c58e4482b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAbacRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAbacRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,36 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String PutBucketAbacRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AbacStatus"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_abacStatus.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutBucketAbacRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutBucketAbacRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutBucketAbacRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -55,29 +29,32 @@ Aws::Http::HeaderValueCollection PutBucketAbacRequest::GetRequestSpecificHeaders headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutBucketAbacRequest::EndpointParameters PutBucketAbacRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutBucketAbacRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } - Aws::String PutBucketAbacRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -87,3 +64,12 @@ Aws::String PutBucketAbacRequest::GetChecksumAlgorithmName() const { } bool PutBucketAbacRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutBucketAbacRequest::EndpointParameters PutBucketAbacRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAccelerateConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAccelerateConfigurationRequest.cpp index 0128b2abfdc..96081f108f2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAccelerateConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAccelerateConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,23 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketAccelerateConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } +Aws::String PutBucketAccelerateConfigurationRequest::SerializePayload() const { return {}; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; +Aws::Http::HeaderValueCollection PutBucketAccelerateConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; -} - -Aws::String PutBucketAccelerateConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AccelerateConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_accelerateConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - - return {}; + return headers; } -void PutBucketAccelerateConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketAccelerateConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,29 +45,35 @@ void PutBucketAccelerateConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketAccelerateConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool PutBucketAccelerateConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} +Aws::String PutBucketAccelerateConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketAccelerateConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketAccelerateConfigurationRequest::EndpointParameters PutBucketAccelerateConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -91,13 +85,3 @@ PutBucketAccelerateConfigurationRequest::EndpointParameters PutBucketAccelerateC } return parameters; } - -Aws::String PutBucketAccelerateConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketAccelerateConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAclRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAclRequest.cpp index 8b1569621cb..a0bb1a95fab 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAclRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAclRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutBucketAclRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AccessControlPolicy"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_accessControlPolicy.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutBucketAclRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutBucketAclRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutBucketAclRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -70,68 +27,76 @@ Aws::Http::HeaderValueCollection PutBucketAclRequest::GetRequestSpecificHeaders( if (m_aCLHasBeenSet && m_aCL != BucketCannedACL::NOT_SET) { headers.emplace("x-amz-acl", BucketCannedACLMapper::GetNameForBucketCannedACL(m_aCL)); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteHasBeenSet) { ss << m_grantWrite; headers.emplace("x-amz-grant-write", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutBucketAclRequest::EndpointParameters PutBucketAclRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Static context parameters - parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, - Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutBucketAclRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutBucketAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutBucketAclRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -141,3 +106,15 @@ Aws::String PutBucketAclRequest::GetChecksumAlgorithmName() const { } bool PutBucketAclRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutBucketAclRequest::EndpointParameters PutBucketAclRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Static context parameters + parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, + Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAnalyticsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAnalyticsConfigurationRequest.cpp index 545d9581098..2bb2e90943f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAnalyticsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketAnalyticsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketAnalyticsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} +Aws::String PutBucketAnalyticsConfigurationRequest::SerializePayload() const { return {}; } -Aws::String PutBucketAnalyticsConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AnalyticsConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_analyticsConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection PutBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketAnalyticsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,23 +47,24 @@ void PutBucketAnalyticsConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketAnalyticsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool PutBucketAnalyticsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } PutBucketAnalyticsConfigurationRequest::EndpointParameters PutBucketAnalyticsConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketCorsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketCorsRequest.cpp index f92d6c1d4e9..c96cac578c2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketCorsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketCorsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketCorsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketCorsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketCorsRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("CORSConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_cORSConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketCorsRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketCorsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketCorsRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketCorsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketCorsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketCorsRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketCorsRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketCorsRequest::EndpointParameters PutBucketCorsRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketCorsRequest::EndpointParameters PutBucketCorsRequest::GetEndpointContex } return parameters; } - -Aws::String PutBucketCorsRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketCorsRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp index 18b405ec1db..d373ae0cfc6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketEncryptionRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketEncryptionRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketEncryptionRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("ServerSideEncryptionConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_serverSideEncryptionConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketEncryptionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketEncryptionRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketEncryptionRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketEncryptionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketEncryptionRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketEncryptionRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketEncryptionRequest::EndpointParameters PutBucketEncryptionRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketEncryptionRequest::EndpointParameters PutBucketEncryptionRequest::GetEn } return parameters; } - -Aws::String PutBucketEncryptionRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketEncryptionRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketIntelligentTieringConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketIntelligentTieringConfigurationRequest.cpp index f2cc7242fd9..d93bf2c8a0d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketIntelligentTieringConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketIntelligentTieringConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,46 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, - const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketIntelligentTieringConfigurationRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutBucketIntelligentTieringConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("IntelligentTieringConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_intelligentTieringConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection PutBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -64,23 +47,25 @@ void PutBucketIntelligentTieringConfigurationRequest::AddQueryStringParameters(U collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketIntelligentTieringConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool PutBucketIntelligentTieringConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, + const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } PutBucketIntelligentTieringConfigurationRequest::EndpointParameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketInventoryConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketInventoryConfigurationRequest.cpp index 42e8b753d44..f411c02c06c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketInventoryConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketInventoryConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} +Aws::String PutBucketInventoryConfigurationRequest::SerializePayload() const { return {}; } -Aws::String PutBucketInventoryConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("InventoryConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_inventoryConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection PutBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketInventoryConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,23 +47,24 @@ void PutBucketInventoryConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketInventoryConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool PutBucketInventoryConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } PutBucketInventoryConfigurationRequest::EndpointParameters PutBucketInventoryConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationRequest.cpp index ae551e96440..a8d888c966c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,29 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketLifecycleConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketLifecycleConfigurationRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketLifecycleConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; -} - -Aws::String PutBucketLifecycleConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("LifecycleConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_lifecycleConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_transitionDefaultMinimumObjectSizeHasBeenSet && + m_transitionDefaultMinimumObjectSize != TransitionDefaultMinimumObjectSize::NOT_SET) { + headers.emplace( + "x-amz-transition-default-minimum-object-size", + TransitionDefaultMinimumObjectSizeMapper::GetNameForTransitionDefaultMinimumObjectSize(m_transitionDefaultMinimumObjectSize)); } - - return {}; + return headers; } -void PutBucketLifecycleConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketLifecycleConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,36 +51,35 @@ void PutBucketLifecycleConfigurationRequest::AddQueryStringParameters(URI& uri) collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketLifecycleConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); +bool PutBucketLifecycleConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_transitionDefaultMinimumObjectSizeHasBeenSet && - m_transitionDefaultMinimumObjectSize != TransitionDefaultMinimumObjectSize::NOT_SET) { - headers.emplace( - "x-amz-transition-default-minimum-object-size", - TransitionDefaultMinimumObjectSizeMapper::GetNameForTransitionDefaultMinimumObjectSize(m_transitionDefaultMinimumObjectSize)); + return false; +} +Aws::String PutBucketLifecycleConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketLifecycleConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketLifecycleConfigurationRequest::EndpointParameters PutBucketLifecycleConfigurationRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -98,13 +91,3 @@ PutBucketLifecycleConfigurationRequest::EndpointParameters PutBucketLifecycleCon } return parameters; } - -Aws::String PutBucketLifecycleConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketLifecycleConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationResult.cpp index ba4bbb5ae58..7f0e67e0eb4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLifecycleConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -22,26 +24,5 @@ PutBucketLifecycleConfigurationResult::PutBucketLifecycleConfigurationResult(con PutBucketLifecycleConfigurationResult& PutBucketLifecycleConfigurationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& transitionDefaultMinimumObjectSizeIter = headers.find("x-amz-transition-default-minimum-object-size"); - if (transitionDefaultMinimumObjectSizeIter != headers.end()) { - m_transitionDefaultMinimumObjectSize = TransitionDefaultMinimumObjectSizeMapper::GetTransitionDefaultMinimumObjectSizeForName( - transitionDefaultMinimumObjectSizeIter->second); - m_transitionDefaultMinimumObjectSizeHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLoggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLoggingRequest.cpp index ed487f40a7d..b9349f0f44d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLoggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketLoggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketLoggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketLoggingRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketLoggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketLoggingRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("BucketLoggingStatus"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_bucketLoggingStatus.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketLoggingRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketLoggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketLoggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketLoggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketLoggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketLoggingRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketLoggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketLoggingRequest::EndpointParameters PutBucketLoggingRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketLoggingRequest::EndpointParameters PutBucketLoggingRequest::GetEndpoint } return parameters; } - -Aws::String PutBucketLoggingRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketLoggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketMetricsConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketMetricsConfigurationRequest.cpp index b304d8fa44b..3bab8e8d54e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketMetricsConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketMetricsConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,26 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} +Aws::String PutBucketMetricsConfigurationRequest::SerializePayload() const { return {}; } -Aws::String PutBucketMetricsConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("MetricsConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_metricsConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection PutBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketMetricsConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_idHasBeenSet) { ss << m_id; uri.AddQueryStringParameter("id", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,23 +47,24 @@ void PutBucketMetricsConfigurationRequest::AddQueryStringParameters(URI& uri) co collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketMetricsConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +bool PutBucketMetricsConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - return headers; + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; } PutBucketMetricsConfigurationRequest::EndpointParameters PutBucketMetricsConfigurationRequest::GetEndpointContextParams() const { diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketNotificationConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketNotificationConfigurationRequest.cpp index 99463921a16..7c52922c29a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketNotificationConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketNotificationConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,18 +19,25 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String PutBucketNotificationConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("NotificationConfiguration"); +Aws::String PutBucketNotificationConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_notificationConfiguration.AddToNode(parentNode); - - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection PutBucketNotificationConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + if (m_skipDestinationValidationHasBeenSet) { + ss << std::boolalpha << m_skipDestinationValidation; + headers.emplace("x-amz-skip-destination-validation", ss.str()); + ss.str(""); + } + return headers; } -void PutBucketNotificationConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketNotificationConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -37,43 +47,21 @@ void PutBucketNotificationConfigurationRequest::AddQueryStringParameters(URI& ur collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketNotificationConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); - } - - if (m_skipDestinationValidationHasBeenSet) { - ss << std::boolalpha << m_skipDestinationValidation; - headers.emplace("x-amz-skip-destination-validation", ss.str()); - ss.str(""); - } - - return headers; -} - bool PutBucketNotificationConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused AWS_UNREFERENCED_PARAM(header); - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = Utils::Xml::XmlDocument::CreateFromXmlStream(body); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); body.seekg(readPointer); if (!doc.WasParseSuccessful()) { return false; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { return true; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketOwnershipControlsRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketOwnershipControlsRequest.cpp index f3b71120310..dac5c756495 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketOwnershipControlsRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketOwnershipControlsRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketOwnershipControlsRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - return false; -} - -Aws::String PutBucketOwnershipControlsRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("OwnershipControls"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_ownershipControls.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - - return {}; + return headers; } -void PutBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketOwnershipControlsRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketOwnershipControlsRequest::AddQueryStringParameters(URI& uri) const collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketOwnershipControlsRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketOwnershipControlsRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + return false; +} +Aws::String PutBucketOwnershipControlsRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketOwnershipControlsRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketOwnershipControlsRequest::EndpointParameters PutBucketOwnershipControlsRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketOwnershipControlsRequest::EndpointParameters PutBucketOwnershipControls } return parameters; } - -Aws::String PutBucketOwnershipControlsRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketOwnershipControlsRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketPolicyRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketPolicyRequest.cpp index 6f90a5fe4fe..e714af5699d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketPolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketPolicyRequest.cpp @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include @@ -13,26 +13,8 @@ using namespace Aws::S3::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; -using namespace Aws::Http; using namespace Aws; -void PutBucketPolicyRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection PutBucketPolicyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -41,44 +23,60 @@ Aws::Http::HeaderValueCollection PutBucketPolicyRequest::GetRequestSpecificHeade headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_confirmRemoveSelfBucketAccessHasBeenSet) { ss << std::boolalpha << m_confirmRemoveSelfBucketAccess; headers.emplace("x-amz-confirm-remove-self-bucket-access", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void PutBucketPolicyRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + bool PutBucketPolicyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused AWS_UNREFERENCED_PARAM(header); - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = Utils::Xml::XmlDocument::CreateFromXmlStream(body); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { return false; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { return true; } - return false; } +Aws::String PutBucketPolicyRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); + } +} + +bool PutBucketPolicyRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } PutBucketPolicyRequest::EndpointParameters PutBucketPolicyRequest::GetEndpointContextParams() const { EndpointParameters parameters; @@ -91,13 +89,3 @@ PutBucketPolicyRequest::EndpointParameters PutBucketPolicyRequest::GetEndpointCo } return parameters; } - -Aws::String PutBucketPolicyRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketPolicyRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketReplicationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketReplicationRequest.cpp index 95740c37eec..d7e9a096574 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketReplicationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketReplicationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutBucketReplicationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("ReplicationConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_replicationConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutBucketReplicationRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutBucketReplicationRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutBucketReplicationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -72,38 +29,51 @@ Aws::Http::HeaderValueCollection PutBucketReplicationRequest::GetRequestSpecific headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_tokenHasBeenSet) { ss << m_token; headers.emplace("x-amz-bucket-object-lock-token", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutBucketReplicationRequest::EndpointParameters PutBucketReplicationRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Static context parameters - parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, - Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutBucketReplicationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutBucketReplicationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutBucketReplicationRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -113,3 +83,15 @@ Aws::String PutBucketReplicationRequest::GetChecksumAlgorithmName() const { } bool PutBucketReplicationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutBucketReplicationRequest::EndpointParameters PutBucketReplicationRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Static context parameters + parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, + Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketRequestPaymentRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketRequestPaymentRequest.cpp index 3bbab4ce437..d03b08381cc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketRequestPaymentRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketRequestPaymentRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketRequestPaymentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketRequestPaymentRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketRequestPaymentRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketRequestPaymentRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("RequestPaymentConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_requestPaymentConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketRequestPaymentRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketRequestPaymentRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketRequestPaymentRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketRequestPaymentRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketRequestPaymentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketRequestPaymentRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketRequestPaymentRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketRequestPaymentRequest::EndpointParameters PutBucketRequestPaymentRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketRequestPaymentRequest::EndpointParameters PutBucketRequestPaymentReques } return parameters; } - -Aws::String PutBucketRequestPaymentRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketRequestPaymentRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketTaggingRequest.cpp index c99c14e4c55..abf65fc59eb 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketTaggingRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketTaggingRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("Tagging"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_tagging.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketTaggingRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketTaggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketTaggingRequest::EndpointParameters PutBucketTaggingRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketTaggingRequest::EndpointParameters PutBucketTaggingRequest::GetEndpoint } return parameters; } - -Aws::String PutBucketTaggingRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketTaggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketVersioningRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketVersioningRequest.cpp index 2fbdeb72c6d..8368b70d70b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketVersioningRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketVersioningRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketVersioningRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutBucketVersioningRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("VersioningConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_versioningConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutBucketVersioningRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutBucketVersioningRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutBucketVersioningRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -72,38 +29,51 @@ Aws::Http::HeaderValueCollection PutBucketVersioningRequest::GetRequestSpecificH headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_mFAHasBeenSet) { ss << m_mFA; headers.emplace("x-amz-mfa", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutBucketVersioningRequest::EndpointParameters PutBucketVersioningRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Static context parameters - parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, - Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutBucketVersioningRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutBucketVersioningRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutBucketVersioningRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -113,3 +83,15 @@ Aws::String PutBucketVersioningRequest::GetChecksumAlgorithmName() const { } bool PutBucketVersioningRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutBucketVersioningRequest::EndpointParameters PutBucketVersioningRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Static context parameters + parameters.emplace_back(Aws::String("UseS3ExpressControlEndpoint"), true, + Aws::Endpoint::EndpointParameter::ParameterOrigin::STATIC_CONTEXT); + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketWebsiteRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketWebsiteRequest.cpp index 84159502424..33f9dbdc01f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutBucketWebsiteRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutBucketWebsiteRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutBucketWebsiteRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutBucketWebsiteRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutBucketWebsiteRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("WebsiteConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_websiteConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { +void PutBucketWebsiteRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutBucketWebsiteRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutBucketWebsiteRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutBucketWebsiteRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutBucketWebsiteRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutBucketWebsiteRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutBucketWebsiteRequest::EndpointParameters PutBucketWebsiteRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutBucketWebsiteRequest::EndpointParameters PutBucketWebsiteRequest::GetEndpoint } return parameters; } - -Aws::String PutBucketWebsiteRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutBucketWebsiteRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclRequest.cpp index fc8b9677019..962f890d034 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,59 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutObjectAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutObjectAclRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AccessControlPolicy"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_accessControlPolicy.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutObjectAclRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutObjectAclRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutObjectAclRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -76,72 +27,84 @@ Aws::Http::HeaderValueCollection PutObjectAclRequest::GetRequestSpecificHeaders( if (m_aCLHasBeenSet && m_aCL != ObjectCannedACL::NOT_SET) { headers.emplace("x-amz-acl", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL)); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteHasBeenSet) { ss << m_grantWrite; headers.emplace("x-amz-grant-write", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutObjectAclRequest::EndpointParameters PutObjectAclRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutObjectAclRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); } - if (KeyHasBeenSet()) { - parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutObjectAclRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutObjectAclRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -151,3 +114,15 @@ Aws::String PutObjectAclRequest::GetChecksumAlgorithmName() const { } bool PutObjectAclRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutObjectAclRequest::EndpointParameters PutObjectAclRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + if (KeyHasBeenSet()) { + parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclResult.cpp index 71472c332dc..d9905e0443e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAclResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; PutObjectAclResult::PutObjectAclResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectAclResult& PutObjectAclResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectAclResult& PutObjectAclResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationRequest.cpp index b2fe00d3882..9f62c6455a3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationRequest.cpp @@ -4,7 +4,6 @@ */ #include -#include #include #include #include @@ -14,38 +13,8 @@ using namespace Aws::S3::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; -using namespace Aws::Http; using namespace Aws; -void PutObjectAnnotationRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (m_annotationNameHasBeenSet) { - ss << m_annotationName; - uri.AddQueryStringParameter("annotationName", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection PutObjectAnnotationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -54,102 +23,100 @@ Aws::Http::HeaderValueCollection PutObjectAnnotationRequest::GetRequestSpecificH headers.emplace("x-amz-object-if-match", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_checksumCRC32HasBeenSet) { ss << m_checksumCRC32; headers.emplace("x-amz-checksum-crc32", ss.str()); ss.str(""); } - if (m_checksumCRC32CHasBeenSet) { ss << m_checksumCRC32C; headers.emplace("x-amz-checksum-crc32c", ss.str()); ss.str(""); } - if (m_checksumCRC64NVMEHasBeenSet) { ss << m_checksumCRC64NVME; headers.emplace("x-amz-checksum-crc64nvme", ss.str()); ss.str(""); } - if (m_checksumSHA1HasBeenSet) { ss << m_checksumSHA1; headers.emplace("x-amz-checksum-sha1", ss.str()); ss.str(""); } - if (m_checksumSHA256HasBeenSet) { ss << m_checksumSHA256; headers.emplace("x-amz-checksum-sha256", ss.str()); ss.str(""); } - if (m_checksumSHA512HasBeenSet) { ss << m_checksumSHA512; headers.emplace("x-amz-checksum-sha512", ss.str()); ss.str(""); } - if (m_checksumMD5HasBeenSet) { ss << m_checksumMD5; headers.emplace("x-amz-checksum-md5", ss.str()); ss.str(""); } - if (m_checksumXXHASH64HasBeenSet) { ss << m_checksumXXHASH64; headers.emplace("x-amz-checksum-xxhash64", ss.str()); ss.str(""); } - if (m_checksumXXHASH3HasBeenSet) { ss << m_checksumXXHASH3; headers.emplace("x-amz-checksum-xxhash3", ss.str()); ss.str(""); } - if (m_checksumXXHASH128HasBeenSet) { ss << m_checksumXXHASH128; headers.emplace("x-amz-checksum-xxhash128", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutObjectAnnotationRequest::EndpointParameters PutObjectAnnotationRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutObjectAnnotationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); } - if (KeyHasBeenSet()) { - parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + if (m_annotationNameHasBeenSet) { + ss << m_annotationName; + uri.AddQueryStringParameter("annotationName", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } - Aws::String PutObjectAnnotationRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -159,3 +126,15 @@ Aws::String PutObjectAnnotationRequest::GetChecksumAlgorithmName() const { } bool PutObjectAnnotationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutObjectAnnotationRequest::EndpointParameters PutObjectAnnotationRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + if (KeyHasBeenSet()) { + parameters.emplace_back(Aws::String("Key"), this->GetKey(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationResult.cpp index 302978c08ba..4df05d5f0b4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectAnnotationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,120 +20,4 @@ using namespace Aws; PutObjectAnnotationResult::PutObjectAnnotationResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectAnnotationResult& PutObjectAnnotationResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode annotationNameNode = resultNode.FirstChild("AnnotationName"); - if (!annotationNameNode.IsNull()) { - m_annotationName = Aws::Utils::Xml::DecodeEscapedXmlText(annotationNameNode.GetText()); - m_annotationNameHasBeenSet = true; - } - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& objectVersionIdIter = headers.find("x-amz-object-version-id"); - if (objectVersionIdIter != headers.end()) { - m_objectVersionId = objectVersionIdIter->second; - m_objectVersionIdHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectAnnotationResult& PutObjectAnnotationResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldRequest.cpp index 3fe6729a6c3..dcb04dbb857 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,37 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutObjectLegalHoldRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutObjectLegalHoldRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutObjectLegalHoldRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - return false; -} - -Aws::String PutObjectLegalHoldRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("LegalHold"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_legalHold.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - - return {}; + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void PutObjectLegalHoldRequest::AddQueryStringParameters(URI& uri) const { +void PutObjectLegalHoldRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,39 +58,35 @@ void PutObjectLegalHoldRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutObjectLegalHoldRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); - } - - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutObjectLegalHoldRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutObjectLegalHoldRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutObjectLegalHoldRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutObjectLegalHoldRequest::EndpointParameters PutObjectLegalHoldRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters @@ -104,13 +95,3 @@ PutObjectLegalHoldRequest::EndpointParameters PutObjectLegalHoldRequest::GetEndp } return parameters; } - -Aws::String PutObjectLegalHoldRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutObjectLegalHoldRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldResult.cpp index dca72e82967..ad2210f8051 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLegalHoldResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; PutObjectLegalHoldResult::PutObjectLegalHoldResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectLegalHoldResult& PutObjectLegalHoldResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectLegalHoldResult& PutObjectLegalHoldResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationRequest.cpp index 913673cf262..30fa0456a04 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,53 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutObjectLockConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutObjectLockConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("ObjectLockConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_objectLockConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutObjectLockConfigurationRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutObjectLockConfigurationRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutObjectLockConfigurationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -70,41 +27,56 @@ Aws::Http::HeaderValueCollection PutObjectLockConfigurationRequest::GetRequestSp if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_tokenHasBeenSet) { ss << m_token; headers.emplace("x-amz-bucket-object-lock-token", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutObjectLockConfigurationRequest::EndpointParameters PutObjectLockConfigurationRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutObjectLockConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutObjectLockConfigurationRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutObjectLockConfigurationRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -114,3 +86,12 @@ Aws::String PutObjectLockConfigurationRequest::GetChecksumAlgorithmName() const } bool PutObjectLockConfigurationRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutObjectLockConfigurationRequest::EndpointParameters PutObjectLockConfigurationRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationResult.cpp index 48b9a552926..042e78b5753 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectLockConfigurationResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -21,25 +23,5 @@ PutObjectLockConfigurationResult::PutObjectLockConfigurationResult(const Aws::Am } PutObjectLockConfigurationResult& PutObjectLockConfigurationResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRequest.cpp index ac3e8809e11..eb892196aff 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRequest.cpp @@ -4,7 +4,6 @@ */ #include -#include #include #include #include @@ -14,179 +13,135 @@ using namespace Aws::S3::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; -using namespace Aws::Http; using namespace Aws; -void PutObjectRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection PutObjectRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if (m_aCLHasBeenSet && m_aCL != ObjectCannedACL::NOT_SET) { headers.emplace("x-amz-acl", ObjectCannedACLMapper::GetNameForObjectCannedACL(m_aCL)); } - if (m_cacheControlHasBeenSet) { ss << m_cacheControl; headers.emplace("cache-control", ss.str()); ss.str(""); } - if (m_contentDispositionHasBeenSet) { ss << m_contentDisposition; headers.emplace("content-disposition", ss.str()); ss.str(""); } - if (m_contentEncodingHasBeenSet) { ss << m_contentEncoding; headers.emplace("content-encoding", ss.str()); ss.str(""); } - if (m_contentLanguageHasBeenSet) { ss << m_contentLanguage; headers.emplace("content-language", ss.str()); ss.str(""); } - if (m_contentLengthHasBeenSet) { ss << m_contentLength; headers.emplace("content-length", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_checksumCRC32HasBeenSet) { ss << m_checksumCRC32; headers.emplace("x-amz-checksum-crc32", ss.str()); ss.str(""); } - if (m_checksumCRC32CHasBeenSet) { ss << m_checksumCRC32C; headers.emplace("x-amz-checksum-crc32c", ss.str()); ss.str(""); } - if (m_checksumCRC64NVMEHasBeenSet) { ss << m_checksumCRC64NVME; headers.emplace("x-amz-checksum-crc64nvme", ss.str()); ss.str(""); } - if (m_checksumSHA1HasBeenSet) { ss << m_checksumSHA1; headers.emplace("x-amz-checksum-sha1", ss.str()); ss.str(""); } - if (m_checksumSHA256HasBeenSet) { ss << m_checksumSHA256; headers.emplace("x-amz-checksum-sha256", ss.str()); ss.str(""); } - if (m_checksumSHA512HasBeenSet) { ss << m_checksumSHA512; headers.emplace("x-amz-checksum-sha512", ss.str()); ss.str(""); } - if (m_checksumMD5HasBeenSet) { ss << m_checksumMD5; headers.emplace("x-amz-checksum-md5", ss.str()); ss.str(""); } - if (m_checksumXXHASH64HasBeenSet) { ss << m_checksumXXHASH64; headers.emplace("x-amz-checksum-xxhash64", ss.str()); ss.str(""); } - if (m_checksumXXHASH3HasBeenSet) { ss << m_checksumXXHASH3; headers.emplace("x-amz-checksum-xxhash3", ss.str()); ss.str(""); } - if (m_checksumXXHASH128HasBeenSet) { ss << m_checksumXXHASH128; headers.emplace("x-amz-checksum-xxhash128", ss.str()); ss.str(""); } - if (m_expiresHasBeenSet) { headers.emplace("expires", m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_ifMatchHasBeenSet) { ss << m_ifMatch; headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_ifNoneMatchHasBeenSet) { ss << m_ifNoneMatch; headers.emplace("if-none-match", ss.str()); ss.str(""); } - if (m_grantFullControlHasBeenSet) { ss << m_grantFullControl; headers.emplace("x-amz-grant-full-control", ss.str()); ss.str(""); } - if (m_grantReadHasBeenSet) { ss << m_grantRead; headers.emplace("x-amz-grant-read", ss.str()); ss.str(""); } - if (m_grantReadACPHasBeenSet) { ss << m_grantReadACP; headers.emplace("x-amz-grant-read-acp", ss.str()); ss.str(""); } - if (m_grantWriteACPHasBeenSet) { ss << m_grantWriteACP; headers.emplace("x-amz-grant-write-acp", ss.str()); ss.str(""); } - if (m_writeOffsetBytesHasBeenSet) { ss << m_writeOffsetBytes; headers.emplace("x-amz-write-offset-bytes", ss.str()); ss.str(""); } - if (m_metadataHasBeenSet) { for (const auto& item : m_metadata) { ss << "x-amz-meta-" << item.first; @@ -194,107 +149,111 @@ Aws::Http::HeaderValueCollection PutObjectRequest::GetRequestSpecificHeaders() c ss.str(""); } } - if (m_serverSideEncryptionHasBeenSet && m_serverSideEncryption != ServerSideEncryption::NOT_SET) { headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); } - if (m_storageClassHasBeenSet && m_storageClass != StorageClass::NOT_SET) { headers.emplace("x-amz-storage-class", StorageClassMapper::GetNameForStorageClass(m_storageClass)); } - if (m_websiteRedirectLocationHasBeenSet) { ss << m_websiteRedirectLocation; headers.emplace("x-amz-website-redirect-location", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_sSEKMSKeyIdHasBeenSet) { ss << m_sSEKMSKeyId; headers.emplace("x-amz-server-side-encryption-aws-kms-key-id", ss.str()); ss.str(""); } - if (m_sSEKMSEncryptionContextHasBeenSet) { ss << m_sSEKMSEncryptionContext; headers.emplace("x-amz-server-side-encryption-context", ss.str()); ss.str(""); } - if (m_bucketKeyEnabledHasBeenSet) { ss << std::boolalpha << m_bucketKeyEnabled; headers.emplace("x-amz-server-side-encryption-bucket-key-enabled", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_taggingHasBeenSet) { ss << m_tagging; headers.emplace("x-amz-tagging", ss.str()); ss.str(""); } - if (m_objectLockModeHasBeenSet && m_objectLockMode != ObjectLockMode::NOT_SET) { headers.emplace("x-amz-object-lock-mode", ObjectLockModeMapper::GetNameForObjectLockMode(m_objectLockMode)); } - if (m_objectLockRetainUntilDateHasBeenSet) { headers.emplace("x-amz-object-lock-retain-until-date", m_objectLockRetainUntilDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } - if (m_objectLockLegalHoldStatusHasBeenSet && m_objectLockLegalHoldStatus != ObjectLockLegalHoldStatus::NOT_SET) { headers.emplace("x-amz-object-lock-legal-hold", ObjectLockLegalHoldStatusMapper::GetNameForObjectLockLegalHoldStatus(m_objectLockLegalHoldStatus)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void PutObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + bool PutObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused AWS_UNREFERENCED_PARAM(header); - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = Utils::Xml::XmlDocument::CreateFromXmlStream(body); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { return false; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { return true; } - return false; } +Aws::String PutObjectRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); + } +} + +bool PutObjectRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } PutObjectRequest::EndpointParameters PutObjectRequest::GetEndpointContextParams() const { EndpointParameters parameters; @@ -307,13 +266,3 @@ PutObjectRequest::EndpointParameters PutObjectRequest::GetEndpointContextParams( } return parameters; } - -Aws::String PutObjectRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutObjectRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectResult.cpp index f76828dc20d..521ab618b22 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,152 +20,4 @@ using namespace Aws; PutObjectResult::PutObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectResult& PutObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& expirationIter = headers.find("x-amz-expiration"); - if (expirationIter != headers.end()) { - m_expiration = expirationIter->second; - m_expirationHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& checksumTypeIter = headers.find("x-amz-checksum-type"); - if (checksumTypeIter != headers.end()) { - m_checksumType = ChecksumTypeMapper::GetChecksumTypeForName(checksumTypeIter->second); - m_checksumTypeHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& sSEKMSEncryptionContextIter = headers.find("x-amz-server-side-encryption-context"); - if (sSEKMSEncryptionContextIter != headers.end()) { - m_sSEKMSEncryptionContext = sSEKMSEncryptionContextIter->second; - m_sSEKMSEncryptionContextHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& sizeIter = headers.find("x-amz-object-size"); - if (sizeIter != headers.end()) { - m_size = StringUtils::ConvertToInt64(sizeIter->second.c_str()); - m_sizeHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectResult& PutObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionRequest.cpp index cbe1b245917..15a63084163 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,59 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutObjectRetentionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String PutObjectRetentionRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("Retention"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_retention.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void PutObjectRetentionRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String PutObjectRetentionRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection PutObjectRetentionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -76,41 +27,61 @@ Aws::Http::HeaderValueCollection PutObjectRetentionRequest::GetRequestSpecificHe if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_bypassGovernanceRetentionHasBeenSet) { ss << std::boolalpha << m_bypassGovernanceRetention; headers.emplace("x-amz-bypass-governance-retention", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } -PutObjectRetentionRequest::EndpointParameters PutObjectRetentionRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void PutObjectRetentionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } +bool PutObjectRetentionRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} Aws::String PutObjectRetentionRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -120,3 +91,12 @@ Aws::String PutObjectRetentionRequest::GetChecksumAlgorithmName() const { } bool PutObjectRetentionRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +PutObjectRetentionRequest::EndpointParameters PutObjectRetentionRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionResult.cpp index fa71883f435..8e2e1270265 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectRetentionResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; PutObjectRetentionResult::PutObjectRetentionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectRetentionResult& PutObjectRetentionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectRetentionResult& PutObjectRetentionResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingRequest.cpp index 4d5dcf457fc..370db0cde6f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,37 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutObjectTaggingRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutObjectTaggingRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutObjectTaggingRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("Tagging"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_tagging.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + } + return headers; } -void PutObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { +void PutObjectTaggingRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,39 +58,35 @@ void PutObjectTaggingRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutObjectTaggingRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); +bool PutObjectTaggingRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); + return false; +} +Aws::String PutObjectTaggingRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutObjectTaggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutObjectTaggingRequest::EndpointParameters PutObjectTaggingRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters @@ -104,13 +95,3 @@ PutObjectTaggingRequest::EndpointParameters PutObjectTaggingRequest::GetEndpoint } return parameters; } - -Aws::String PutObjectTaggingRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutObjectTaggingRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingResult.cpp index f4d4c2cdeef..4e2c8556ea1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutObjectTaggingResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,26 +20,4 @@ using namespace Aws; PutObjectTaggingResult::PutObjectTaggingResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutObjectTaggingResult& PutObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& versionIdIter = headers.find("x-amz-version-id"); - if (versionIdIter != headers.end()) { - m_versionId = versionIdIter->second; - m_versionIdHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutObjectTaggingResult& PutObjectTaggingResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/PutPublicAccessBlockRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/PutPublicAccessBlockRequest.cpp index 79fa617bf89..9ec9337b6c1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/PutPublicAccessBlockRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/PutPublicAccessBlockRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,38 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool PutPublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String PutPublicAccessBlockRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection PutPublicAccessBlockRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String PutPublicAccessBlockRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("PublicAccessBlockConfiguration"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_publicAccessBlockConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void PutPublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { +void PutPublicAccessBlockRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -57,35 +50,35 @@ void PutPublicAccessBlockRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection PutPublicAccessBlockRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); +bool PutPublicAccessBlockRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String PutPublicAccessBlockRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool PutPublicAccessBlockRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + PutPublicAccessBlockRequest::EndpointParameters PutPublicAccessBlockRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters @@ -97,13 +90,3 @@ PutPublicAccessBlockRequest::EndpointParameters PutPublicAccessBlockRequest::Get } return parameters; } - -Aws::String PutPublicAccessBlockRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool PutPublicAccessBlockRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/QueueConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/QueueConfiguration.cpp index 6296fcd1adf..a2b2eae5709 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/QueueConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/QueueConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,65 +20,9 @@ namespace Model { QueueConfiguration::QueueConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -QueueConfiguration& QueueConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +QueueConfiguration& QueueConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode queueArnNode = resultNode.FirstChild("Queue"); - if (!queueArnNode.IsNull()) { - m_queueArn = Aws::Utils::Xml::DecodeEscapedXmlText(queueArnNode.GetText()); - m_queueArnHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - } - - return *this; -} - -void QueueConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_queueArnHasBeenSet) { - XmlNode queueArnNode = parentNode.CreateChildElement("Queue"); - queueArnNode.SetText(m_queueArn); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } -} +void QueueConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/QueueConfigurationDeprecated.cpp b/generated/src/aws-cpp-sdk-s3/source/model/QueueConfigurationDeprecated.cpp deleted file mode 100644 index 31f33659a05..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/QueueConfigurationDeprecated.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -QueueConfigurationDeprecated::QueueConfigurationDeprecated(const XmlNode& xmlNode) { *this = xmlNode; } - -QueueConfigurationDeprecated& QueueConfigurationDeprecated::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode queueNode = resultNode.FirstChild("Queue"); - if (!queueNode.IsNull()) { - m_queue = Aws::Utils::Xml::DecodeEscapedXmlText(queueNode.GetText()); - m_queueHasBeenSet = true; - } - } - - return *this; -} - -void QueueConfigurationDeprecated::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_queueHasBeenSet) { - XmlNode queueNode = parentNode.CreateChildElement("Queue"); - queueNode.SetText(m_queue); - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/QuoteFields.cpp b/generated/src/aws-cpp-sdk-s3/source/model/QuoteFields.cpp index 204d1bf29b3..c85e34b78a7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/QuoteFields.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/QuoteFields.cpp @@ -30,7 +30,6 @@ QuoteFields GetQuoteFieldsForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return QuoteFields::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForQuoteFields(QuoteFields enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RecordExpiration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RecordExpiration.cpp index c9fb0163f3f..4ba1b74e70b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RecordExpiration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RecordExpiration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,40 +20,9 @@ namespace Model { RecordExpiration::RecordExpiration(const XmlNode& xmlNode) { *this = xmlNode; } -RecordExpiration& RecordExpiration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode expirationNode = resultNode.FirstChild("Expiration"); - if (!expirationNode.IsNull()) { - m_expiration = ExpirationStateMapper::GetExpirationStateForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(expirationNode.GetText()).c_str())); - m_expirationHasBeenSet = true; - } - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - } - - return *this; -} - -void RecordExpiration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_expirationHasBeenSet) { - XmlNode expirationNode = parentNode.CreateChildElement("Expiration"); - expirationNode.SetText(ExpirationStateMapper::GetNameForExpirationState(m_expiration)); - } - - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } -} +RecordExpiration& RecordExpiration::operator=(const XmlNode& xmlNode) { return *this; } + +void RecordExpiration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Redirect.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Redirect.cpp index fcb1424f389..63b4ceb8590 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Redirect.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Redirect.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,68 +20,9 @@ namespace Model { Redirect::Redirect(const XmlNode& xmlNode) { *this = xmlNode; } -Redirect& Redirect::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Redirect& Redirect::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode hostNameNode = resultNode.FirstChild("HostName"); - if (!hostNameNode.IsNull()) { - m_hostName = Aws::Utils::Xml::DecodeEscapedXmlText(hostNameNode.GetText()); - m_hostNameHasBeenSet = true; - } - XmlNode httpRedirectCodeNode = resultNode.FirstChild("HttpRedirectCode"); - if (!httpRedirectCodeNode.IsNull()) { - m_httpRedirectCode = Aws::Utils::Xml::DecodeEscapedXmlText(httpRedirectCodeNode.GetText()); - m_httpRedirectCodeHasBeenSet = true; - } - XmlNode protocolNode = resultNode.FirstChild("Protocol"); - if (!protocolNode.IsNull()) { - m_protocol = - ProtocolMapper::GetProtocolForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(protocolNode.GetText()).c_str())); - m_protocolHasBeenSet = true; - } - XmlNode replaceKeyPrefixWithNode = resultNode.FirstChild("ReplaceKeyPrefixWith"); - if (!replaceKeyPrefixWithNode.IsNull()) { - m_replaceKeyPrefixWith = Aws::Utils::Xml::DecodeEscapedXmlText(replaceKeyPrefixWithNode.GetText()); - m_replaceKeyPrefixWithHasBeenSet = true; - } - XmlNode replaceKeyWithNode = resultNode.FirstChild("ReplaceKeyWith"); - if (!replaceKeyWithNode.IsNull()) { - m_replaceKeyWith = Aws::Utils::Xml::DecodeEscapedXmlText(replaceKeyWithNode.GetText()); - m_replaceKeyWithHasBeenSet = true; - } - } - - return *this; -} - -void Redirect::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_hostNameHasBeenSet) { - XmlNode hostNameNode = parentNode.CreateChildElement("HostName"); - hostNameNode.SetText(m_hostName); - } - - if (m_httpRedirectCodeHasBeenSet) { - XmlNode httpRedirectCodeNode = parentNode.CreateChildElement("HttpRedirectCode"); - httpRedirectCodeNode.SetText(m_httpRedirectCode); - } - - if (m_protocolHasBeenSet) { - XmlNode protocolNode = parentNode.CreateChildElement("Protocol"); - protocolNode.SetText(ProtocolMapper::GetNameForProtocol(m_protocol)); - } - - if (m_replaceKeyPrefixWithHasBeenSet) { - XmlNode replaceKeyPrefixWithNode = parentNode.CreateChildElement("ReplaceKeyPrefixWith"); - replaceKeyPrefixWithNode.SetText(m_replaceKeyPrefixWith); - } - - if (m_replaceKeyWithHasBeenSet) { - XmlNode replaceKeyWithNode = parentNode.CreateChildElement("ReplaceKeyWith"); - replaceKeyWithNode.SetText(m_replaceKeyWith); - } -} +void Redirect::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RedirectAllRequestsTo.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RedirectAllRequestsTo.cpp index 8899a0f0926..0509c923994 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RedirectAllRequestsTo.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RedirectAllRequestsTo.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { RedirectAllRequestsTo::RedirectAllRequestsTo(const XmlNode& xmlNode) { *this = xmlNode; } -RedirectAllRequestsTo& RedirectAllRequestsTo::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode hostNameNode = resultNode.FirstChild("HostName"); - if (!hostNameNode.IsNull()) { - m_hostName = Aws::Utils::Xml::DecodeEscapedXmlText(hostNameNode.GetText()); - m_hostNameHasBeenSet = true; - } - XmlNode protocolNode = resultNode.FirstChild("Protocol"); - if (!protocolNode.IsNull()) { - m_protocol = - ProtocolMapper::GetProtocolForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(protocolNode.GetText()).c_str())); - m_protocolHasBeenSet = true; - } - } - - return *this; -} - -void RedirectAllRequestsTo::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_hostNameHasBeenSet) { - XmlNode hostNameNode = parentNode.CreateChildElement("HostName"); - hostNameNode.SetText(m_hostName); - } - - if (m_protocolHasBeenSet) { - XmlNode protocolNode = parentNode.CreateChildElement("Protocol"); - protocolNode.SetText(ProtocolMapper::GetNameForProtocol(m_protocol)); - } -} +RedirectAllRequestsTo& RedirectAllRequestsTo::operator=(const XmlNode& xmlNode) { return *this; } + +void RedirectAllRequestsTo::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectRequest.cpp index a6c4b0ad7a5..e46613f3755 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -18,23 +21,6 @@ using namespace Aws::Http; Aws::String RenameObjectRequest::SerializePayload() const { return {}; } -void RenameObjectRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection RenameObjectRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -43,56 +29,62 @@ Aws::Http::HeaderValueCollection RenameObjectRequest::GetRequestSpecificHeaders( headers.emplace("x-amz-rename-source", ss.str()); ss.str(""); } - if (m_destinationIfMatchHasBeenSet) { ss << m_destinationIfMatch; headers.emplace("if-match", ss.str()); ss.str(""); } - if (m_destinationIfNoneMatchHasBeenSet) { ss << m_destinationIfNoneMatch; headers.emplace("if-none-match", ss.str()); ss.str(""); } - if (m_destinationIfModifiedSinceHasBeenSet) { headers.emplace("if-modified-since", m_destinationIfModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_destinationIfUnmodifiedSinceHasBeenSet) { headers.emplace("if-unmodified-since", m_destinationIfUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_sourceIfMatchHasBeenSet) { ss << m_sourceIfMatch; headers.emplace("x-amz-rename-source-if-match", ss.str()); ss.str(""); } - if (m_sourceIfNoneMatchHasBeenSet) { ss << m_sourceIfNoneMatch; headers.emplace("x-amz-rename-source-if-none-match", ss.str()); ss.str(""); } - if (m_sourceIfModifiedSinceHasBeenSet) { headers.emplace("x-amz-rename-source-if-modified-since", m_sourceIfModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_sourceIfUnmodifiedSinceHasBeenSet) { headers.emplace("x-amz-rename-source-if-unmodified-since", m_sourceIfUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_clientTokenHasBeenSet) { ss << m_clientToken; headers.emplace("x-amz-client-token", ss.str()); ss.str(""); } - return headers; } +void RenameObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + RenameObjectRequest::EndpointParameters RenameObjectRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectResult.cpp index 47fa259e6fc..d236080dc0d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RenameObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,20 +20,4 @@ using namespace Aws; RenameObjectResult::RenameObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -RenameObjectResult& RenameObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +RenameObjectResult& RenameObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModifications.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModifications.cpp index 9c5d1023a74..93d1f527fe0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModifications.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModifications.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { ReplicaModifications::ReplicaModifications(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicaModifications& ReplicaModifications::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ReplicaModificationsStatusMapper::GetReplicaModificationsStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void ReplicaModifications::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ReplicaModificationsStatusMapper::GetNameForReplicaModificationsStatus(m_status)); - } -} +ReplicaModifications& ReplicaModifications::operator=(const XmlNode& xmlNode) { return *this; } + +void ReplicaModifications::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModificationsStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModificationsStatus.cpp index cb3a084e84f..f6f6ce98392 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModificationsStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicaModificationsStatus.cpp @@ -30,7 +30,6 @@ ReplicaModificationsStatus GetReplicaModificationsStatusForName(const Aws::Strin overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReplicaModificationsStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForReplicaModificationsStatus(ReplicaModificationsStatus enum if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationConfiguration.cpp index 72b5ca2dfd3..173a415d8a5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,45 +20,9 @@ namespace Model { ReplicationConfiguration::ReplicationConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationConfiguration& ReplicationConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ReplicationConfiguration& ReplicationConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode roleNode = resultNode.FirstChild("Role"); - if (!roleNode.IsNull()) { - m_role = Aws::Utils::Xml::DecodeEscapedXmlText(roleNode.GetText()); - m_roleHasBeenSet = true; - } - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_roleHasBeenSet) { - XmlNode roleNode = parentNode.CreateChildElement("Role"); - roleNode.SetText(m_role); - } - - if (m_rulesHasBeenSet) { - for (const auto& item : m_rules) { - XmlNode rulesNode = parentNode.CreateChildElement("Rule"); - item.AddToNode(rulesNode); - } - } -} +void ReplicationConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRule.cpp index 313785c0af4..8d1faa4e140 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,101 +20,9 @@ namespace Model { ReplicationRule::ReplicationRule(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationRule& ReplicationRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ReplicationRule& ReplicationRule::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - XmlNode priorityNode = resultNode.FirstChild("Priority"); - if (!priorityNode.IsNull()) { - m_priority = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(priorityNode.GetText()).c_str()).c_str()); - m_priorityHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ReplicationRuleStatusMapper::GetReplicationRuleStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode sourceSelectionCriteriaNode = resultNode.FirstChild("SourceSelectionCriteria"); - if (!sourceSelectionCriteriaNode.IsNull()) { - m_sourceSelectionCriteria = sourceSelectionCriteriaNode; - m_sourceSelectionCriteriaHasBeenSet = true; - } - XmlNode existingObjectReplicationNode = resultNode.FirstChild("ExistingObjectReplication"); - if (!existingObjectReplicationNode.IsNull()) { - m_existingObjectReplication = existingObjectReplicationNode; - m_existingObjectReplicationHasBeenSet = true; - } - XmlNode destinationNode = resultNode.FirstChild("Destination"); - if (!destinationNode.IsNull()) { - m_destination = destinationNode; - m_destinationHasBeenSet = true; - } - XmlNode deleteMarkerReplicationNode = resultNode.FirstChild("DeleteMarkerReplication"); - if (!deleteMarkerReplicationNode.IsNull()) { - m_deleteMarkerReplication = deleteMarkerReplicationNode; - m_deleteMarkerReplicationHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_priorityHasBeenSet) { - XmlNode priorityNode = parentNode.CreateChildElement("Priority"); - ss << m_priority; - priorityNode.SetText(ss.str()); - ss.str(""); - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ReplicationRuleStatusMapper::GetNameForReplicationRuleStatus(m_status)); - } - - if (m_sourceSelectionCriteriaHasBeenSet) { - XmlNode sourceSelectionCriteriaNode = parentNode.CreateChildElement("SourceSelectionCriteria"); - m_sourceSelectionCriteria.AddToNode(sourceSelectionCriteriaNode); - } - - if (m_existingObjectReplicationHasBeenSet) { - XmlNode existingObjectReplicationNode = parentNode.CreateChildElement("ExistingObjectReplication"); - m_existingObjectReplication.AddToNode(existingObjectReplicationNode); - } - - if (m_destinationHasBeenSet) { - XmlNode destinationNode = parentNode.CreateChildElement("Destination"); - m_destination.AddToNode(destinationNode); - } - - if (m_deleteMarkerReplicationHasBeenSet) { - XmlNode deleteMarkerReplicationNode = parentNode.CreateChildElement("DeleteMarkerReplication"); - m_deleteMarkerReplication.AddToNode(deleteMarkerReplicationNode); - } -} +void ReplicationRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleAndOperator.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleAndOperator.cpp index f1764e3c869..8bb961390a8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleAndOperator.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleAndOperator.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,45 +20,9 @@ namespace Model { ReplicationRuleAndOperator::ReplicationRuleAndOperator(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationRuleAndOperator& ReplicationRuleAndOperator::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ReplicationRuleAndOperator& ReplicationRuleAndOperator::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagsNode = resultNode.FirstChild("Tag"); - if (!tagsNode.IsNull()) { - XmlNode tagMember = tagsNode; - m_tagsHasBeenSet = !tagMember.IsNull(); - while (!tagMember.IsNull()) { - m_tags.push_back(tagMember); - tagMember = tagMember.NextNode("Tag"); - } - - m_tagsHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationRuleAndOperator::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagsHasBeenSet) { - for (const auto& item : m_tags) { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } - } -} +void ReplicationRuleAndOperator::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleFilter.cpp index 2425cd3756a..7f79193d1cf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,47 +20,9 @@ namespace Model { ReplicationRuleFilter::ReplicationRuleFilter(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationRuleFilter& ReplicationRuleFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ReplicationRuleFilter& ReplicationRuleFilter::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if (!tagNode.IsNull()) { - m_tag = tagNode; - m_tagHasBeenSet = true; - } - XmlNode andNode = resultNode.FirstChild("And"); - if (!andNode.IsNull()) { - m_and = andNode; - m_andHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationRuleFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_tagHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); - } - - if (m_andHasBeenSet) { - XmlNode andNode = parentNode.CreateChildElement("And"); - m_and.AddToNode(andNode); - } -} +void ReplicationRuleFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleStatus.cpp index 27f95a0510e..cd620cce4e8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationRuleStatus.cpp @@ -30,7 +30,6 @@ ReplicationRuleStatus GetReplicationRuleStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReplicationRuleStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForReplicationRuleStatus(ReplicationRuleStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationStatus.cpp index f0c14d1e9b9..44589aad9f6 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationStatus.cpp @@ -36,7 +36,6 @@ ReplicationStatus GetReplicationStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReplicationStatus::NOT_SET; } @@ -57,7 +56,6 @@ Aws::String GetNameForReplicationStatus(ReplicationStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTime.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTime.cpp index 5416551d4df..adfc06b1f6b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTime.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTime.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { ReplicationTime::ReplicationTime(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationTime& ReplicationTime::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ReplicationTimeStatusMapper::GetReplicationTimeStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode timeNode = resultNode.FirstChild("Time"); - if (!timeNode.IsNull()) { - m_time = timeNode; - m_timeHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationTime::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ReplicationTimeStatusMapper::GetNameForReplicationTimeStatus(m_status)); - } - - if (m_timeHasBeenSet) { - XmlNode timeNode = parentNode.CreateChildElement("Time"); - m_time.AddToNode(timeNode); - } -} +ReplicationTime& ReplicationTime::operator=(const XmlNode& xmlNode) { return *this; } + +void ReplicationTime::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeStatus.cpp index 2ecf1aa7894..7fe9bc4e2fd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeStatus.cpp @@ -30,7 +30,6 @@ ReplicationTimeStatus GetReplicationTimeStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReplicationTimeStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForReplicationTimeStatus(ReplicationTimeStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeValue.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeValue.cpp index 5ee8ad61e3c..5e9acb02442 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeValue.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ReplicationTimeValue.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,30 +20,9 @@ namespace Model { ReplicationTimeValue::ReplicationTimeValue(const XmlNode& xmlNode) { *this = xmlNode; } -ReplicationTimeValue& ReplicationTimeValue::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode minutesNode = resultNode.FirstChild("Minutes"); - if (!minutesNode.IsNull()) { - m_minutes = - StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(minutesNode.GetText()).c_str()).c_str()); - m_minutesHasBeenSet = true; - } - } - - return *this; -} - -void ReplicationTimeValue::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_minutesHasBeenSet) { - XmlNode minutesNode = parentNode.CreateChildElement("Minutes"); - ss << m_minutes; - minutesNode.SetText(ss.str()); - ss.str(""); - } -} +ReplicationTimeValue& ReplicationTimeValue::operator=(const XmlNode& xmlNode) { return *this; } + +void ReplicationTimeValue::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RequestCharged.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RequestCharged.cpp index 7bef6d78d56..8e08876116d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RequestCharged.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RequestCharged.cpp @@ -27,7 +27,6 @@ RequestCharged GetRequestChargedForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return RequestCharged::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForRequestCharged(RequestCharged enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RequestPayer.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RequestPayer.cpp index d666969a0ee..8a891bbcd64 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RequestPayer.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RequestPayer.cpp @@ -27,7 +27,6 @@ RequestPayer GetRequestPayerForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return RequestPayer::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForRequestPayer(RequestPayer enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RequestPaymentConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RequestPaymentConfiguration.cpp index dde3c499461..05090d3bf01 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RequestPaymentConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RequestPaymentConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { RequestPaymentConfiguration::RequestPaymentConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -RequestPaymentConfiguration& RequestPaymentConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode payerNode = resultNode.FirstChild("Payer"); - if (!payerNode.IsNull()) { - m_payer = PayerMapper::GetPayerForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(payerNode.GetText()).c_str())); - m_payerHasBeenSet = true; - } - } - - return *this; -} - -void RequestPaymentConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_payerHasBeenSet) { - XmlNode payerNode = parentNode.CreateChildElement("Payer"); - payerNode.SetText(PayerMapper::GetNameForPayer(m_payer)); - } -} +RequestPaymentConfiguration& RequestPaymentConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void RequestPaymentConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RequestProgress.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RequestProgress.cpp index e30aa7c33f7..53aedc21eff 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RequestProgress.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RequestProgress.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,30 +20,9 @@ namespace Model { RequestProgress::RequestProgress(const XmlNode& xmlNode) { *this = xmlNode; } -RequestProgress& RequestProgress::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode enabledNode = resultNode.FirstChild("Enabled"); - if (!enabledNode.IsNull()) { - m_enabled = - StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(enabledNode.GetText()).c_str()).c_str()); - m_enabledHasBeenSet = true; - } - } - - return *this; -} - -void RequestProgress::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_enabledHasBeenSet) { - XmlNode enabledNode = parentNode.CreateChildElement("Enabled"); - ss << std::boolalpha << m_enabled; - enabledNode.SetText(ss.str()); - ss.str(""); - } -} +RequestProgress& RequestProgress::operator=(const XmlNode& xmlNode) { return *this; } + +void RequestProgress::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectRequest.cpp index f926df2e9df..a54d7afd395 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,45 +19,32 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool RestoreObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); +Aws::String RestoreObjectRequest::SerializePayload() const { return {}; } - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; +Aws::Http::HeaderValueCollection RestoreObjectRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { + headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return false; -} - -Aws::String RestoreObjectRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("RestoreRequest"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_restoreRequest.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); } - - return {}; + return headers; } -void RestoreObjectRequest::AddQueryStringParameters(URI& uri) const { +void RestoreObjectRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (m_versionIdHasBeenSet) { ss << m_versionId; uri.AddQueryStringParameter("versionId", ss.str()); ss.str(""); } - if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" Aws::Map collectedLogTags; @@ -63,33 +53,35 @@ void RestoreObjectRequest::AddQueryStringParameters(URI& uri) const { collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } -Aws::Http::HeaderValueCollection RestoreObjectRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { - headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); +bool RestoreObjectRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); + return false; +} +Aws::String RestoreObjectRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } - - return headers; } +bool RestoreObjectRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + RestoreObjectRequest::EndpointParameters RestoreObjectRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters @@ -98,13 +90,3 @@ RestoreObjectRequest::EndpointParameters RestoreObjectRequest::GetEndpointContex } return parameters; } - -Aws::String RestoreObjectRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool RestoreObjectRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectResult.cpp index 946c5e5377e..706ea15a2d3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RestoreObjectResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,32 +20,4 @@ using namespace Aws; RestoreObjectResult::RestoreObjectResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -RestoreObjectResult& RestoreObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& restoreOutputPathIter = headers.find("x-amz-restore-output-path"); - if (restoreOutputPathIter != headers.end()) { - m_restoreOutputPath = restoreOutputPathIter->second; - m_restoreOutputPathHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +RestoreObjectResult& RestoreObjectResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequest.cpp index 1dbcab1b3b5..744b283862d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequest.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,90 +20,9 @@ namespace Model { RestoreRequest::RestoreRequest(const XmlNode& xmlNode) { *this = xmlNode; } -RestoreRequest& RestoreRequest::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +RestoreRequest& RestoreRequest::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - XmlNode glacierJobParametersNode = resultNode.FirstChild("GlacierJobParameters"); - if (!glacierJobParametersNode.IsNull()) { - m_glacierJobParameters = glacierJobParametersNode; - m_glacierJobParametersHasBeenSet = true; - } - XmlNode typeNode = resultNode.FirstChild("Type"); - if (!typeNode.IsNull()) { - m_type = RestoreRequestTypeMapper::GetRestoreRequestTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(typeNode.GetText()).c_str())); - m_typeHasBeenSet = true; - } - XmlNode tierNode = resultNode.FirstChild("Tier"); - if (!tierNode.IsNull()) { - m_tier = TierMapper::GetTierForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(tierNode.GetText()).c_str())); - m_tierHasBeenSet = true; - } - XmlNode descriptionNode = resultNode.FirstChild("Description"); - if (!descriptionNode.IsNull()) { - m_description = Aws::Utils::Xml::DecodeEscapedXmlText(descriptionNode.GetText()); - m_descriptionHasBeenSet = true; - } - XmlNode selectParametersNode = resultNode.FirstChild("SelectParameters"); - if (!selectParametersNode.IsNull()) { - m_selectParameters = selectParametersNode; - m_selectParametersHasBeenSet = true; - } - XmlNode outputLocationNode = resultNode.FirstChild("OutputLocation"); - if (!outputLocationNode.IsNull()) { - m_outputLocation = outputLocationNode; - m_outputLocationHasBeenSet = true; - } - } - - return *this; -} - -void RestoreRequest::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_glacierJobParametersHasBeenSet) { - XmlNode glacierJobParametersNode = parentNode.CreateChildElement("GlacierJobParameters"); - m_glacierJobParameters.AddToNode(glacierJobParametersNode); - } - - if (m_typeHasBeenSet) { - XmlNode typeNode = parentNode.CreateChildElement("Type"); - typeNode.SetText(RestoreRequestTypeMapper::GetNameForRestoreRequestType(m_type)); - } - - if (m_tierHasBeenSet) { - XmlNode tierNode = parentNode.CreateChildElement("Tier"); - tierNode.SetText(TierMapper::GetNameForTier(m_tier)); - } - - if (m_descriptionHasBeenSet) { - XmlNode descriptionNode = parentNode.CreateChildElement("Description"); - descriptionNode.SetText(m_description); - } - - if (m_selectParametersHasBeenSet) { - XmlNode selectParametersNode = parentNode.CreateChildElement("SelectParameters"); - m_selectParameters.AddToNode(selectParametersNode); - } - - if (m_outputLocationHasBeenSet) { - XmlNode outputLocationNode = parentNode.CreateChildElement("OutputLocation"); - m_outputLocation.AddToNode(outputLocationNode); - } -} +void RestoreRequest::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequestType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequestType.cpp index bf8f3f2375a..91bc0ec58f1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequestType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RestoreRequestType.cpp @@ -27,7 +27,6 @@ RestoreRequestType GetRestoreRequestTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return RestoreRequestType::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForRestoreRequestType(RestoreRequestType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RestoreStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RestoreStatus.cpp index c5b7f064648..310760541d3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RestoreStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RestoreStatus.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,42 +20,9 @@ namespace Model { RestoreStatus::RestoreStatus(const XmlNode& xmlNode) { *this = xmlNode; } -RestoreStatus& RestoreStatus::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode isRestoreInProgressNode = resultNode.FirstChild("IsRestoreInProgress"); - if (!isRestoreInProgressNode.IsNull()) { - m_isRestoreInProgress = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isRestoreInProgressNode.GetText()).c_str()).c_str()); - m_isRestoreInProgressHasBeenSet = true; - } - XmlNode restoreExpiryDateNode = resultNode.FirstChild("RestoreExpiryDate"); - if (!restoreExpiryDateNode.IsNull()) { - m_restoreExpiryDate = - DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(restoreExpiryDateNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_restoreExpiryDateHasBeenSet = true; - } - } - - return *this; -} - -void RestoreStatus::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_isRestoreInProgressHasBeenSet) { - XmlNode isRestoreInProgressNode = parentNode.CreateChildElement("IsRestoreInProgress"); - ss << std::boolalpha << m_isRestoreInProgress; - isRestoreInProgressNode.SetText(ss.str()); - ss.str(""); - } - - if (m_restoreExpiryDateHasBeenSet) { - XmlNode restoreExpiryDateNode = parentNode.CreateChildElement("RestoreExpiryDate"); - restoreExpiryDateNode.SetText(m_restoreExpiryDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } -} +RestoreStatus& RestoreStatus::operator=(const XmlNode& xmlNode) { return *this; } + +void RestoreStatus::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/RoutingRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/RoutingRule.cpp index 0efb3e6b35a..b6b0c9330a1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/RoutingRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/RoutingRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { RoutingRule::RoutingRule(const XmlNode& xmlNode) { *this = xmlNode; } -RoutingRule& RoutingRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode conditionNode = resultNode.FirstChild("Condition"); - if (!conditionNode.IsNull()) { - m_condition = conditionNode; - m_conditionHasBeenSet = true; - } - XmlNode redirectNode = resultNode.FirstChild("Redirect"); - if (!redirectNode.IsNull()) { - m_redirect = redirectNode; - m_redirectHasBeenSet = true; - } - } - - return *this; -} - -void RoutingRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_conditionHasBeenSet) { - XmlNode conditionNode = parentNode.CreateChildElement("Condition"); - m_condition.AddToNode(conditionNode); - } - - if (m_redirectHasBeenSet) { - XmlNode redirectNode = parentNode.CreateChildElement("Redirect"); - m_redirect.AddToNode(redirectNode); - } -} +RoutingRule& RoutingRule::operator=(const XmlNode& xmlNode) { return *this; } + +void RoutingRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Rule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Rule.cpp deleted file mode 100644 index de5f54bf899..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/Rule.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -Rule::Rule(const XmlNode& xmlNode) { *this = xmlNode; } - -Rule& Rule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode expirationNode = resultNode.FirstChild("Expiration"); - if (!expirationNode.IsNull()) { - m_expiration = expirationNode; - m_expirationHasBeenSet = true; - } - XmlNode iDNode = resultNode.FirstChild("ID"); - if (!iDNode.IsNull()) { - m_iD = Aws::Utils::Xml::DecodeEscapedXmlText(iDNode.GetText()); - m_iDHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = ExpirationStatusMapper::GetExpirationStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - XmlNode transitionNode = resultNode.FirstChild("Transition"); - if (!transitionNode.IsNull()) { - m_transition = transitionNode; - m_transitionHasBeenSet = true; - } - XmlNode noncurrentVersionTransitionNode = resultNode.FirstChild("NoncurrentVersionTransition"); - if (!noncurrentVersionTransitionNode.IsNull()) { - m_noncurrentVersionTransition = noncurrentVersionTransitionNode; - m_noncurrentVersionTransitionHasBeenSet = true; - } - XmlNode noncurrentVersionExpirationNode = resultNode.FirstChild("NoncurrentVersionExpiration"); - if (!noncurrentVersionExpirationNode.IsNull()) { - m_noncurrentVersionExpiration = noncurrentVersionExpirationNode; - m_noncurrentVersionExpirationHasBeenSet = true; - } - XmlNode abortIncompleteMultipartUploadNode = resultNode.FirstChild("AbortIncompleteMultipartUpload"); - if (!abortIncompleteMultipartUploadNode.IsNull()) { - m_abortIncompleteMultipartUpload = abortIncompleteMultipartUploadNode; - m_abortIncompleteMultipartUploadHasBeenSet = true; - } - } - - return *this; -} - -void Rule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_expirationHasBeenSet) { - XmlNode expirationNode = parentNode.CreateChildElement("Expiration"); - m_expiration.AddToNode(expirationNode); - } - - if (m_iDHasBeenSet) { - XmlNode iDNode = parentNode.CreateChildElement("ID"); - iDNode.SetText(m_iD); - } - - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(ExpirationStatusMapper::GetNameForExpirationStatus(m_status)); - } - - if (m_transitionHasBeenSet) { - XmlNode transitionNode = parentNode.CreateChildElement("Transition"); - m_transition.AddToNode(transitionNode); - } - - if (m_noncurrentVersionTransitionHasBeenSet) { - XmlNode noncurrentVersionTransitionNode = parentNode.CreateChildElement("NoncurrentVersionTransition"); - m_noncurrentVersionTransition.AddToNode(noncurrentVersionTransitionNode); - } - - if (m_noncurrentVersionExpirationHasBeenSet) { - XmlNode noncurrentVersionExpirationNode = parentNode.CreateChildElement("NoncurrentVersionExpiration"); - m_noncurrentVersionExpiration.AddToNode(noncurrentVersionExpirationNode); - } - - if (m_abortIncompleteMultipartUploadHasBeenSet) { - XmlNode abortIncompleteMultipartUploadNode = parentNode.CreateChildElement("AbortIncompleteMultipartUpload"); - m_abortIncompleteMultipartUpload.AddToNode(abortIncompleteMultipartUploadNode); - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/S3KeyFilter.cpp b/generated/src/aws-cpp-sdk-s3/source/model/S3KeyFilter.cpp index aced2a35956..4858729c35e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/S3KeyFilter.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/S3KeyFilter.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { S3KeyFilter::S3KeyFilter(const XmlNode& xmlNode) { *this = xmlNode; } -S3KeyFilter& S3KeyFilter::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode filterRulesNode = resultNode.FirstChild("FilterRule"); - if (!filterRulesNode.IsNull()) { - XmlNode filterRuleMember = filterRulesNode; - m_filterRulesHasBeenSet = !filterRuleMember.IsNull(); - while (!filterRuleMember.IsNull()) { - m_filterRules.push_back(filterRuleMember); - filterRuleMember = filterRuleMember.NextNode("FilterRule"); - } - - m_filterRulesHasBeenSet = true; - } - } - - return *this; -} - -void S3KeyFilter::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_filterRulesHasBeenSet) { - for (const auto& item : m_filterRules) { - XmlNode filterRulesNode = parentNode.CreateChildElement("FilterRule"); - item.AddToNode(filterRulesNode); - } - } -} +S3KeyFilter& S3KeyFilter::operator=(const XmlNode& xmlNode) { return *this; } + +void S3KeyFilter::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/S3Location.cpp b/generated/src/aws-cpp-sdk-s3/source/model/S3Location.cpp index bcb15510b6f..269f764c3a2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/S3Location.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/S3Location.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,117 +20,9 @@ namespace Model { S3Location::S3Location(const XmlNode& xmlNode) { *this = xmlNode; } -S3Location& S3Location::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +S3Location& S3Location::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode bucketNameNode = resultNode.FirstChild("BucketName"); - if (!bucketNameNode.IsNull()) { - m_bucketName = Aws::Utils::Xml::DecodeEscapedXmlText(bucketNameNode.GetText()); - m_bucketNameHasBeenSet = true; - } - XmlNode prefixNode = resultNode.FirstChild("Prefix"); - if (!prefixNode.IsNull()) { - m_prefix = Aws::Utils::Xml::DecodeEscapedXmlText(prefixNode.GetText()); - m_prefixHasBeenSet = true; - } - XmlNode encryptionNode = resultNode.FirstChild("Encryption"); - if (!encryptionNode.IsNull()) { - m_encryption = encryptionNode; - m_encryptionHasBeenSet = true; - } - XmlNode cannedACLNode = resultNode.FirstChild("CannedACL"); - if (!cannedACLNode.IsNull()) { - m_cannedACL = ObjectCannedACLMapper::GetObjectCannedACLForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(cannedACLNode.GetText()).c_str())); - m_cannedACLHasBeenSet = true; - } - XmlNode accessControlListNode = resultNode.FirstChild("AccessControlList"); - if (!accessControlListNode.IsNull()) { - XmlNode accessControlListMember = accessControlListNode.FirstChild("Grant"); - m_accessControlListHasBeenSet = !accessControlListMember.IsNull(); - while (!accessControlListMember.IsNull()) { - m_accessControlList.push_back(accessControlListMember); - accessControlListMember = accessControlListMember.NextNode("Grant"); - } - - m_accessControlListHasBeenSet = true; - } - XmlNode taggingNode = resultNode.FirstChild("Tagging"); - if (!taggingNode.IsNull()) { - m_tagging = taggingNode; - m_taggingHasBeenSet = true; - } - XmlNode userMetadataNode = resultNode.FirstChild("UserMetadata"); - if (!userMetadataNode.IsNull()) { - XmlNode userMetadataMember = userMetadataNode.FirstChild("MetadataEntry"); - m_userMetadataHasBeenSet = !userMetadataMember.IsNull(); - while (!userMetadataMember.IsNull()) { - m_userMetadata.push_back(userMetadataMember); - userMetadataMember = userMetadataMember.NextNode("MetadataEntry"); - } - - m_userMetadataHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = StorageClassMapper::GetStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - } - - return *this; -} - -void S3Location::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_bucketNameHasBeenSet) { - XmlNode bucketNameNode = parentNode.CreateChildElement("BucketName"); - bucketNameNode.SetText(m_bucketName); - } - - if (m_prefixHasBeenSet) { - XmlNode prefixNode = parentNode.CreateChildElement("Prefix"); - prefixNode.SetText(m_prefix); - } - - if (m_encryptionHasBeenSet) { - XmlNode encryptionNode = parentNode.CreateChildElement("Encryption"); - m_encryption.AddToNode(encryptionNode); - } - - if (m_cannedACLHasBeenSet) { - XmlNode cannedACLNode = parentNode.CreateChildElement("CannedACL"); - cannedACLNode.SetText(ObjectCannedACLMapper::GetNameForObjectCannedACL(m_cannedACL)); - } - - if (m_accessControlListHasBeenSet) { - XmlNode accessControlListParentNode = parentNode.CreateChildElement("AccessControlList"); - for (const auto& item : m_accessControlList) { - XmlNode accessControlListNode = accessControlListParentNode.CreateChildElement("Grant"); - item.AddToNode(accessControlListNode); - } - } - - if (m_taggingHasBeenSet) { - XmlNode taggingNode = parentNode.CreateChildElement("Tagging"); - m_tagging.AddToNode(taggingNode); - } - - if (m_userMetadataHasBeenSet) { - XmlNode userMetadataParentNode = parentNode.CreateChildElement("UserMetadata"); - for (const auto& item : m_userMetadata) { - XmlNode userMetadataNode = userMetadataParentNode.CreateChildElement("MetadataEntry"); - item.AddToNode(userMetadataNode); - } - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(StorageClassMapper::GetNameForStorageClass(m_storageClass)); - } -} +void S3Location::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesBucketType.cpp b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesBucketType.cpp index 162268e0f42..dac4f71f4f0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesBucketType.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesBucketType.cpp @@ -30,7 +30,6 @@ S3TablesBucketType GetS3TablesBucketTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return S3TablesBucketType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForS3TablesBucketType(S3TablesBucketType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestination.cpp b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestination.cpp index 8fec9676873..8878c76aba5 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestination.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestination.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { S3TablesDestination::S3TablesDestination(const XmlNode& xmlNode) { *this = xmlNode; } -S3TablesDestination& S3TablesDestination::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode tableBucketArnNode = resultNode.FirstChild("TableBucketArn"); - if (!tableBucketArnNode.IsNull()) { - m_tableBucketArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableBucketArnNode.GetText()); - m_tableBucketArnHasBeenSet = true; - } - XmlNode tableNameNode = resultNode.FirstChild("TableName"); - if (!tableNameNode.IsNull()) { - m_tableName = Aws::Utils::Xml::DecodeEscapedXmlText(tableNameNode.GetText()); - m_tableNameHasBeenSet = true; - } - } - - return *this; -} - -void S3TablesDestination::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tableBucketArnHasBeenSet) { - XmlNode tableBucketArnNode = parentNode.CreateChildElement("TableBucketArn"); - tableBucketArnNode.SetText(m_tableBucketArn); - } - - if (m_tableNameHasBeenSet) { - XmlNode tableNameNode = parentNode.CreateChildElement("TableName"); - tableNameNode.SetText(m_tableName); - } -} +S3TablesDestination& S3TablesDestination::operator=(const XmlNode& xmlNode) { return *this; } + +void S3TablesDestination::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestinationResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestinationResult.cpp index 63e2e920a8d..1e6409a413a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestinationResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/S3TablesDestinationResult.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,57 +20,9 @@ namespace Model { S3TablesDestinationResult::S3TablesDestinationResult(const XmlNode& xmlNode) { *this = xmlNode; } -S3TablesDestinationResult& S3TablesDestinationResult::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +S3TablesDestinationResult& S3TablesDestinationResult::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode tableBucketArnNode = resultNode.FirstChild("TableBucketArn"); - if (!tableBucketArnNode.IsNull()) { - m_tableBucketArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableBucketArnNode.GetText()); - m_tableBucketArnHasBeenSet = true; - } - XmlNode tableNameNode = resultNode.FirstChild("TableName"); - if (!tableNameNode.IsNull()) { - m_tableName = Aws::Utils::Xml::DecodeEscapedXmlText(tableNameNode.GetText()); - m_tableNameHasBeenSet = true; - } - XmlNode tableArnNode = resultNode.FirstChild("TableArn"); - if (!tableArnNode.IsNull()) { - m_tableArn = Aws::Utils::Xml::DecodeEscapedXmlText(tableArnNode.GetText()); - m_tableArnHasBeenSet = true; - } - XmlNode tableNamespaceNode = resultNode.FirstChild("TableNamespace"); - if (!tableNamespaceNode.IsNull()) { - m_tableNamespace = Aws::Utils::Xml::DecodeEscapedXmlText(tableNamespaceNode.GetText()); - m_tableNamespaceHasBeenSet = true; - } - } - - return *this; -} - -void S3TablesDestinationResult::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tableBucketArnHasBeenSet) { - XmlNode tableBucketArnNode = parentNode.CreateChildElement("TableBucketArn"); - tableBucketArnNode.SetText(m_tableBucketArn); - } - - if (m_tableNameHasBeenSet) { - XmlNode tableNameNode = parentNode.CreateChildElement("TableName"); - tableNameNode.SetText(m_tableName); - } - - if (m_tableArnHasBeenSet) { - XmlNode tableArnNode = parentNode.CreateChildElement("TableArn"); - tableArnNode.SetText(m_tableArn); - } - - if (m_tableNamespaceHasBeenSet) { - XmlNode tableNamespaceNode = parentNode.CreateChildElement("TableNamespace"); - tableNamespaceNode.SetText(m_tableNamespace); - } -} +void S3TablesDestinationResult::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SSEKMS.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SSEKMS.cpp index f4aaebb819c..fbfad9f8e6b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SSEKMS.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SSEKMS.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { SSEKMS::SSEKMS(const XmlNode& xmlNode) { *this = xmlNode; } -SSEKMS& SSEKMS::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode keyIdNode = resultNode.FirstChild("KeyId"); - if (!keyIdNode.IsNull()) { - m_keyId = Aws::Utils::Xml::DecodeEscapedXmlText(keyIdNode.GetText()); - m_keyIdHasBeenSet = true; - } - } - - return *this; -} - -void SSEKMS::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyIdHasBeenSet) { - XmlNode keyIdNode = parentNode.CreateChildElement("KeyId"); - keyIdNode.SetText(m_keyId); - } -} +SSEKMS& SSEKMS::operator=(const XmlNode& xmlNode) { return *this; } + +void SSEKMS::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SSEKMSEncryption.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SSEKMSEncryption.cpp index dbc54f50c87..2f52f3a11f4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SSEKMSEncryption.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SSEKMSEncryption.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,40 +20,9 @@ namespace Model { SSEKMSEncryption::SSEKMSEncryption(const XmlNode& xmlNode) { *this = xmlNode; } -SSEKMSEncryption& SSEKMSEncryption::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode kMSKeyArnNode = resultNode.FirstChild("KMSKeyArn"); - if (!kMSKeyArnNode.IsNull()) { - m_kMSKeyArn = Aws::Utils::Xml::DecodeEscapedXmlText(kMSKeyArnNode.GetText()); - m_kMSKeyArnHasBeenSet = true; - } - XmlNode bucketKeyEnabledNode = resultNode.FirstChild("BucketKeyEnabled"); - if (!bucketKeyEnabledNode.IsNull()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bucketKeyEnabledNode.GetText()).c_str()).c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - } - - return *this; -} - -void SSEKMSEncryption::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_kMSKeyArnHasBeenSet) { - XmlNode kMSKeyArnNode = parentNode.CreateChildElement("KMSKeyArn"); - kMSKeyArnNode.SetText(m_kMSKeyArn); - } - - if (m_bucketKeyEnabledHasBeenSet) { - XmlNode bucketKeyEnabledNode = parentNode.CreateChildElement("BucketKeyEnabled"); - ss << std::boolalpha << m_bucketKeyEnabled; - bucketKeyEnabledNode.SetText(ss.str()); - ss.str(""); - } -} +SSEKMSEncryption& SSEKMSEncryption::operator=(const XmlNode& xmlNode) { return *this; } + +void SSEKMSEncryption::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SSES3.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SSES3.cpp index 835d70ffbd5..55f91331c72 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SSES3.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SSES3.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,19 +20,9 @@ namespace Model { SSES3::SSES3(const XmlNode& xmlNode) { *this = xmlNode; } -SSES3& SSES3::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +SSES3& SSES3::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - } - - return *this; -} - -void SSES3::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - AWS_UNREFERENCED_PARAM(parentNode); -} +void SSES3::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ScanRange.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ScanRange.cpp index dc10e39bb12..501410b2b4f 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ScanRange.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ScanRange.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,41 +20,9 @@ namespace Model { ScanRange::ScanRange(const XmlNode& xmlNode) { *this = xmlNode; } -ScanRange& ScanRange::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode startNode = resultNode.FirstChild("Start"); - if (!startNode.IsNull()) { - m_start = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(startNode.GetText()).c_str()).c_str()); - m_startHasBeenSet = true; - } - XmlNode endNode = resultNode.FirstChild("End"); - if (!endNode.IsNull()) { - m_end = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(endNode.GetText()).c_str()).c_str()); - m_endHasBeenSet = true; - } - } - - return *this; -} - -void ScanRange::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_startHasBeenSet) { - XmlNode startNode = parentNode.CreateChildElement("Start"); - ss << m_start; - startNode.SetText(ss.str()); - ss.str(""); - } - - if (m_endHasBeenSet) { - XmlNode endNode = parentNode.CreateChildElement("End"); - ss << m_end; - endNode.SetText(ss.str()); - ss.str(""); - } -} +ScanRange& ScanRange::operator=(const XmlNode& xmlNode) { return *this; } + +void ScanRange::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentHandler.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentHandler.cpp index beaf9aaa8ab..10ed797c555 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentHandler.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentHandler.cpp @@ -4,16 +4,24 @@ */ #include +#include +#include #include #include +#include #include #include #include +#include + using namespace Aws::S3::Model; using namespace Aws::Utils::Event; using namespace Aws::Utils::Xml; +AWS_CORE_API extern const char MESSAGE_LOWER_CASE[]; +AWS_CORE_API extern const char MESSAGE_CAMEL_CASE[]; + namespace Aws { namespace S3 { namespace Model { @@ -27,38 +35,29 @@ SelectObjectContentHandler::SelectObjectContentHandler() : EventStreamHandler() "SelectObjectContent initial response received from " << (eventType == Utils::Event::InitialResponseType::ON_EVENT ? "event" : "http headers")); }; - m_onRecordsEvent = [&](const RecordsEvent&) { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "RecordsEvent received."); }; - m_onStatsEvent = [&](const StatsEvent&) { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "StatsEvent received."); }; - m_onProgressEvent = [&](const ProgressEvent&) { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "ProgressEvent received."); }; - m_onContinuationEvent = [&]() { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "ContinuationEvent received."); }; - m_onEndEvent = [&]() { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "EndEvent received."); }; - m_onError = [&](const AWSError& error) { AWS_LOGSTREAM_TRACE(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "S3 Errors received, " << error); }; } void SelectObjectContentHandler::OnEvent() { - // Handler internal error during event stream decoding. if (!*this) { AWSError error = EventStreamErrorsMapper::GetAwsErrorForEventStreamError(GetInternalError()); error.SetMessage(GetEventPayloadAsString()); m_onError(AWSError(error)); return; } - const auto& headers = GetEventHeaders(); auto messageTypeHeaderIter = headers.find(MESSAGE_TYPE_HEADER); if (messageTypeHeaderIter == headers.end()) { AWS_LOGSTREAM_WARN(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "Header: " << MESSAGE_TYPE_HEADER << " not found in the message."); return; } - switch (Aws::Utils::Event::Message::GetMessageTypeForName(messageTypeHeaderIter->second.GetEventHeaderValueAsString())) { case Aws::Utils::Event::Message::MessageType::EVENT: HandleEventInMessage(); @@ -96,30 +95,18 @@ void SelectObjectContentHandler::HandleEventInMessage() { break; } case SelectObjectContentEventType::RECORDS: { - RecordsEvent event(GetEventPayloadWithOwnership()); - m_onRecordsEvent(event); + // TODO: protocol-specific event payload deserialization + m_onRecordsEvent(RecordsEvent{}); break; } case SelectObjectContentEventType::STATS: { - auto xmlDoc = XmlDocument::CreateFromXmlString(GetEventPayloadAsString()); - if (!xmlDoc.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, - "Unable to generate a proper StatsEvent object from the response in XML format."); - break; - } - - m_onStatsEvent(StatsEvent(xmlDoc.GetRootElement())); + // TODO: protocol-specific event payload deserialization + m_onStatsEvent(StatsEvent{}); break; } case SelectObjectContentEventType::PROGRESS: { - auto xmlDoc = XmlDocument::CreateFromXmlString(GetEventPayloadAsString()); - if (!xmlDoc.WasParseSuccessful()) { - AWS_LOGSTREAM_WARN(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, - "Unable to generate a proper ProgressEvent object from the response in XML format."); - break; - } - - m_onProgressEvent(ProgressEvent(xmlDoc.GetRootElement())); + // TODO: protocol-specific event payload deserialization + m_onProgressEvent(ProgressEvent{}); break; } case SelectObjectContentEventType::CONT: { @@ -149,28 +136,24 @@ void SelectObjectContentHandler::HandleErrorInMessage() { return; } } - errorCode = errorHeaderIter->second.GetEventHeaderValueAsString(); errorHeaderIter = headers.find(ERROR_MESSAGE_HEADER); if (errorHeaderIter == headers.end()) { - errorHeaderIter = headers.find(EXCEPTION_TYPE_HEADER); - if (errorHeaderIter == headers.end()) { - AWS_LOGSTREAM_WARN(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "Error description was not found in the event message."); - return; - } + // TODO: read error message from payload once protocol-specific serde lands + // TODO: protocol-specific error payload deserialization + } else { + errorMessage = errorHeaderIter->second.GetEventHeaderValueAsString(); } - errorMessage = errorHeaderIter->second.GetEventHeaderValueAsString(); MarshallError(errorCode, errorMessage); } void SelectObjectContentHandler::MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage) { S3ErrorMarshaller errorMarshaller; AWSError error; - if (errorCode.empty()) { error = AWSError(CoreErrors::UNKNOWN, "", errorMessage, false); } else { - error = errorMarshaller.FindErrorByName(errorMessage.c_str()); + error = errorMarshaller.FindErrorByName(errorCode.c_str()); if (error.GetErrorType() != CoreErrors::UNKNOWN) { AWS_LOGSTREAM_WARN(SELECTOBJECTCONTENT_HANDLER_CLASS_TAG, "Encountered AWSError '" << errorCode.c_str() << "': " << errorMessage.c_str()); @@ -183,7 +166,6 @@ void SelectObjectContentHandler::MarshallError(const Aws::String& errorCode, con "Unable to parse ExceptionName: " + errorCode + " Message: " + errorMessage, false); } } - m_onError(AWSError(error)); } @@ -197,12 +179,9 @@ static const int END_HASH = Aws::Utils::HashingUtils::HashString("End"); SelectObjectContentEventType GetSelectObjectContentEventTypeForName(const Aws::String& name) { int hashCode = Aws::Utils::HashingUtils::HashString(name.c_str()); - if (hashCode == INITIAL_RESPONSE_HASH) { return SelectObjectContentEventType::INITIAL_RESPONSE; - } - - else if (hashCode == RECORDS_HASH) { + } else if (hashCode == RECORDS_HASH) { return SelectObjectContentEventType::RECORDS; } else if (hashCode == STATS_HASH) { return SelectObjectContentEventType::STATS; diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentInitialResponse.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentInitialResponse.cpp index eaa77d80e22..392b43eaf8a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentInitialResponse.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentInitialResponse.cpp @@ -3,7 +3,9 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include #include +#include #include #include #include @@ -19,19 +21,9 @@ namespace Model { SelectObjectContentInitialResponse::SelectObjectContentInitialResponse(const XmlNode& xmlNode) { *this = xmlNode; } -SelectObjectContentInitialResponse& SelectObjectContentInitialResponse::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +SelectObjectContentInitialResponse& SelectObjectContentInitialResponse::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - } - - return *this; -} - -void SelectObjectContentInitialResponse::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - AWS_UNREFERENCED_PARAM(parentNode); -} +void SelectObjectContentInitialResponse::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentRequest.cpp index 7cfccfb5f02..2073c30a158 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SelectObjectContentRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,79 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool SelectObjectContentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - -Aws::String SelectObjectContentRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("SelectObjectContentRequest"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - Aws::StringStream ss; - if (m_expressionHasBeenSet) { - XmlNode expressionNode = parentNode.CreateChildElement("Expression"); - expressionNode.SetText(m_expression); - } - - if (m_expressionTypeHasBeenSet) { - XmlNode expressionTypeNode = parentNode.CreateChildElement("ExpressionType"); - expressionTypeNode.SetText(ExpressionTypeMapper::GetNameForExpressionType(m_expressionType)); - } - - if (m_requestProgressHasBeenSet) { - XmlNode requestProgressNode = parentNode.CreateChildElement("RequestProgress"); - m_requestProgress.AddToNode(requestProgressNode); - } - - if (m_inputSerializationHasBeenSet) { - XmlNode inputSerializationNode = parentNode.CreateChildElement("InputSerialization"); - m_inputSerialization.AddToNode(inputSerializationNode); - } - - if (m_outputSerializationHasBeenSet) { - XmlNode outputSerializationNode = parentNode.CreateChildElement("OutputSerialization"); - m_outputSerialization.AddToNode(outputSerializationNode); - } - - if (m_scanRangeHasBeenSet) { - XmlNode scanRangeNode = parentNode.CreateChildElement("ScanRange"); - m_scanRange.AddToNode(scanRangeNode); - } - - return payloadDoc.ConvertToString(); -} - -void SelectObjectContentRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String SelectObjectContentRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection SelectObjectContentRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -98,28 +29,54 @@ Aws::Http::HeaderValueCollection SelectObjectContentRequest::GetRequestSpecificH headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void SelectObjectContentRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool SelectObjectContentRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + SelectObjectContentRequest::EndpointParameters SelectObjectContentRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Operation context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SelectParameters.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SelectParameters.cpp index 5c5294f23cf..94326fd0804 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SelectParameters.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SelectParameters.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,58 +20,9 @@ namespace Model { SelectParameters::SelectParameters(const XmlNode& xmlNode) { *this = xmlNode; } -SelectParameters& SelectParameters::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +SelectParameters& SelectParameters::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode inputSerializationNode = resultNode.FirstChild("InputSerialization"); - if (!inputSerializationNode.IsNull()) { - m_inputSerialization = inputSerializationNode; - m_inputSerializationHasBeenSet = true; - } - XmlNode expressionTypeNode = resultNode.FirstChild("ExpressionType"); - if (!expressionTypeNode.IsNull()) { - m_expressionType = ExpressionTypeMapper::GetExpressionTypeForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(expressionTypeNode.GetText()).c_str())); - m_expressionTypeHasBeenSet = true; - } - XmlNode expressionNode = resultNode.FirstChild("Expression"); - if (!expressionNode.IsNull()) { - m_expression = Aws::Utils::Xml::DecodeEscapedXmlText(expressionNode.GetText()); - m_expressionHasBeenSet = true; - } - XmlNode outputSerializationNode = resultNode.FirstChild("OutputSerialization"); - if (!outputSerializationNode.IsNull()) { - m_outputSerialization = outputSerializationNode; - m_outputSerializationHasBeenSet = true; - } - } - - return *this; -} - -void SelectParameters::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_inputSerializationHasBeenSet) { - XmlNode inputSerializationNode = parentNode.CreateChildElement("InputSerialization"); - m_inputSerialization.AddToNode(inputSerializationNode); - } - - if (m_expressionTypeHasBeenSet) { - XmlNode expressionTypeNode = parentNode.CreateChildElement("ExpressionType"); - expressionTypeNode.SetText(ExpressionTypeMapper::GetNameForExpressionType(m_expressionType)); - } - - if (m_expressionHasBeenSet) { - XmlNode expressionNode = parentNode.CreateChildElement("Expression"); - expressionNode.SetText(m_expression); - } - - if (m_outputSerializationHasBeenSet) { - XmlNode outputSerializationNode = parentNode.CreateChildElement("OutputSerialization"); - m_outputSerialization.AddToNode(outputSerializationNode); - } -} +void SelectParameters::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryption.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryption.cpp index 02f25cf46cd..c40a756b9bd 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryption.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryption.cpp @@ -39,7 +39,6 @@ ServerSideEncryption GetServerSideEncryptionForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ServerSideEncryption::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForServerSideEncryption(ServerSideEncryption enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionByDefault.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionByDefault.cpp index fe2c84f7fee..04203568efe 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionByDefault.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionByDefault.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { ServerSideEncryptionByDefault::ServerSideEncryptionByDefault(const XmlNode& xmlNode) { *this = xmlNode; } -ServerSideEncryptionByDefault& ServerSideEncryptionByDefault::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode sSEAlgorithmNode = resultNode.FirstChild("SSEAlgorithm"); - if (!sSEAlgorithmNode.IsNull()) { - m_sSEAlgorithm = ServerSideEncryptionMapper::GetServerSideEncryptionForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sSEAlgorithmNode.GetText()).c_str())); - m_sSEAlgorithmHasBeenSet = true; - } - XmlNode kMSMasterKeyIDNode = resultNode.FirstChild("KMSMasterKeyID"); - if (!kMSMasterKeyIDNode.IsNull()) { - m_kMSMasterKeyID = Aws::Utils::Xml::DecodeEscapedXmlText(kMSMasterKeyIDNode.GetText()); - m_kMSMasterKeyIDHasBeenSet = true; - } - } - - return *this; -} - -void ServerSideEncryptionByDefault::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_sSEAlgorithmHasBeenSet) { - XmlNode sSEAlgorithmNode = parentNode.CreateChildElement("SSEAlgorithm"); - sSEAlgorithmNode.SetText(ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_sSEAlgorithm)); - } - - if (m_kMSMasterKeyIDHasBeenSet) { - XmlNode kMSMasterKeyIDNode = parentNode.CreateChildElement("KMSMasterKeyID"); - kMSMasterKeyIDNode.SetText(m_kMSMasterKeyID); - } -} +ServerSideEncryptionByDefault& ServerSideEncryptionByDefault::operator=(const XmlNode& xmlNode) { return *this; } + +void ServerSideEncryptionByDefault::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionConfiguration.cpp index 459d745c74d..2e3076f55a9 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,35 +20,9 @@ namespace Model { ServerSideEncryptionConfiguration::ServerSideEncryptionConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -ServerSideEncryptionConfiguration& ServerSideEncryptionConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode rulesNode = resultNode.FirstChild("Rule"); - if (!rulesNode.IsNull()) { - XmlNode ruleMember = rulesNode; - m_rulesHasBeenSet = !ruleMember.IsNull(); - while (!ruleMember.IsNull()) { - m_rules.push_back(ruleMember); - ruleMember = ruleMember.NextNode("Rule"); - } - - m_rulesHasBeenSet = true; - } - } - - return *this; -} - -void ServerSideEncryptionConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_rulesHasBeenSet) { - for (const auto& item : m_rules) { - XmlNode rulesNode = parentNode.CreateChildElement("Rule"); - item.AddToNode(rulesNode); - } - } -} +ServerSideEncryptionConfiguration& ServerSideEncryptionConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void ServerSideEncryptionConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionRule.cpp b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionRule.cpp index a638b9148f0..175309e992a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionRule.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/ServerSideEncryptionRule.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,50 +20,9 @@ namespace Model { ServerSideEncryptionRule::ServerSideEncryptionRule(const XmlNode& xmlNode) { *this = xmlNode; } -ServerSideEncryptionRule& ServerSideEncryptionRule::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +ServerSideEncryptionRule& ServerSideEncryptionRule::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode applyServerSideEncryptionByDefaultNode = resultNode.FirstChild("ApplyServerSideEncryptionByDefault"); - if (!applyServerSideEncryptionByDefaultNode.IsNull()) { - m_applyServerSideEncryptionByDefault = applyServerSideEncryptionByDefaultNode; - m_applyServerSideEncryptionByDefaultHasBeenSet = true; - } - XmlNode bucketKeyEnabledNode = resultNode.FirstChild("BucketKeyEnabled"); - if (!bucketKeyEnabledNode.IsNull()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bucketKeyEnabledNode.GetText()).c_str()).c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - XmlNode blockedEncryptionTypesNode = resultNode.FirstChild("BlockedEncryptionTypes"); - if (!blockedEncryptionTypesNode.IsNull()) { - m_blockedEncryptionTypes = blockedEncryptionTypesNode; - m_blockedEncryptionTypesHasBeenSet = true; - } - } - - return *this; -} - -void ServerSideEncryptionRule::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_applyServerSideEncryptionByDefaultHasBeenSet) { - XmlNode applyServerSideEncryptionByDefaultNode = parentNode.CreateChildElement("ApplyServerSideEncryptionByDefault"); - m_applyServerSideEncryptionByDefault.AddToNode(applyServerSideEncryptionByDefaultNode); - } - - if (m_bucketKeyEnabledHasBeenSet) { - XmlNode bucketKeyEnabledNode = parentNode.CreateChildElement("BucketKeyEnabled"); - ss << std::boolalpha << m_bucketKeyEnabled; - bucketKeyEnabledNode.SetText(ss.str()); - ss.str(""); - } - - if (m_blockedEncryptionTypesHasBeenSet) { - XmlNode blockedEncryptionTypesNode = parentNode.CreateChildElement("BlockedEncryptionTypes"); - m_blockedEncryptionTypes.AddToNode(blockedEncryptionTypesNode); - } -} +void ServerSideEncryptionRule::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SessionCredentials.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SessionCredentials.cpp index 302bd2a79ec..d648ace8d03 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SessionCredentials.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SessionCredentials.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,58 +20,9 @@ namespace Model { SessionCredentials::SessionCredentials(const XmlNode& xmlNode) { *this = xmlNode; } -SessionCredentials& SessionCredentials::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +SessionCredentials& SessionCredentials::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode accessKeyIdNode = resultNode.FirstChild("AccessKeyId"); - if (!accessKeyIdNode.IsNull()) { - m_accessKeyId = Aws::Utils::Xml::DecodeEscapedXmlText(accessKeyIdNode.GetText()); - m_accessKeyIdHasBeenSet = true; - } - XmlNode secretAccessKeyNode = resultNode.FirstChild("SecretAccessKey"); - if (!secretAccessKeyNode.IsNull()) { - m_secretAccessKey = Aws::Utils::Xml::DecodeEscapedXmlText(secretAccessKeyNode.GetText()); - m_secretAccessKeyHasBeenSet = true; - } - XmlNode sessionTokenNode = resultNode.FirstChild("SessionToken"); - if (!sessionTokenNode.IsNull()) { - m_sessionToken = Aws::Utils::Xml::DecodeEscapedXmlText(sessionTokenNode.GetText()); - m_sessionTokenHasBeenSet = true; - } - XmlNode expirationNode = resultNode.FirstChild("Expiration"); - if (!expirationNode.IsNull()) { - m_expiration = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(expirationNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_expirationHasBeenSet = true; - } - } - - return *this; -} - -void SessionCredentials::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_accessKeyIdHasBeenSet) { - XmlNode accessKeyIdNode = parentNode.CreateChildElement("AccessKeyId"); - accessKeyIdNode.SetText(m_accessKeyId); - } - - if (m_secretAccessKeyHasBeenSet) { - XmlNode secretAccessKeyNode = parentNode.CreateChildElement("SecretAccessKey"); - secretAccessKeyNode.SetText(m_secretAccessKey); - } - - if (m_sessionTokenHasBeenSet) { - XmlNode sessionTokenNode = parentNode.CreateChildElement("SessionToken"); - sessionTokenNode.SetText(m_sessionToken); - } - - if (m_expirationHasBeenSet) { - XmlNode expirationNode = parentNode.CreateChildElement("Expiration"); - expirationNode.SetText(m_expiration.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } -} +void SessionCredentials::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SessionMode.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SessionMode.cpp index fd3ab2c80b1..fc47ed5f93d 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SessionMode.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SessionMode.cpp @@ -30,7 +30,6 @@ SessionMode GetSessionModeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return SessionMode::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForSessionMode(SessionMode enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SimplePrefix.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SimplePrefix.cpp index a501942e9a4..69b66530df4 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SimplePrefix.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SimplePrefix.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,19 +20,9 @@ namespace Model { SimplePrefix::SimplePrefix(const XmlNode& xmlNode) { *this = xmlNode; } -SimplePrefix& SimplePrefix::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +SimplePrefix& SimplePrefix::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - } - - return *this; -} - -void SimplePrefix::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - AWS_UNREFERENCED_PARAM(parentNode); -} +void SimplePrefix::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SourceSelectionCriteria.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SourceSelectionCriteria.cpp index eef2f439117..da19566fc89 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SourceSelectionCriteria.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SourceSelectionCriteria.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { SourceSelectionCriteria::SourceSelectionCriteria(const XmlNode& xmlNode) { *this = xmlNode; } -SourceSelectionCriteria& SourceSelectionCriteria::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode sseKmsEncryptedObjectsNode = resultNode.FirstChild("SseKmsEncryptedObjects"); - if (!sseKmsEncryptedObjectsNode.IsNull()) { - m_sseKmsEncryptedObjects = sseKmsEncryptedObjectsNode; - m_sseKmsEncryptedObjectsHasBeenSet = true; - } - XmlNode replicaModificationsNode = resultNode.FirstChild("ReplicaModifications"); - if (!replicaModificationsNode.IsNull()) { - m_replicaModifications = replicaModificationsNode; - m_replicaModificationsHasBeenSet = true; - } - } - - return *this; -} - -void SourceSelectionCriteria::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_sseKmsEncryptedObjectsHasBeenSet) { - XmlNode sseKmsEncryptedObjectsNode = parentNode.CreateChildElement("SseKmsEncryptedObjects"); - m_sseKmsEncryptedObjects.AddToNode(sseKmsEncryptedObjectsNode); - } - - if (m_replicaModificationsHasBeenSet) { - XmlNode replicaModificationsNode = parentNode.CreateChildElement("ReplicaModifications"); - m_replicaModifications.AddToNode(replicaModificationsNode); - } -} +SourceSelectionCriteria& SourceSelectionCriteria::operator=(const XmlNode& xmlNode) { return *this; } + +void SourceSelectionCriteria::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjects.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjects.cpp index 76128520b5d..b583a9a68b1 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjects.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjects.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,28 +20,9 @@ namespace Model { SseKmsEncryptedObjects::SseKmsEncryptedObjects(const XmlNode& xmlNode) { *this = xmlNode; } -SseKmsEncryptedObjects& SseKmsEncryptedObjects::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = SseKmsEncryptedObjectsStatusMapper::GetSseKmsEncryptedObjectsStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void SseKmsEncryptedObjects::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(SseKmsEncryptedObjectsStatusMapper::GetNameForSseKmsEncryptedObjectsStatus(m_status)); - } -} +SseKmsEncryptedObjects& SseKmsEncryptedObjects::operator=(const XmlNode& xmlNode) { return *this; } + +void SseKmsEncryptedObjects::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjectsStatus.cpp b/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjectsStatus.cpp index 4b02d71f2eb..32d43f3dc3a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjectsStatus.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/SseKmsEncryptedObjectsStatus.cpp @@ -30,7 +30,6 @@ SseKmsEncryptedObjectsStatus GetSseKmsEncryptedObjectsStatusForName(const Aws::S overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return SseKmsEncryptedObjectsStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForSseKmsEncryptedObjectsStatus(SseKmsEncryptedObjectsStatus if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Stats.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Stats.cpp index 3eff1c84611..a66d84b5adf 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Stats.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Stats.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,56 +20,9 @@ namespace Model { Stats::Stats(const XmlNode& xmlNode) { *this = xmlNode; } -Stats& Stats::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Stats& Stats::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode bytesScannedNode = resultNode.FirstChild("BytesScanned"); - if (!bytesScannedNode.IsNull()) { - m_bytesScanned = - StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesScannedNode.GetText()).c_str()).c_str()); - m_bytesScannedHasBeenSet = true; - } - XmlNode bytesProcessedNode = resultNode.FirstChild("BytesProcessed"); - if (!bytesProcessedNode.IsNull()) { - m_bytesProcessed = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesProcessedNode.GetText()).c_str()).c_str()); - m_bytesProcessedHasBeenSet = true; - } - XmlNode bytesReturnedNode = resultNode.FirstChild("BytesReturned"); - if (!bytesReturnedNode.IsNull()) { - m_bytesReturned = StringUtils::ConvertToInt64( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(bytesReturnedNode.GetText()).c_str()).c_str()); - m_bytesReturnedHasBeenSet = true; - } - } - - return *this; -} - -void Stats::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_bytesScannedHasBeenSet) { - XmlNode bytesScannedNode = parentNode.CreateChildElement("BytesScanned"); - ss << m_bytesScanned; - bytesScannedNode.SetText(ss.str()); - ss.str(""); - } - - if (m_bytesProcessedHasBeenSet) { - XmlNode bytesProcessedNode = parentNode.CreateChildElement("BytesProcessed"); - ss << m_bytesProcessed; - bytesProcessedNode.SetText(ss.str()); - ss.str(""); - } - - if (m_bytesReturnedHasBeenSet) { - XmlNode bytesReturnedNode = parentNode.CreateChildElement("BytesReturned"); - ss << m_bytesReturned; - bytesReturnedNode.SetText(ss.str()); - ss.str(""); - } -} +void Stats::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/StatsEvent.cpp b/generated/src/aws-cpp-sdk-s3/source/model/StatsEvent.cpp index 7641caf0bed..138f4ae682a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/StatsEvent.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/StatsEvent.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { StatsEvent::StatsEvent(const XmlNode& xmlNode) { *this = xmlNode; } -StatsEvent& StatsEvent::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode detailsNode = resultNode; - if (!detailsNode.IsNull()) { - m_details = detailsNode; - m_detailsHasBeenSet = true; - } - } - - return *this; -} - -void StatsEvent::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_detailsHasBeenSet) { - XmlNode detailsNode = parentNode.CreateChildElement("Details"); - m_details.AddToNode(detailsNode); - } -} +StatsEvent& StatsEvent::operator=(const XmlNode& xmlNode) { return *this; } + +void StatsEvent::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/StorageClass.cpp b/generated/src/aws-cpp-sdk-s3/source/model/StorageClass.cpp index afd1bfbda90..0a5a6d9a476 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/StorageClass.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/StorageClass.cpp @@ -69,7 +69,6 @@ StorageClass GetStorageClassForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return StorageClass::NOT_SET; } @@ -112,7 +111,6 @@ Aws::String GetNameForStorageClass(StorageClass enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysis.cpp b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysis.cpp index a3d4c2fe04f..31bc8acf48e 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysis.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysis.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,27 +20,9 @@ namespace Model { StorageClassAnalysis::StorageClassAnalysis(const XmlNode& xmlNode) { *this = xmlNode; } -StorageClassAnalysis& StorageClassAnalysis::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode dataExportNode = resultNode.FirstChild("DataExport"); - if (!dataExportNode.IsNull()) { - m_dataExport = dataExportNode; - m_dataExportHasBeenSet = true; - } - } - - return *this; -} - -void StorageClassAnalysis::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_dataExportHasBeenSet) { - XmlNode dataExportNode = parentNode.CreateChildElement("DataExport"); - m_dataExport.AddToNode(dataExportNode); - } -} +StorageClassAnalysis& StorageClassAnalysis::operator=(const XmlNode& xmlNode) { return *this; } + +void StorageClassAnalysis::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisDataExport.cpp b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisDataExport.cpp index 8cd688fe808..e324d4886ed 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisDataExport.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisDataExport.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,39 +20,9 @@ namespace Model { StorageClassAnalysisDataExport::StorageClassAnalysisDataExport(const XmlNode& xmlNode) { *this = xmlNode; } -StorageClassAnalysisDataExport& StorageClassAnalysisDataExport::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode outputSchemaVersionNode = resultNode.FirstChild("OutputSchemaVersion"); - if (!outputSchemaVersionNode.IsNull()) { - m_outputSchemaVersion = StorageClassAnalysisSchemaVersionMapper::GetStorageClassAnalysisSchemaVersionForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(outputSchemaVersionNode.GetText()).c_str())); - m_outputSchemaVersionHasBeenSet = true; - } - XmlNode destinationNode = resultNode.FirstChild("Destination"); - if (!destinationNode.IsNull()) { - m_destination = destinationNode; - m_destinationHasBeenSet = true; - } - } - - return *this; -} - -void StorageClassAnalysisDataExport::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_outputSchemaVersionHasBeenSet) { - XmlNode outputSchemaVersionNode = parentNode.CreateChildElement("OutputSchemaVersion"); - outputSchemaVersionNode.SetText( - StorageClassAnalysisSchemaVersionMapper::GetNameForStorageClassAnalysisSchemaVersion(m_outputSchemaVersion)); - } - - if (m_destinationHasBeenSet) { - XmlNode destinationNode = parentNode.CreateChildElement("Destination"); - m_destination.AddToNode(destinationNode); - } -} +StorageClassAnalysisDataExport& StorageClassAnalysisDataExport::operator=(const XmlNode& xmlNode) { return *this; } + +void StorageClassAnalysisDataExport::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisSchemaVersion.cpp b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisSchemaVersion.cpp index 1c9eab4328c..1fd319c417a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisSchemaVersion.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/StorageClassAnalysisSchemaVersion.cpp @@ -27,7 +27,6 @@ StorageClassAnalysisSchemaVersion GetStorageClassAnalysisSchemaVersionForName(co overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return StorageClassAnalysisSchemaVersion::NOT_SET; } @@ -42,7 +41,6 @@ Aws::String GetNameForStorageClassAnalysisSchemaVersion(StorageClassAnalysisSche if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TableSseAlgorithm.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TableSseAlgorithm.cpp index aaf373f9d21..0beb8b2f3f0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TableSseAlgorithm.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TableSseAlgorithm.cpp @@ -30,7 +30,6 @@ TableSseAlgorithm GetTableSseAlgorithmForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return TableSseAlgorithm::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForTableSseAlgorithm(TableSseAlgorithm enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Tag.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Tag.cpp index f6515132a1b..8257db9ba87 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Tag.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Tag.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { Tag::Tag(const XmlNode& xmlNode) { *this = xmlNode; } -Tag& Tag::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - m_keyHasBeenSet = true; - } - XmlNode valueNode = resultNode.FirstChild("Value"); - if (!valueNode.IsNull()) { - m_value = Aws::Utils::Xml::DecodeEscapedXmlText(valueNode.GetText()); - m_valueHasBeenSet = true; - } - } - - return *this; -} - -void Tag::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_keyHasBeenSet) { - XmlNode keyNode = parentNode.CreateChildElement("Key"); - keyNode.SetText(m_key); - } - - if (m_valueHasBeenSet) { - XmlNode valueNode = parentNode.CreateChildElement("Value"); - valueNode.SetText(m_value); - } -} +Tag& Tag::operator=(const XmlNode& xmlNode) { return *this; } + +void Tag::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Tagging.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Tagging.cpp index b5377c323d1..2c5a913573c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Tagging.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Tagging.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,36 +20,9 @@ namespace Model { Tagging::Tagging(const XmlNode& xmlNode) { *this = xmlNode; } -Tagging& Tagging::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode tagSetNode = resultNode.FirstChild("TagSet"); - if (!tagSetNode.IsNull()) { - XmlNode tagSetMember = tagSetNode.FirstChild("Tag"); - m_tagSetHasBeenSet = !tagSetMember.IsNull(); - while (!tagSetMember.IsNull()) { - m_tagSet.push_back(tagSetMember); - tagSetMember = tagSetMember.NextNode("Tag"); - } - - m_tagSetHasBeenSet = true; - } - } - - return *this; -} - -void Tagging::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_tagSetHasBeenSet) { - XmlNode tagSetParentNode = parentNode.CreateChildElement("TagSet"); - for (const auto& item : m_tagSet) { - XmlNode tagSetNode = tagSetParentNode.CreateChildElement("Tag"); - item.AddToNode(tagSetNode); - } - } -} +Tagging& Tagging::operator=(const XmlNode& xmlNode) { return *this; } + +void Tagging::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TaggingDirective.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TaggingDirective.cpp index 8eb455564a6..574902a73ca 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TaggingDirective.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TaggingDirective.cpp @@ -30,7 +30,6 @@ TaggingDirective GetTaggingDirectiveForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return TaggingDirective::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForTaggingDirective(TaggingDirective enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TargetGrant.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TargetGrant.cpp index 0b6845dff80..287bc78a174 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TargetGrant.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TargetGrant.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,38 +20,9 @@ namespace Model { TargetGrant::TargetGrant(const XmlNode& xmlNode) { *this = xmlNode; } -TargetGrant& TargetGrant::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode granteeNode = resultNode.FirstChild("Grantee"); - if (!granteeNode.IsNull()) { - m_grantee = granteeNode; - m_granteeHasBeenSet = true; - } - XmlNode permissionNode = resultNode.FirstChild("Permission"); - if (!permissionNode.IsNull()) { - m_permission = BucketLogsPermissionMapper::GetBucketLogsPermissionForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(permissionNode.GetText()).c_str())); - m_permissionHasBeenSet = true; - } - } - - return *this; -} - -void TargetGrant::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_granteeHasBeenSet) { - XmlNode granteeNode = parentNode.CreateChildElement("Grantee"); - m_grantee.AddToNode(granteeNode); - } - - if (m_permissionHasBeenSet) { - XmlNode permissionNode = parentNode.CreateChildElement("Permission"); - permissionNode.SetText(BucketLogsPermissionMapper::GetNameForBucketLogsPermission(m_permission)); - } -} +TargetGrant& TargetGrant::operator=(const XmlNode& xmlNode) { return *this; } + +void TargetGrant::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TargetObjectKeyFormat.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TargetObjectKeyFormat.cpp index d146f05b408..dadbf51351b 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TargetObjectKeyFormat.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TargetObjectKeyFormat.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,37 +20,9 @@ namespace Model { TargetObjectKeyFormat::TargetObjectKeyFormat(const XmlNode& xmlNode) { *this = xmlNode; } -TargetObjectKeyFormat& TargetObjectKeyFormat::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode simplePrefixNode = resultNode.FirstChild("SimplePrefix"); - if (!simplePrefixNode.IsNull()) { - m_simplePrefix = simplePrefixNode; - m_simplePrefixHasBeenSet = true; - } - XmlNode partitionedPrefixNode = resultNode.FirstChild("PartitionedPrefix"); - if (!partitionedPrefixNode.IsNull()) { - m_partitionedPrefix = partitionedPrefixNode; - m_partitionedPrefixHasBeenSet = true; - } - } - - return *this; -} - -void TargetObjectKeyFormat::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_simplePrefixHasBeenSet) { - XmlNode simplePrefixNode = parentNode.CreateChildElement("SimplePrefix"); - m_simplePrefix.AddToNode(simplePrefixNode); - } - - if (m_partitionedPrefixHasBeenSet) { - XmlNode partitionedPrefixNode = parentNode.CreateChildElement("PartitionedPrefix"); - m_partitionedPrefix.AddToNode(partitionedPrefixNode); - } -} +TargetObjectKeyFormat& TargetObjectKeyFormat::operator=(const XmlNode& xmlNode) { return *this; } + +void TargetObjectKeyFormat::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Tier.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Tier.cpp index aa75b81e93d..4d85d0dc545 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Tier.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Tier.cpp @@ -33,7 +33,6 @@ Tier GetTierForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Tier::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForTier(Tier enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Tiering.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Tiering.cpp index f60b0506a9e..c591b903d54 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Tiering.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Tiering.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,40 +20,9 @@ namespace Model { Tiering::Tiering(const XmlNode& xmlNode) { *this = xmlNode; } -Tiering& Tiering::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - XmlNode accessTierNode = resultNode.FirstChild("AccessTier"); - if (!accessTierNode.IsNull()) { - m_accessTier = IntelligentTieringAccessTierMapper::GetIntelligentTieringAccessTierForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(accessTierNode.GetText()).c_str())); - m_accessTierHasBeenSet = true; - } - } - - return *this; -} - -void Tiering::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_accessTierHasBeenSet) { - XmlNode accessTierNode = parentNode.CreateChildElement("AccessTier"); - accessTierNode.SetText(IntelligentTieringAccessTierMapper::GetNameForIntelligentTieringAccessTier(m_accessTier)); - } -} +Tiering& Tiering::operator=(const XmlNode& xmlNode) { return *this; } + +void Tiering::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TopicConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TopicConfiguration.cpp index d58703baa9f..3ac6c5635b0 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TopicConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TopicConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,65 +20,9 @@ namespace Model { TopicConfiguration::TopicConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -TopicConfiguration& TopicConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +TopicConfiguration& TopicConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode topicArnNode = resultNode.FirstChild("Topic"); - if (!topicArnNode.IsNull()) { - m_topicArn = Aws::Utils::Xml::DecodeEscapedXmlText(topicArnNode.GetText()); - m_topicArnHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode filterNode = resultNode.FirstChild("Filter"); - if (!filterNode.IsNull()) { - m_filter = filterNode; - m_filterHasBeenSet = true; - } - } - - return *this; -} - -void TopicConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_topicArnHasBeenSet) { - XmlNode topicArnNode = parentNode.CreateChildElement("Topic"); - topicArnNode.SetText(m_topicArn); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_filterHasBeenSet) { - XmlNode filterNode = parentNode.CreateChildElement("Filter"); - m_filter.AddToNode(filterNode); - } -} +void TopicConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TopicConfigurationDeprecated.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TopicConfigurationDeprecated.cpp deleted file mode 100644 index 7926be89119..00000000000 --- a/generated/src/aws-cpp-sdk-s3/source/model/TopicConfigurationDeprecated.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include -#include -#include -#include - -#include - -using namespace Aws::Utils::Xml; -using namespace Aws::Utils; - -namespace Aws { -namespace S3 { -namespace Model { - -TopicConfigurationDeprecated::TopicConfigurationDeprecated(const XmlNode& xmlNode) { *this = xmlNode; } - -TopicConfigurationDeprecated& TopicConfigurationDeprecated::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode idNode = resultNode.FirstChild("Id"); - if (!idNode.IsNull()) { - m_id = Aws::Utils::Xml::DecodeEscapedXmlText(idNode.GetText()); - m_idHasBeenSet = true; - } - XmlNode eventsNode = resultNode.FirstChild("Event"); - if (!eventsNode.IsNull()) { - XmlNode eventMember = eventsNode; - m_eventsHasBeenSet = !eventMember.IsNull(); - while (!eventMember.IsNull()) { - m_events.push_back(EventMapper::GetEventForName(StringUtils::Trim(eventMember.GetText().c_str()))); - eventMember = eventMember.NextNode("Event"); - } - - m_eventsHasBeenSet = true; - } - XmlNode topicNode = resultNode.FirstChild("Topic"); - if (!topicNode.IsNull()) { - m_topic = Aws::Utils::Xml::DecodeEscapedXmlText(topicNode.GetText()); - m_topicHasBeenSet = true; - } - } - - return *this; -} - -void TopicConfigurationDeprecated::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_idHasBeenSet) { - XmlNode idNode = parentNode.CreateChildElement("Id"); - idNode.SetText(m_id); - } - - if (m_eventsHasBeenSet) { - for (const auto& item : m_events) { - XmlNode eventsNode = parentNode.CreateChildElement("Event"); - eventsNode.SetText(EventMapper::GetNameForEvent(item)); - } - } - - if (m_topicHasBeenSet) { - XmlNode topicNode = parentNode.CreateChildElement("Topic"); - topicNode.SetText(m_topic); - } -} - -} // namespace Model -} // namespace S3 -} // namespace Aws diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Transition.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Transition.cpp index b73c065b632..87d4ac9bbc2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Transition.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Transition.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,51 +20,9 @@ namespace Model { Transition::Transition(const XmlNode& xmlNode) { *this = xmlNode; } -Transition& Transition::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +Transition& Transition::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode dateNode = resultNode.FirstChild("Date"); - if (!dateNode.IsNull()) { - m_date = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(dateNode.GetText()).c_str()).c_str(), - Aws::Utils::DateFormat::ISO_8601); - m_dateHasBeenSet = true; - } - XmlNode daysNode = resultNode.FirstChild("Days"); - if (!daysNode.IsNull()) { - m_days = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(daysNode.GetText()).c_str()).c_str()); - m_daysHasBeenSet = true; - } - XmlNode storageClassNode = resultNode.FirstChild("StorageClass"); - if (!storageClassNode.IsNull()) { - m_storageClass = TransitionStorageClassMapper::GetTransitionStorageClassForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageClassNode.GetText()).c_str())); - m_storageClassHasBeenSet = true; - } - } - - return *this; -} - -void Transition::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_dateHasBeenSet) { - XmlNode dateNode = parentNode.CreateChildElement("Date"); - dateNode.SetText(m_date.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); - } - - if (m_daysHasBeenSet) { - XmlNode daysNode = parentNode.CreateChildElement("Days"); - ss << m_days; - daysNode.SetText(ss.str()); - ss.str(""); - } - - if (m_storageClassHasBeenSet) { - XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass"); - storageClassNode.SetText(TransitionStorageClassMapper::GetNameForTransitionStorageClass(m_storageClass)); - } -} +void Transition::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TransitionDefaultMinimumObjectSize.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TransitionDefaultMinimumObjectSize.cpp index 5d489728d5a..b4f6ca06259 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TransitionDefaultMinimumObjectSize.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TransitionDefaultMinimumObjectSize.cpp @@ -30,7 +30,6 @@ TransitionDefaultMinimumObjectSize GetTransitionDefaultMinimumObjectSizeForName( overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return TransitionDefaultMinimumObjectSize::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForTransitionDefaultMinimumObjectSize(TransitionDefaultMinimu if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/TransitionStorageClass.cpp b/generated/src/aws-cpp-sdk-s3/source/model/TransitionStorageClass.cpp index 69bbe4c29c4..79240cf8123 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/TransitionStorageClass.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/TransitionStorageClass.cpp @@ -42,7 +42,6 @@ TransitionStorageClass GetTransitionStorageClassForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return TransitionStorageClass::NOT_SET; } @@ -67,7 +66,6 @@ Aws::String GetNameForTransitionStorageClass(TransitionStorageClass enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/Type.cpp b/generated/src/aws-cpp-sdk-s3/source/model/Type.cpp index b0084e3c353..753cb995734 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/Type.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/Type.cpp @@ -33,7 +33,6 @@ Type GetTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return Type::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForType(Type enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.cpp index 9115b82f8ec..5ea63ce260c 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataAnnotationTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,21 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String UpdateBucketMetadataAnnotationTableConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("AnnotationTableConfiguration"); +Aws::String UpdateBucketMetadataAnnotationTableConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_annotationTableConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection UpdateBucketMetadataAnnotationTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - return {}; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void UpdateBucketMetadataAnnotationTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void UpdateBucketMetadataAnnotationTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -40,33 +50,21 @@ void UpdateBucketMetadataAnnotationTableConfigurationRequest::AddQueryStringPara collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection UpdateBucketMetadataAnnotationTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +Aws::String UpdateBucketMetadataAnnotationTableConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } +} - return headers; +bool UpdateBucketMetadataAnnotationTableConfigurationRequest::ChecksumAlgorithmIsSet() const { + return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } UpdateBucketMetadataAnnotationTableConfigurationRequest::EndpointParameters @@ -81,15 +79,3 @@ UpdateBucketMetadataAnnotationTableConfigurationRequest::GetEndpointContextParam } return parameters; } - -Aws::String UpdateBucketMetadataAnnotationTableConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool UpdateBucketMetadataAnnotationTableConfigurationRequest::ChecksumAlgorithmIsSet() const { - return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; -} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataInventoryTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataInventoryTableConfigurationRequest.cpp index 481bbd821d3..5f9524b52c8 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataInventoryTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataInventoryTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,21 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String UpdateBucketMetadataInventoryTableConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("InventoryTableConfiguration"); +Aws::String UpdateBucketMetadataInventoryTableConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_inventoryTableConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection UpdateBucketMetadataInventoryTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - return {}; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void UpdateBucketMetadataInventoryTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void UpdateBucketMetadataInventoryTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -40,33 +50,21 @@ void UpdateBucketMetadataInventoryTableConfigurationRequest::AddQueryStringParam collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection UpdateBucketMetadataInventoryTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +Aws::String UpdateBucketMetadataInventoryTableConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } +} - return headers; +bool UpdateBucketMetadataInventoryTableConfigurationRequest::ChecksumAlgorithmIsSet() const { + return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } UpdateBucketMetadataInventoryTableConfigurationRequest::EndpointParameters @@ -81,15 +79,3 @@ UpdateBucketMetadataInventoryTableConfigurationRequest::GetEndpointContextParams } return parameters; } - -Aws::String UpdateBucketMetadataInventoryTableConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool UpdateBucketMetadataInventoryTableConfigurationRequest::ChecksumAlgorithmIsSet() const { - return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; -} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataJournalTableConfigurationRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataJournalTableConfigurationRequest.cpp index 85414abb71f..86ac7502d7a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataJournalTableConfigurationRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UpdateBucketMetadataJournalTableConfigurationRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,21 +19,28 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String UpdateBucketMetadataJournalTableConfigurationRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("JournalTableConfiguration"); +Aws::String UpdateBucketMetadataJournalTableConfigurationRequest::SerializePayload() const { return {}; } - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_journalTableConfiguration.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); +Aws::Http::HeaderValueCollection UpdateBucketMetadataJournalTableConfigurationRequest::GetRequestSpecificHeaders() const { + Aws::Http::HeaderValueCollection headers; + Aws::StringStream ss; + if (m_contentMD5HasBeenSet) { + ss << m_contentMD5; + headers.emplace("content-md5", ss.str()); + ss.str(""); } - - return {}; + if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { + headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); + } + if (m_expectedBucketOwnerHasBeenSet) { + ss << m_expectedBucketOwner; + headers.emplace("x-amz-expected-bucket-owner", ss.str()); + ss.str(""); + } + return headers; } -void UpdateBucketMetadataJournalTableConfigurationRequest::AddQueryStringParameters(URI& uri) const { +void UpdateBucketMetadataJournalTableConfigurationRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { Aws::StringStream ss; if (!m_customizedAccessLogTag.empty()) { // only accept customized LogTag which starts with "x-" @@ -40,33 +50,21 @@ void UpdateBucketMetadataJournalTableConfigurationRequest::AddQueryStringParamet collectedLogTags.emplace(entry.first, entry.second); } } - if (!collectedLogTags.empty()) { uri.AddQueryStringParameter(collectedLogTags); } } } - -Aws::Http::HeaderValueCollection UpdateBucketMetadataJournalTableConfigurationRequest::GetRequestSpecificHeaders() const { - Aws::Http::HeaderValueCollection headers; - Aws::StringStream ss; - if (m_contentMD5HasBeenSet) { - ss << m_contentMD5; - headers.emplace("content-md5", ss.str()); - ss.str(""); - } - - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { - headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); - } - - if (m_expectedBucketOwnerHasBeenSet) { - ss << m_expectedBucketOwner; - headers.emplace("x-amz-expected-bucket-owner", ss.str()); - ss.str(""); +Aws::String UpdateBucketMetadataJournalTableConfigurationRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); } +} - return headers; +bool UpdateBucketMetadataJournalTableConfigurationRequest::ChecksumAlgorithmIsSet() const { + return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } UpdateBucketMetadataJournalTableConfigurationRequest::EndpointParameters @@ -81,15 +79,3 @@ UpdateBucketMetadataJournalTableConfigurationRequest::GetEndpointContextParams() } return parameters; } - -Aws::String UpdateBucketMetadataJournalTableConfigurationRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool UpdateBucketMetadataJournalTableConfigurationRequest::ChecksumAlgorithmIsSet() const { - return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; -} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionRequest.cpp index 33b8d901745..59d55ee50ae 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,42 +19,7 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -Aws::String UpdateObjectEncryptionRequest::SerializePayload() const { - XmlDocument payloadDoc = XmlDocument::CreateWithRootNode("ObjectEncryption"); - - XmlNode parentNode = payloadDoc.GetRootElement(); - parentNode.SetAttributeValue("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"); - - m_objectEncryption.AddToNode(parentNode); - if (parentNode.HasChildren()) { - return payloadDoc.ConvertToString(); - } - - return {}; -} - -void UpdateObjectEncryptionRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_versionIdHasBeenSet) { - ss << m_versionId; - uri.AddQueryStringParameter("versionId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} +Aws::String UpdateObjectEncryptionRequest::SerializePayload() const { return {}; } Aws::Http::HeaderValueCollection UpdateObjectEncryptionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; @@ -59,35 +27,42 @@ Aws::Http::HeaderValueCollection UpdateObjectEncryptionRequest::GetRequestSpecif if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - return headers; } -UpdateObjectEncryptionRequest::EndpointParameters UpdateObjectEncryptionRequest::GetEndpointContextParams() const { - EndpointParameters parameters; - // Operation context parameters - if (BucketHasBeenSet()) { - parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); +void UpdateObjectEncryptionRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_versionIdHasBeenSet) { + ss << m_versionId; + uri.AddQueryStringParameter("versionId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } } - return parameters; } - Aws::String UpdateObjectEncryptionRequest::GetChecksumAlgorithmName() const { if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { return "crc64nvme"; @@ -97,3 +72,12 @@ Aws::String UpdateObjectEncryptionRequest::GetChecksumAlgorithmName() const { } bool UpdateObjectEncryptionRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } + +UpdateObjectEncryptionRequest::EndpointParameters UpdateObjectEncryptionRequest::GetEndpointContextParams() const { + EndpointParameters parameters; + // Operation context parameters + if (BucketHasBeenSet()) { + parameters.emplace_back(Aws::String("Bucket"), this->GetBucket(), Aws::Endpoint::EndpointParameter::ParameterOrigin::OPERATION_CONTEXT); + } + return parameters; +} diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionResult.cpp index 7283a5429a7..800ac0703f7 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UpdateObjectEncryptionResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -19,25 +21,5 @@ using namespace Aws; UpdateObjectEncryptionResult::UpdateObjectEncryptionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } UpdateObjectEncryptionResult& UpdateObjectEncryptionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyRequest.cpp index 7149c04d68b..cfc066a8950 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyRequest.cpp @@ -4,11 +4,14 @@ */ #include +#include +#include #include #include #include #include +#include #include using namespace Aws::S3::Model; @@ -16,54 +19,8 @@ using namespace Aws::Utils::Xml; using namespace Aws::Utils; using namespace Aws::Http; -bool UploadPartCopyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused - AWS_UNREFERENCED_PARAM(header); - - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); - body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { - return false; - } - - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { - return true; - } - return false; -} - Aws::String UploadPartCopyRequest::SerializePayload() const { return {}; } -void UploadPartCopyRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_partNumberHasBeenSet) { - ss << m_partNumber; - uri.AddQueryStringParameter("partNumber", ss.str()); - ss.str(""); - } - - if (m_uploadIdHasBeenSet) { - ss << m_uploadId; - uri.AddQueryStringParameter("uploadId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection UploadPartCopyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -72,88 +29,113 @@ Aws::Http::HeaderValueCollection UploadPartCopyRequest::GetRequestSpecificHeader headers.emplace("x-amz-copy-source", URI::URLEncodePath(ss.str())); ss.str(""); } - if (m_copySourceIfMatchHasBeenSet) { ss << m_copySourceIfMatch; headers.emplace("x-amz-copy-source-if-match", ss.str()); ss.str(""); } - if (m_copySourceIfModifiedSinceHasBeenSet) { headers.emplace("x-amz-copy-source-if-modified-since", m_copySourceIfModifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_copySourceIfNoneMatchHasBeenSet) { ss << m_copySourceIfNoneMatch; headers.emplace("x-amz-copy-source-if-none-match", ss.str()); ss.str(""); } - if (m_copySourceIfUnmodifiedSinceHasBeenSet) { headers.emplace("x-amz-copy-source-if-unmodified-since", m_copySourceIfUnmodifiedSince.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_copySourceRangeHasBeenSet) { ss << m_copySourceRange; headers.emplace("x-amz-copy-source-range", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerAlgorithmHasBeenSet) { ss << m_copySourceSSECustomerAlgorithm; headers.emplace("x-amz-copy-source-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerKeyHasBeenSet) { ss << m_copySourceSSECustomerKey; headers.emplace("x-amz-copy-source-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_copySourceSSECustomerKeyMD5HasBeenSet) { ss << m_copySourceSSECustomerKeyMD5; headers.emplace("x-amz-copy-source-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - if (m_expectedSourceBucketOwnerHasBeenSet) { ss << m_expectedSourceBucketOwner; headers.emplace("x-amz-source-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void UploadPartCopyRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_partNumberHasBeenSet) { + ss << m_partNumber; + uri.AddQueryStringParameter("partNumber", ss.str()); + ss.str(""); + } + if (m_uploadIdHasBeenSet) { + ss << m_uploadId; + uri.AddQueryStringParameter("uploadId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + +bool UploadPartCopyRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { + AWS_UNREFERENCED_PARAM(header); + auto readPointer = body.tellg(); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); + body.seekg(readPointer); + if (!doc.WasParseSuccessful()) { + return false; + } + if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { + return true; + } + return false; +} + UploadPartCopyRequest::EndpointParameters UploadPartCopyRequest::GetEndpointContextParams() const { EndpointParameters parameters; // Static context parameters diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyResult.cpp index dcb5e01eeb4..a0412c45e5a 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartCopyResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,64 +20,4 @@ using namespace Aws; UploadPartCopyResult::UploadPartCopyResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -UploadPartCopyResult& UploadPartCopyResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - m_copyPartResult = resultNode; - m_copyPartResultHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& copySourceVersionIdIter = headers.find("x-amz-copy-source-version-id"); - if (copySourceVersionIdIter != headers.end()) { - m_copySourceVersionId = copySourceVersionIdIter->second; - m_copySourceVersionIdHasBeenSet = true; - } - - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +UploadPartCopyResult& UploadPartCopyResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartRequest.cpp index 45abfe06949..230ab169e44 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartRequest.cpp @@ -4,7 +4,6 @@ */ #include -#include #include #include #include @@ -14,38 +13,8 @@ using namespace Aws::S3::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; -using namespace Aws::Http; using namespace Aws; -void UploadPartRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (m_partNumberHasBeenSet) { - ss << m_partNumber; - uri.AddQueryStringParameter("partNumber", ss.str()); - ss.str(""); - } - - if (m_uploadIdHasBeenSet) { - ss << m_uploadId; - uri.AddQueryStringParameter("uploadId", ss.str()); - ss.str(""); - } - - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection UploadPartRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -54,126 +23,138 @@ Aws::Http::HeaderValueCollection UploadPartRequest::GetRequestSpecificHeaders() headers.emplace("content-length", ss.str()); ss.str(""); } - if (m_contentMD5HasBeenSet) { ss << m_contentMD5; headers.emplace("content-md5", ss.str()); ss.str(""); } - if (m_checksumAlgorithmHasBeenSet && m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET) { headers.emplace("x-amz-sdk-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm)); } - if (m_checksumCRC32HasBeenSet) { ss << m_checksumCRC32; headers.emplace("x-amz-checksum-crc32", ss.str()); ss.str(""); } - if (m_checksumCRC32CHasBeenSet) { ss << m_checksumCRC32C; headers.emplace("x-amz-checksum-crc32c", ss.str()); ss.str(""); } - if (m_checksumCRC64NVMEHasBeenSet) { ss << m_checksumCRC64NVME; headers.emplace("x-amz-checksum-crc64nvme", ss.str()); ss.str(""); } - if (m_checksumSHA1HasBeenSet) { ss << m_checksumSHA1; headers.emplace("x-amz-checksum-sha1", ss.str()); ss.str(""); } - if (m_checksumSHA256HasBeenSet) { ss << m_checksumSHA256; headers.emplace("x-amz-checksum-sha256", ss.str()); ss.str(""); } - if (m_checksumSHA512HasBeenSet) { ss << m_checksumSHA512; headers.emplace("x-amz-checksum-sha512", ss.str()); ss.str(""); } - if (m_checksumMD5HasBeenSet) { ss << m_checksumMD5; headers.emplace("x-amz-checksum-md5", ss.str()); ss.str(""); } - if (m_checksumXXHASH64HasBeenSet) { ss << m_checksumXXHASH64; headers.emplace("x-amz-checksum-xxhash64", ss.str()); ss.str(""); } - if (m_checksumXXHASH3HasBeenSet) { ss << m_checksumXXHASH3; headers.emplace("x-amz-checksum-xxhash3", ss.str()); ss.str(""); } - if (m_checksumXXHASH128HasBeenSet) { ss << m_checksumXXHASH128; headers.emplace("x-amz-checksum-xxhash128", ss.str()); ss.str(""); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSECustomerKeyHasBeenSet) { ss << m_sSECustomerKey; headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_requestPayerHasBeenSet && m_requestPayer != RequestPayer::NOT_SET) { headers.emplace("x-amz-request-payer", RequestPayerMapper::GetNameForRequestPayer(m_requestPayer)); } - if (m_expectedBucketOwnerHasBeenSet) { ss << m_expectedBucketOwner; headers.emplace("x-amz-expected-bucket-owner", ss.str()); ss.str(""); } - return headers; } +void UploadPartRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (m_partNumberHasBeenSet) { + ss << m_partNumber; + uri.AddQueryStringParameter("partNumber", ss.str()); + ss.str(""); + } + if (m_uploadIdHasBeenSet) { + ss << m_uploadId; + uri.AddQueryStringParameter("uploadId", ss.str()); + ss.str(""); + } + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + bool UploadPartRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused AWS_UNREFERENCED_PARAM(header); - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = Utils::Xml::XmlDocument::CreateFromXmlStream(body); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { return false; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { return true; } - return false; } +Aws::String UploadPartRequest::GetChecksumAlgorithmName() const { + if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { + return "crc64nvme"; + } else { + return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); + } +} + +bool UploadPartRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } UploadPartRequest::EndpointParameters UploadPartRequest::GetEndpointContextParams() const { EndpointParameters parameters; @@ -186,13 +167,3 @@ UploadPartRequest::EndpointParameters UploadPartRequest::GetEndpointContextParam } return parameters; } - -Aws::String UploadPartRequest::GetChecksumAlgorithmName() const { - if (m_checksumAlgorithm == ChecksumAlgorithm::NOT_SET) { - return "crc64nvme"; - } else { - return ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm); - } -} - -bool UploadPartRequest::ChecksumAlgorithmIsSet() const { return m_checksumAlgorithm != ChecksumAlgorithm::NOT_SET; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartResult.cpp b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartResult.cpp index 35199e8e2dd..86ae9f1f5dc 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/UploadPartResult.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/UploadPartResult.cpp @@ -4,7 +4,9 @@ */ #include +#include #include +#include #include #include #include @@ -18,122 +20,4 @@ using namespace Aws; UploadPartResult::UploadPartResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -UploadPartResult& UploadPartResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - const XmlDocument& xmlDocument = result.GetPayload(); - XmlNode resultNode = xmlDocument.GetRootElement(); - - if (!resultNode.IsNull()) { - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& serverSideEncryptionIter = headers.find("x-amz-server-side-encryption"); - if (serverSideEncryptionIter != headers.end()) { - m_serverSideEncryption = ServerSideEncryptionMapper::GetServerSideEncryptionForName(serverSideEncryptionIter->second); - m_serverSideEncryptionHasBeenSet = true; - } - - const auto& eTagIter = headers.find("etag"); - if (eTagIter != headers.end()) { - m_eTag = eTagIter->second; - m_eTagHasBeenSet = true; - } - - const auto& checksumCRC32Iter = headers.find("x-amz-checksum-crc32"); - if (checksumCRC32Iter != headers.end()) { - m_checksumCRC32 = checksumCRC32Iter->second; - m_checksumCRC32HasBeenSet = true; - } - - const auto& checksumCRC32CIter = headers.find("x-amz-checksum-crc32c"); - if (checksumCRC32CIter != headers.end()) { - m_checksumCRC32C = checksumCRC32CIter->second; - m_checksumCRC32CHasBeenSet = true; - } - - const auto& checksumCRC64NVMEIter = headers.find("x-amz-checksum-crc64nvme"); - if (checksumCRC64NVMEIter != headers.end()) { - m_checksumCRC64NVME = checksumCRC64NVMEIter->second; - m_checksumCRC64NVMEHasBeenSet = true; - } - - const auto& checksumSHA1Iter = headers.find("x-amz-checksum-sha1"); - if (checksumSHA1Iter != headers.end()) { - m_checksumSHA1 = checksumSHA1Iter->second; - m_checksumSHA1HasBeenSet = true; - } - - const auto& checksumSHA256Iter = headers.find("x-amz-checksum-sha256"); - if (checksumSHA256Iter != headers.end()) { - m_checksumSHA256 = checksumSHA256Iter->second; - m_checksumSHA256HasBeenSet = true; - } - - const auto& checksumSHA512Iter = headers.find("x-amz-checksum-sha512"); - if (checksumSHA512Iter != headers.end()) { - m_checksumSHA512 = checksumSHA512Iter->second; - m_checksumSHA512HasBeenSet = true; - } - - const auto& checksumMD5Iter = headers.find("x-amz-checksum-md5"); - if (checksumMD5Iter != headers.end()) { - m_checksumMD5 = checksumMD5Iter->second; - m_checksumMD5HasBeenSet = true; - } - - const auto& checksumXXHASH64Iter = headers.find("x-amz-checksum-xxhash64"); - if (checksumXXHASH64Iter != headers.end()) { - m_checksumXXHASH64 = checksumXXHASH64Iter->second; - m_checksumXXHASH64HasBeenSet = true; - } - - const auto& checksumXXHASH3Iter = headers.find("x-amz-checksum-xxhash3"); - if (checksumXXHASH3Iter != headers.end()) { - m_checksumXXHASH3 = checksumXXHASH3Iter->second; - m_checksumXXHASH3HasBeenSet = true; - } - - const auto& checksumXXHASH128Iter = headers.find("x-amz-checksum-xxhash128"); - if (checksumXXHASH128Iter != headers.end()) { - m_checksumXXHASH128 = checksumXXHASH128Iter->second; - m_checksumXXHASH128HasBeenSet = true; - } - - const auto& sSECustomerAlgorithmIter = headers.find("x-amz-server-side-encryption-customer-algorithm"); - if (sSECustomerAlgorithmIter != headers.end()) { - m_sSECustomerAlgorithm = sSECustomerAlgorithmIter->second; - m_sSECustomerAlgorithmHasBeenSet = true; - } - - const auto& sSECustomerKeyMD5Iter = headers.find("x-amz-server-side-encryption-customer-key-md5"); - if (sSECustomerKeyMD5Iter != headers.end()) { - m_sSECustomerKeyMD5 = sSECustomerKeyMD5Iter->second; - m_sSECustomerKeyMD5HasBeenSet = true; - } - - const auto& sSEKMSKeyIdIter = headers.find("x-amz-server-side-encryption-aws-kms-key-id"); - if (sSEKMSKeyIdIter != headers.end()) { - m_sSEKMSKeyId = sSEKMSKeyIdIter->second; - m_sSEKMSKeyIdHasBeenSet = true; - } - - const auto& bucketKeyEnabledIter = headers.find("x-amz-server-side-encryption-bucket-key-enabled"); - if (bucketKeyEnabledIter != headers.end()) { - m_bucketKeyEnabled = StringUtils::ConvertToBool(bucketKeyEnabledIter->second.c_str()); - m_bucketKeyEnabledHasBeenSet = true; - } - - const auto& requestChargedIter = headers.find("x-amz-request-charged"); - if (requestChargedIter != headers.end()) { - m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); - m_requestChargedHasBeenSet = true; - } - - const auto& requestIdIter = headers.find("x-amz-request-id"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +UploadPartResult& UploadPartResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-s3/source/model/VersioningConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/VersioningConfiguration.cpp index 4ae0e704940..bd9c9aef0f3 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/VersioningConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/VersioningConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,39 +20,9 @@ namespace Model { VersioningConfiguration::VersioningConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -VersioningConfiguration& VersioningConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; - - if (!resultNode.IsNull()) { - XmlNode mFADeleteNode = resultNode.FirstChild("MfaDelete"); - if (!mFADeleteNode.IsNull()) { - m_mFADelete = - MFADeleteMapper::GetMFADeleteForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(mFADeleteNode.GetText()).c_str())); - m_mFADeleteHasBeenSet = true; - } - XmlNode statusNode = resultNode.FirstChild("Status"); - if (!statusNode.IsNull()) { - m_status = BucketVersioningStatusMapper::GetBucketVersioningStatusForName( - StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str())); - m_statusHasBeenSet = true; - } - } - - return *this; -} - -void VersioningConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_mFADeleteHasBeenSet) { - XmlNode mFADeleteNode = parentNode.CreateChildElement("MfaDelete"); - mFADeleteNode.SetText(MFADeleteMapper::GetNameForMFADelete(m_mFADelete)); - } - - if (m_statusHasBeenSet) { - XmlNode statusNode = parentNode.CreateChildElement("Status"); - statusNode.SetText(BucketVersioningStatusMapper::GetNameForBucketVersioningStatus(m_status)); - } -} +VersioningConfiguration& VersioningConfiguration::operator=(const XmlNode& xmlNode) { return *this; } + +void VersioningConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/WebsiteConfiguration.cpp b/generated/src/aws-cpp-sdk-s3/source/model/WebsiteConfiguration.cpp index f55f382a60a..b2a2c130fa2 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/WebsiteConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/WebsiteConfiguration.cpp @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0. */ -#include +#include +#include #include #include #include @@ -19,66 +20,9 @@ namespace Model { WebsiteConfiguration::WebsiteConfiguration(const XmlNode& xmlNode) { *this = xmlNode; } -WebsiteConfiguration& WebsiteConfiguration::operator=(const XmlNode& xmlNode) { - XmlNode resultNode = xmlNode; +WebsiteConfiguration& WebsiteConfiguration::operator=(const XmlNode& xmlNode) { return *this; } - if (!resultNode.IsNull()) { - XmlNode errorDocumentNode = resultNode.FirstChild("ErrorDocument"); - if (!errorDocumentNode.IsNull()) { - m_errorDocument = errorDocumentNode; - m_errorDocumentHasBeenSet = true; - } - XmlNode indexDocumentNode = resultNode.FirstChild("IndexDocument"); - if (!indexDocumentNode.IsNull()) { - m_indexDocument = indexDocumentNode; - m_indexDocumentHasBeenSet = true; - } - XmlNode redirectAllRequestsToNode = resultNode.FirstChild("RedirectAllRequestsTo"); - if (!redirectAllRequestsToNode.IsNull()) { - m_redirectAllRequestsTo = redirectAllRequestsToNode; - m_redirectAllRequestsToHasBeenSet = true; - } - XmlNode routingRulesNode = resultNode.FirstChild("RoutingRules"); - if (!routingRulesNode.IsNull()) { - XmlNode routingRulesMember = routingRulesNode.FirstChild("RoutingRule"); - m_routingRulesHasBeenSet = !routingRulesMember.IsNull(); - while (!routingRulesMember.IsNull()) { - m_routingRules.push_back(routingRulesMember); - routingRulesMember = routingRulesMember.NextNode("RoutingRule"); - } - - m_routingRulesHasBeenSet = true; - } - } - - return *this; -} - -void WebsiteConfiguration::AddToNode(XmlNode& parentNode) const { - Aws::StringStream ss; - if (m_errorDocumentHasBeenSet) { - XmlNode errorDocumentNode = parentNode.CreateChildElement("ErrorDocument"); - m_errorDocument.AddToNode(errorDocumentNode); - } - - if (m_indexDocumentHasBeenSet) { - XmlNode indexDocumentNode = parentNode.CreateChildElement("IndexDocument"); - m_indexDocument.AddToNode(indexDocumentNode); - } - - if (m_redirectAllRequestsToHasBeenSet) { - XmlNode redirectAllRequestsToNode = parentNode.CreateChildElement("RedirectAllRequestsTo"); - m_redirectAllRequestsTo.AddToNode(redirectAllRequestsToNode); - } - - if (m_routingRulesHasBeenSet) { - XmlNode routingRulesParentNode = parentNode.CreateChildElement("RoutingRules"); - for (const auto& item : m_routingRules) { - XmlNode routingRulesNode = routingRulesParentNode.CreateChildElement("RoutingRule"); - item.AddToNode(routingRulesNode); - } - } -} +void WebsiteConfiguration::AddToNode(XmlNode& parentNode) const {} } // namespace Model } // namespace S3 diff --git a/generated/src/aws-cpp-sdk-s3/source/model/WriteGetObjectResponseRequest.cpp b/generated/src/aws-cpp-sdk-s3/source/model/WriteGetObjectResponseRequest.cpp index c933f5df224..f0623f9ec00 100644 --- a/generated/src/aws-cpp-sdk-s3/source/model/WriteGetObjectResponseRequest.cpp +++ b/generated/src/aws-cpp-sdk-s3/source/model/WriteGetObjectResponseRequest.cpp @@ -4,7 +4,6 @@ */ #include -#include #include #include #include @@ -14,26 +13,8 @@ using namespace Aws::S3::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; -using namespace Aws::Http; using namespace Aws; -void WriteGetObjectResponseRequest::AddQueryStringParameters(URI& uri) const { - Aws::StringStream ss; - if (!m_customizedAccessLogTag.empty()) { - // only accept customized LogTag which starts with "x-" - Aws::Map collectedLogTags; - for (const auto& entry : m_customizedAccessLogTag) { - if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { - collectedLogTags.emplace(entry.first, entry.second); - } - } - - if (!collectedLogTags.empty()) { - uri.AddQueryStringParameter(collectedLogTags); - } - } -} - Aws::Http::HeaderValueCollection WriteGetObjectResponseRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; @@ -42,165 +23,137 @@ Aws::Http::HeaderValueCollection WriteGetObjectResponseRequest::GetRequestSpecif headers.emplace("x-amz-request-route", ss.str()); ss.str(""); } - if (m_requestTokenHasBeenSet) { ss << m_requestToken; headers.emplace("x-amz-request-token", ss.str()); ss.str(""); } - if (m_statusCodeHasBeenSet) { ss << m_statusCode; headers.emplace("x-amz-fwd-status", ss.str()); ss.str(""); } - if (m_errorCodeHasBeenSet) { ss << m_errorCode; headers.emplace("x-amz-fwd-error-code", ss.str()); ss.str(""); } - if (m_errorMessageHasBeenSet) { ss << m_errorMessage; headers.emplace("x-amz-fwd-error-message", ss.str()); ss.str(""); } - if (m_acceptRangesHasBeenSet) { ss << m_acceptRanges; headers.emplace("x-amz-fwd-header-accept-ranges", ss.str()); ss.str(""); } - if (m_cacheControlHasBeenSet) { ss << m_cacheControl; headers.emplace("x-amz-fwd-header-cache-control", ss.str()); ss.str(""); } - if (m_contentDispositionHasBeenSet) { ss << m_contentDisposition; headers.emplace("x-amz-fwd-header-content-disposition", ss.str()); ss.str(""); } - if (m_contentEncodingHasBeenSet) { ss << m_contentEncoding; headers.emplace("x-amz-fwd-header-content-encoding", ss.str()); ss.str(""); } - if (m_contentLanguageHasBeenSet) { ss << m_contentLanguage; headers.emplace("x-amz-fwd-header-content-language", ss.str()); ss.str(""); } - if (m_contentLengthHasBeenSet) { ss << m_contentLength; headers.emplace("content-length", ss.str()); ss.str(""); } - if (m_contentRangeHasBeenSet) { ss << m_contentRange; headers.emplace("x-amz-fwd-header-content-range", ss.str()); ss.str(""); } - if (m_checksumCRC32HasBeenSet) { ss << m_checksumCRC32; headers.emplace("x-amz-fwd-header-x-amz-checksum-crc32", ss.str()); ss.str(""); } - if (m_checksumCRC32CHasBeenSet) { ss << m_checksumCRC32C; headers.emplace("x-amz-fwd-header-x-amz-checksum-crc32c", ss.str()); ss.str(""); } - if (m_checksumCRC64NVMEHasBeenSet) { ss << m_checksumCRC64NVME; headers.emplace("x-amz-fwd-header-x-amz-checksum-crc64nvme", ss.str()); ss.str(""); } - if (m_checksumSHA1HasBeenSet) { ss << m_checksumSHA1; headers.emplace("x-amz-fwd-header-x-amz-checksum-sha1", ss.str()); ss.str(""); } - if (m_checksumSHA256HasBeenSet) { ss << m_checksumSHA256; headers.emplace("x-amz-fwd-header-x-amz-checksum-sha256", ss.str()); ss.str(""); } - if (m_checksumSHA512HasBeenSet) { ss << m_checksumSHA512; headers.emplace("x-amz-fwd-header-x-amz-checksum-sha512", ss.str()); ss.str(""); } - if (m_checksumMD5HasBeenSet) { ss << m_checksumMD5; headers.emplace("x-amz-fwd-header-x-amz-checksum-md5", ss.str()); ss.str(""); } - if (m_checksumXXHASH64HasBeenSet) { ss << m_checksumXXHASH64; headers.emplace("x-amz-fwd-header-x-amz-checksum-xxhash64", ss.str()); ss.str(""); } - if (m_checksumXXHASH3HasBeenSet) { ss << m_checksumXXHASH3; headers.emplace("x-amz-fwd-header-x-amz-checksum-xxhash3", ss.str()); ss.str(""); } - if (m_checksumXXHASH128HasBeenSet) { ss << m_checksumXXHASH128; headers.emplace("x-amz-fwd-header-x-amz-checksum-xxhash128", ss.str()); ss.str(""); } - if (m_deleteMarkerHasBeenSet) { ss << std::boolalpha << m_deleteMarker; headers.emplace("x-amz-fwd-header-x-amz-delete-marker", ss.str()); ss.str(""); } - if (m_eTagHasBeenSet) { ss << m_eTag; headers.emplace("x-amz-fwd-header-etag", ss.str()); ss.str(""); } - if (m_expiresHasBeenSet) { headers.emplace("x-amz-fwd-header-expires", m_expires.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_expirationHasBeenSet) { ss << m_expiration; headers.emplace("x-amz-fwd-header-x-amz-expiration", ss.str()); ss.str(""); } - if (m_lastModifiedHasBeenSet) { headers.emplace("x-amz-fwd-header-last-modified", m_lastModified.ToGmtString(Aws::Utils::DateFormat::RFC822)); } - if (m_missingMetaHasBeenSet) { ss << m_missingMeta; headers.emplace("x-amz-fwd-header-x-amz-missing-meta", ss.str()); ss.str(""); } - if (m_metadataHasBeenSet) { for (const auto& item : m_metadata) { ss << "x-amz-meta-" << item.first; @@ -208,105 +161,100 @@ Aws::Http::HeaderValueCollection WriteGetObjectResponseRequest::GetRequestSpecif ss.str(""); } } - if (m_objectLockModeHasBeenSet && m_objectLockMode != ObjectLockMode::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-object-lock-mode", ObjectLockModeMapper::GetNameForObjectLockMode(m_objectLockMode)); } - if (m_objectLockLegalHoldStatusHasBeenSet && m_objectLockLegalHoldStatus != ObjectLockLegalHoldStatus::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-object-lock-legal-hold", ObjectLockLegalHoldStatusMapper::GetNameForObjectLockLegalHoldStatus(m_objectLockLegalHoldStatus)); } - if (m_objectLockRetainUntilDateHasBeenSet) { headers.emplace("x-amz-fwd-header-x-amz-object-lock-retain-until-date", m_objectLockRetainUntilDate.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } - if (m_partsCountHasBeenSet) { ss << m_partsCount; headers.emplace("x-amz-fwd-header-x-amz-mp-parts-count", ss.str()); ss.str(""); } - if (m_replicationStatusHasBeenSet && m_replicationStatus != ReplicationStatus::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-replication-status", ReplicationStatusMapper::GetNameForReplicationStatus(m_replicationStatus)); } - if (m_requestChargedHasBeenSet && m_requestCharged != RequestCharged::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-request-charged", RequestChargedMapper::GetNameForRequestCharged(m_requestCharged)); } - if (m_restoreHasBeenSet) { ss << m_restore; headers.emplace("x-amz-fwd-header-x-amz-restore", ss.str()); ss.str(""); } - if (m_serverSideEncryptionHasBeenSet && m_serverSideEncryption != ServerSideEncryption::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); } - if (m_sSECustomerAlgorithmHasBeenSet) { ss << m_sSECustomerAlgorithm; headers.emplace("x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm", ss.str()); ss.str(""); } - if (m_sSEKMSKeyIdHasBeenSet) { ss << m_sSEKMSKeyId; headers.emplace("x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id", ss.str()); ss.str(""); } - if (m_sSECustomerKeyMD5HasBeenSet) { ss << m_sSECustomerKeyMD5; headers.emplace("x-amz-fwd-header-x-amz-server-side-encryption-customer-key-md5", ss.str()); ss.str(""); } - if (m_storageClassHasBeenSet && m_storageClass != StorageClass::NOT_SET) { headers.emplace("x-amz-fwd-header-x-amz-storage-class", StorageClassMapper::GetNameForStorageClass(m_storageClass)); } - if (m_tagCountHasBeenSet) { ss << m_tagCount; headers.emplace("x-amz-fwd-header-x-amz-tagging-count", ss.str()); ss.str(""); } - if (m_versionIdHasBeenSet) { ss << m_versionId; headers.emplace("x-amz-fwd-header-x-amz-version-id", ss.str()); ss.str(""); } - if (m_bucketKeyEnabledHasBeenSet) { ss << std::boolalpha << m_bucketKeyEnabled; headers.emplace("x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled", ss.str()); ss.str(""); } - return headers; } +void WriteGetObjectResponseRequest::AddQueryStringParameters(Aws::Http::URI& uri) const { + Aws::StringStream ss; + if (!m_customizedAccessLogTag.empty()) { + // only accept customized LogTag which starts with "x-" + Aws::Map collectedLogTags; + for (const auto& entry : m_customizedAccessLogTag) { + if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-") { + collectedLogTags.emplace(entry.first, entry.second); + } + } + if (!collectedLogTags.empty()) { + uri.AddQueryStringParameter(collectedLogTags); + } + } +} + bool WriteGetObjectResponseRequest::HasEmbeddedError(Aws::IOStream& body, const Aws::Http::HeaderValueCollection& header) const { - // Header is unused AWS_UNREFERENCED_PARAM(header); - auto readPointer = body.tellg(); - Utils::Xml::XmlDocument doc = Utils::Xml::XmlDocument::CreateFromXmlStream(body); + Utils::Xml::XmlDocument doc = XmlDocument::CreateFromXmlStream(body); body.seekg(readPointer); - if (!doc.WasParseSuccessful()) { return false; } - if (!doc.GetRootElement().IsNull() && doc.GetRootElement().GetName() == Aws::String("Error")) { return true; } - return false; } diff --git a/generated/tests/s3-gen-tests/S3IncludeTests.cpp b/generated/tests/s3-gen-tests/S3IncludeTests.cpp index 1bb72fb5d01..ac607114d18 100644 --- a/generated/tests/s3-gen-tests/S3IncludeTests.cpp +++ b/generated/tests/s3-gen-tests/S3IncludeTests.cpp @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -240,7 +239,6 @@ #include #include #include -#include #include #include #include @@ -295,7 +293,6 @@ #include #include #include -#include #include #include #include @@ -369,7 +366,6 @@ #include #include #include -#include #include #include #include @@ -398,7 +394,6 @@ #include #include #include -#include #include #include #include @@ -437,7 +432,6 @@ #include #include #include -#include #include #include #include From c0ad761dc3ec2914dba584da5e9f7d7e923853e4 Mon Sep 17 00:00:00 2001 From: sbaluja Date: Thu, 3 Sep 2026 14:49:21 -0400 Subject: [PATCH 51/53] DynamoDB Diffs --- .../aws/dynamodb/model/AttributeValueUpdate.h | 23 +- .../aws/dynamodb/model/BatchGetItemRequest.h | 4 +- .../aws/dynamodb/model/BillingModeSummary.h | 4 +- .../include/aws/dynamodb/model/Condition.h | 98 +++--- .../aws/dynamodb/model/CreateTableRequest.h | 24 +- .../aws/dynamodb/model/DeleteItemRequest.h | 10 +- .../dynamodb/model/DescribeTimeToLiveResult.h | 2 +- .../dynamodb/model/ExpectedAttributeValue.h | 98 +++--- .../model/ExportTableToPointInTimeRequest.h | 4 +- .../aws/dynamodb/model/GetItemRequest.h | 4 +- .../model/GlobalSecondaryIndexDescription.h | 6 +- .../aws/dynamodb/model/KeysAndAttributes.h | 6 +- .../aws/dynamodb/model/LocalSecondaryIndex.h | 14 +- .../model/LocalSecondaryIndexDescription.h | 14 +- .../dynamodb/model/LocalSecondaryIndexInfo.h | 14 +- .../aws/dynamodb/model/PutItemRequest.h | 10 +- .../dynamodb/model/PutResourcePolicyRequest.h | 12 +- .../include/aws/dynamodb/model/QueryRequest.h | 66 ++-- .../model/ReplicaAutoScalingDescription.h | 2 +- .../aws/dynamodb/model/ReplicaDescription.h | 16 +- .../dynamodb/model/ReplicationGroupUpdate.h | 8 +- .../include/aws/dynamodb/model/ScanRequest.h | 18 +- .../aws/dynamodb/model/TableDescription.h | 8 +- .../model/TransactionCanceledException.h | 62 ++-- .../aws/dynamodb/model/UpdateItemRequest.h | 45 ++- .../aws/dynamodb/model/UpdateTableRequest.h | 8 +- .../ApproximateCreationDateTimePrecision.cpp | 2 - .../source/model/ArchivalSummary.cpp | 32 +- .../source/model/AttributeAction.cpp | 2 - .../source/model/AttributeDefinition.cpp | 24 +- .../source/model/AttributeValueUpdate.cpp | 24 +- .../model/AutoScalingPolicyDescription.cpp | 24 +- .../source/model/AutoScalingPolicyUpdate.cpp | 24 +- .../model/AutoScalingSettingsDescription.cpp | 55 +--- .../model/AutoScalingSettingsUpdate.cpp | 48 +-- ...gScalingPolicyConfigurationDescription.cpp | 36 +-- ...ackingScalingPolicyConfigurationUpdate.cpp | 36 +-- .../source/model/BackupDescription.cpp | 32 +- .../source/model/BackupDetails.cpp | 64 +--- .../source/model/BackupStatus.cpp | 2 - .../source/model/BackupSummary.cpp | 88 +---- .../source/model/BackupType.cpp | 2 - .../source/model/BackupTypeFilter.cpp | 2 - .../model/BatchExecuteStatementRequest.cpp | 24 +- .../model/BatchExecuteStatementResult.cpp | 29 +- .../source/model/BatchGetItemRequest.cpp | 24 +- .../source/model/BatchGetItemResult.cpp | 47 +-- .../source/model/BatchStatementError.cpp | 39 +-- .../model/BatchStatementErrorCodeEnum.cpp | 2 - .../source/model/BatchStatementRequest.cpp | 50 +-- .../source/model/BatchStatementResponse.cpp | 39 +-- .../source/model/BatchWriteItemRequest.cpp | 33 +- .../source/model/BatchWriteItemResult.cpp | 51 +-- .../source/model/BillingMode.cpp | 2 - .../source/model/BillingModeSummary.cpp | 24 +- .../source/model/CancellationReason.cpp | 39 +-- .../source/model/Capacity.cpp | 32 +- .../source/model/ComparisonOperator.cpp | 2 - .../source/model/Condition.cpp | 33 +- .../source/model/ConditionCheck.cpp | 80 +---- .../model/ConditionalCheckFailedException.cpp | 31 +- .../source/model/ConditionalOperator.cpp | 2 - .../source/model/ConsumedCapacity.cpp | 93 +----- .../model/ContinuousBackupsDescription.cpp | 26 +- .../source/model/ContinuousBackupsStatus.cpp | 2 - .../model/ContributorInsightsAction.cpp | 2 - .../source/model/ContributorInsightsMode.cpp | 2 - .../model/ContributorInsightsStatus.cpp | 2 - .../model/ContributorInsightsSummary.cpp | 44 +-- .../source/model/CreateBackupRequest.cpp | 20 +- .../source/model/CreateBackupResult.cpp | 19 +- .../CreateGlobalSecondaryIndexAction.cpp | 63 +--- .../source/model/CreateGlobalTableRequest.cpp | 24 +- .../source/model/CreateGlobalTableResult.cpp | 19 +- ...ateGlobalTableWitnessGroupMemberAction.cpp | 16 +- .../source/model/CreateReplicaAction.cpp | 16 +- .../CreateReplicationGroupMemberAction.cpp | 65 +--- .../source/model/CreateTableRequest.cpp | 113 +------ .../source/model/CreateTableResult.cpp | 19 +- .../source/model/CreateVectorIndexAction.cpp | 63 +--- .../source/model/CsvOptions.cpp | 31 +- .../source/model/Delete.cpp | 80 +---- .../source/model/DeleteBackupRequest.cpp | 16 +- .../source/model/DeleteBackupResult.cpp | 19 +- .../DeleteGlobalSecondaryIndexAction.cpp | 16 +- ...eteGlobalTableWitnessGroupMemberAction.cpp | 16 +- .../source/model/DeleteItemRequest.cpp | 75 +---- .../source/model/DeleteItemResult.cpp | 30 +- .../source/model/DeleteReplicaAction.cpp | 16 +- .../DeleteReplicationGroupMemberAction.cpp | 16 +- .../source/model/DeleteRequest.cpp | 23 +- .../model/DeleteResourcePolicyRequest.cpp | 20 +- .../model/DeleteResourcePolicyResult.cpp | 19 +- .../source/model/DeleteTableRequest.cpp | 16 +- .../source/model/DeleteTableResult.cpp | 19 +- .../source/model/DeleteVectorIndexAction.cpp | 16 +- .../source/model/DescribeBackupRequest.cpp | 16 +- .../source/model/DescribeBackupResult.cpp | 19 +- .../DescribeContinuousBackupsRequest.cpp | 16 +- .../model/DescribeContinuousBackupsResult.cpp | 15 +- .../DescribeContributorInsightsRequest.cpp | 20 +- .../DescribeContributorInsightsResult.cpp | 45 +-- .../source/model/DescribeEndpointsRequest.cpp | 6 + .../source/model/DescribeEndpointsResult.cpp | 22 +- .../source/model/DescribeExportRequest.cpp | 16 +- .../source/model/DescribeExportResult.cpp | 19 +- .../model/DescribeGlobalTableRequest.cpp | 16 +- .../model/DescribeGlobalTableResult.cpp | 19 +- .../DescribeGlobalTableSettingsRequest.cpp | 16 +- .../DescribeGlobalTableSettingsResult.cpp | 22 +- .../source/model/DescribeImportRequest.cpp | 16 +- .../source/model/DescribeImportResult.cpp | 19 +- ...ribeKinesisStreamingDestinationRequest.cpp | 16 +- ...cribeKinesisStreamingDestinationResult.cpp | 23 +- .../source/model/DescribeLimitsRequest.cpp | 6 + .../source/model/DescribeLimitsResult.cpp | 31 +- ...DescribeTableReplicaAutoScalingRequest.cpp | 16 +- .../DescribeTableReplicaAutoScalingResult.cpp | 15 +- .../source/model/DescribeTableRequest.cpp | 16 +- .../source/model/DescribeTableResult.cpp | 19 +- .../model/DescribeTimeToLiveRequest.cpp | 16 +- .../source/model/DescribeTimeToLiveResult.cpp | 19 +- .../source/model/DestinationStatus.cpp | 2 - ...ableKinesisStreamingDestinationRequest.cpp | 24 +- ...sableKinesisStreamingDestinationResult.cpp | 27 +- .../EnableKinesisStreamingConfiguration.cpp | 19 +- ...ableKinesisStreamingDestinationRequest.cpp | 24 +- ...nableKinesisStreamingDestinationResult.cpp | 27 +- .../source/model/Endpoint.cpp | 24 +- .../source/model/ExecuteStatementRequest.cpp | 46 +-- .../source/model/ExecuteStatementResult.cpp | 42 +-- .../model/ExecuteTransactionRequest.cpp | 29 +- .../source/model/ExecuteTransactionResult.cpp | 29 +- .../source/model/ExpectedAttributeValue.cpp | 49 +-- .../source/model/ExportDescription.cpp | 176 +--------- .../source/model/ExportFormat.cpp | 2 - .../source/model/ExportStatus.cpp | 2 - .../source/model/ExportSummary.cpp | 32 +- .../model/ExportTableToPointInTimeRequest.cpp | 56 +--- .../model/ExportTableToPointInTimeResult.cpp | 15 +- .../source/model/ExportType.cpp | 2 - .../source/model/ExportViewType.cpp | 2 - .../source/model/FailureException.cpp | 24 +- .../aws-cpp-sdk-dynamodb/source/model/Get.cpp | 54 +--- .../source/model/GetItemRequest.cpp | 52 +-- .../source/model/GetItemResult.cpp | 26 +- .../source/model/GetResourcePolicyRequest.cpp | 16 +- .../source/model/GetResourcePolicyResult.cpp | 23 +- .../source/model/GlobalSecondaryIndex.cpp | 63 +--- .../GlobalSecondaryIndexAutoScalingUpdate.cpp | 24 +- .../model/GlobalSecondaryIndexDescription.cpp | 103 +----- .../source/model/GlobalSecondaryIndexInfo.cpp | 55 +--- .../model/GlobalSecondaryIndexUpdate.cpp | 32 +- ...econdaryIndexWarmThroughputDescription.cpp | 28 +- .../source/model/GlobalTable.cpp | 31 +- .../source/model/GlobalTableDescription.cpp | 55 +--- ...ableGlobalSecondaryIndexSettingsUpdate.cpp | 28 +- .../GlobalTableSettingsReplicationMode.cpp | 2 - .../source/model/GlobalTableStatus.cpp | 2 - .../model/GlobalTableWitnessDescription.cpp | 24 +- .../model/GlobalTableWitnessGroupUpdate.cpp | 24 +- .../source/model/ImportStatus.cpp | 2 - .../source/model/ImportSummary.cpp | 72 +---- .../source/model/ImportTableDescription.cpp | 160 +--------- .../source/model/ImportTableRequest.cpp | 36 +-- .../source/model/ImportTableResult.cpp | 19 +- .../model/IncrementalExportSpecification.cpp | 32 +- .../source/model/IndexStatus.cpp | 2 - .../source/model/InputCompressionType.cpp | 2 - .../source/model/InputFormat.cpp | 2 - .../source/model/InputFormatOptions.cpp | 16 +- .../source/model/ItemCollectionMetrics.cpp | 40 +-- .../source/model/ItemResponse.cpp | 23 +- .../source/model/KeySchemaElement.cpp | 24 +- .../source/model/KeyType.cpp | 2 - .../source/model/KeysAndAttributes.cpp | 78 +---- .../model/KinesisDataStreamDestination.cpp | 43 +-- .../source/model/ListBackupsRequest.cpp | 36 +-- .../source/model/ListBackupsResult.cpp | 26 +- .../model/ListContributorInsightsRequest.cpp | 24 +- .../model/ListContributorInsightsResult.cpp | 23 +- .../source/model/ListExportsRequest.cpp | 24 +- .../source/model/ListExportsResult.cpp | 26 +- .../source/model/ListGlobalTablesRequest.cpp | 24 +- .../source/model/ListGlobalTablesResult.cpp | 26 +- .../source/model/ListImportsRequest.cpp | 24 +- .../source/model/ListImportsResult.cpp | 26 +- .../source/model/ListTablesRequest.cpp | 20 +- .../source/model/ListTablesResult.cpp | 26 +- .../model/ListTagsOfResourceRequest.cpp | 20 +- .../source/model/ListTagsOfResourceResult.cpp | 26 +- .../source/model/LocalSecondaryIndex.cpp | 39 +-- .../model/LocalSecondaryIndexDescription.cpp | 63 +--- .../source/model/LocalSecondaryIndexInfo.cpp | 39 +-- .../source/model/MultiRegionConsistency.cpp | 2 - .../source/model/OnDemandThroughput.cpp | 24 +- .../model/OnDemandThroughputOverride.cpp | 16 +- .../source/model/ParameterizedStatement.cpp | 42 +-- .../model/PointInTimeRecoveryDescription.cpp | 42 +-- .../PointInTimeRecoverySpecification.cpp | 24 +- .../model/PointInTimeRecoveryStatus.cpp | 2 - .../source/model/Projection.cpp | 31 +- .../source/model/ProjectionType.cpp | 2 - .../source/model/ProvisionedThroughput.cpp | 24 +- .../ProvisionedThroughputDescription.cpp | 48 +-- ...ProvisionedThroughputExceededException.cpp | 31 +- .../model/ProvisionedThroughputOverride.cpp | 16 +- .../aws-cpp-sdk-dynamodb/source/model/Put.cpp | 80 +---- .../source/model/PutItemRequest.cpp | 75 +---- .../source/model/PutItemResult.cpp | 30 +- .../source/model/PutRequest.cpp | 23 +- .../source/model/PutResourcePolicyRequest.cpp | 28 +- .../source/model/PutResourcePolicyResult.cpp | 19 +- .../source/model/QueryRequest.cpp | 104 +----- .../source/model/QueryResult.cpp | 46 +-- .../source/model/Replica.cpp | 16 +- .../model/ReplicaAutoScalingDescription.cpp | 58 +--- .../source/model/ReplicaAutoScalingUpdate.cpp | 45 +-- .../source/model/ReplicaDescription.cpp | 124 +------- .../model/ReplicaGlobalSecondaryIndex.cpp | 32 +- ...alSecondaryIndexAutoScalingDescription.cpp | 36 +-- ...aGlobalSecondaryIndexAutoScalingUpdate.cpp | 24 +- ...ReplicaGlobalSecondaryIndexDescription.cpp | 40 +-- ...lobalSecondaryIndexSettingsDescription.cpp | 52 +-- ...licaGlobalSecondaryIndexSettingsUpdate.cpp | 32 +- .../model/ReplicaSettingsDescription.cpp | 94 +----- .../source/model/ReplicaSettingsUpdate.cpp | 64 +--- .../source/model/ReplicaStatus.cpp | 2 - .../source/model/ReplicaUpdate.cpp | 24 +- .../source/model/ReplicationGroupUpdate.cpp | 32 +- .../source/model/RequestLimitExceeded.cpp | 31 +- .../source/model/RestoreSummary.cpp | 40 +-- .../model/RestoreTableFromBackupRequest.cpp | 65 +--- .../model/RestoreTableFromBackupResult.cpp | 15 +- .../RestoreTableToPointInTimeRequest.cpp | 77 +---- .../model/RestoreTableToPointInTimeResult.cpp | 15 +- .../source/model/ReturnConsumedCapacity.cpp | 2 - .../model/ReturnItemCollectionMetrics.cpp | 2 - .../source/model/ReturnValue.cpp | 2 - .../ReturnValuesOnConditionCheckFailure.cpp | 2 - .../source/model/S3BucketSource.cpp | 32 +- .../source/model/S3SseAlgorithm.cpp | 2 - .../source/model/SSEDescription.cpp | 40 +-- .../source/model/SSESpecification.cpp | 32 +- .../source/model/SSEStatus.cpp | 2 - .../source/model/SSEType.cpp | 2 - .../source/model/ScalarAttributeType.cpp | 2 - .../source/model/ScanRequest.cpp | 96 +----- .../source/model/ScanResult.cpp | 46 +-- .../source/model/SearchResultItem.cpp | 31 +- .../source/model/SearchSchemaElement.cpp | 26 +- .../source/model/SearchSchemaElementType.cpp | 2 - .../source/model/SearchVectorsRequest.cpp | 60 +--- .../source/model/SearchVectorsResult.cpp | 26 +- .../source/model/Select.cpp | 2 - .../source/model/SourceTableDetails.cpp | 95 +----- .../model/SourceTableFeatureDetails.cpp | 81 +---- .../source/model/StreamSpecification.cpp | 24 +- .../source/model/StreamViewType.cpp | 2 - .../model/TableAutoScalingDescription.cpp | 39 +-- .../source/model/TableClass.cpp | 2 - .../source/model/TableClassSummary.cpp | 24 +- .../source/model/TableCreationParameters.cpp | 112 +------ .../source/model/TableDescription.cpp | 301 +----------------- .../source/model/TableStatus.cpp | 2 - .../model/TableWarmThroughputDescription.cpp | 32 +- .../aws-cpp-sdk-dynamodb/source/model/Tag.cpp | 24 +- .../source/model/TagResourceRequest.cpp | 24 +- .../source/model/ThrottlingException.cpp | 31 +- .../source/model/ThrottlingReason.cpp | 24 +- .../source/model/TimeToLiveDescription.cpp | 24 +- .../source/model/TimeToLiveSpecification.cpp | 24 +- .../source/model/TimeToLiveStatus.cpp | 2 - .../source/model/TransactGetItem.cpp | 16 +- .../source/model/TransactGetItemsRequest.cpp | 24 +- .../source/model/TransactGetItemsResult.cpp | 29 +- .../source/model/TransactWriteItem.cpp | 40 +-- .../model/TransactWriteItemsRequest.cpp | 33 +- .../source/model/TransactWriteItemsResult.cpp | 38 +-- .../model/TransactionCanceledException.cpp | 33 +- .../source/model/UntagResourceRequest.cpp | 24 +- .../source/model/Update.cpp | 88 +---- .../model/UpdateContinuousBackupsRequest.cpp | 20 +- .../model/UpdateContinuousBackupsResult.cpp | 15 +- .../UpdateContributorInsightsRequest.cpp | 30 +- .../model/UpdateContributorInsightsResult.cpp | 29 +- .../UpdateGlobalSecondaryIndexAction.cpp | 40 +-- .../source/model/UpdateGlobalTableRequest.cpp | 24 +- .../source/model/UpdateGlobalTableResult.cpp | 19 +- .../UpdateGlobalTableSettingsRequest.cpp | 50 +-- .../model/UpdateGlobalTableSettingsResult.cpp | 22 +- .../source/model/UpdateItemRequest.cpp | 87 +---- .../source/model/UpdateItemResult.cpp | 30 +- .../UpdateKinesisStreamingConfiguration.cpp | 19 +- ...dateKinesisStreamingDestinationRequest.cpp | 24 +- ...pdateKinesisStreamingDestinationResult.cpp | 27 +- .../UpdateReplicationGroupMemberAction.cpp | 65 +--- .../UpdateTableReplicaAutoScalingRequest.cpp | 38 +-- .../UpdateTableReplicaAutoScalingResult.cpp | 15 +- .../source/model/UpdateTableRequest.cpp | 104 +----- .../source/model/UpdateTableResult.cpp | 19 +- .../source/model/UpdateTimeToLiveRequest.cpp | 20 +- .../source/model/UpdateTimeToLiveResult.cpp | 19 +- .../model/VectorAttributeDefinition.cpp | 16 +- .../source/model/VectorCapacity.cpp | 24 +- .../source/model/VectorDistanceFunction.cpp | 2 - .../source/model/VectorIndex.cpp | 63 +--- .../source/model/VectorIndexDescription.cpp | 103 +----- .../source/model/VectorIndexInfo.cpp | 63 +--- .../source/model/VectorIndexUpdate.cpp | 24 +- .../source/model/WarmThroughput.cpp | 24 +- .../source/model/WitnessStatus.cpp | 2 - .../source/model/WriteRequest.cpp | 24 +- 313 files changed, 1295 insertions(+), 8509 deletions(-) diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/AttributeValueUpdate.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/AttributeValueUpdate.h index 4c36909afd9..ddb2a3752eb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/AttributeValueUpdate.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/AttributeValueUpdate.h @@ -22,14 +22,13 @@ namespace Model { /** *

                  For the UpdateItem operation, represents the attributes to be - * modified, the action to perform on each, and the new value for each.

                  - *

                  You cannot use UpdateItem to update any primary key attributes. + * modified, the action to perform on each, and the new value for each.

                  You + * cannot use UpdateItem to update any primary key attributes. * Instead, you will need to delete the item, and then use PutItem to - * create a new item with new attributes.

                  Attribute values cannot be - * null; string and binary type attributes must have lengths greater than zero; and - * set type attributes must not be empty. Requests with empty values will be - * rejected with a ValidationException exception.

                  See - * Also:

                  Attribute values cannot be null; + * string and binary type attributes must have lengths greater than zero; and set + * type attributes must not be empty. Requests with empty values will be rejected + * with a ValidationException exception.

                  See Also:

                  AWS * API Reference

                  */ @@ -83,9 +82,9 @@ class AttributeValueUpdate { *
                • If the existing attribute is a number, and if Value is also * a number, then the Value is mathematically added to the existing * attribute. If Value is a negative number, then it is subtracted - * from the existing attribute.

                  If you use ADD to - * increment or decrement a number value for an item that doesn't exist before the - * update, DynamoDB uses 0 as the initial value.

                  In addition, if you use + * from the existing attribute.

                  If you use ADD to increment + * or decrement a number value for an item that doesn't exist before the update, + * DynamoDB uses 0 as the initial value.

                  In addition, if you use * ADD to update an existing item, and intend to increment or * decrement an attribute value which does not yet exist, DynamoDB uses * 0 as the initial value. For example, suppose that the item you want @@ -94,8 +93,8 @@ class AttributeValueUpdate { * though it currently does not exist. DynamoDB will create the itemcount * attribute, set its initial value to 0, and finally add * 3 to it. The result will be a new itemcount attribute in the - * item, with a value of 3.

                • If the existing - * data type is a set, and if the Value is also a set, then the + * item, with a value of 3.

                • If the existing data + * type is a set, and if the Value is also a set, then the * Value is added to the existing set. (This is a set * operation, not mathematical addition.) For example, if the attribute value was * the set [1,2], and the ADD action specified diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BatchGetItemRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BatchGetItemRequest.h index 63cfc2531aa..63178d8c953 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BatchGetItemRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BatchGetItemRequest.h @@ -71,8 +71,8 @@ class BatchGetItemRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

                  • *

                    #P = :val

                  Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

                  For more - * information about expression attribute names, see

                  For more information about + * expression attribute names, see Accessing * Item Attributes in the Amazon DynamoDB Developer Guide.

                • *
                • Keys - An array of primary key attribute values that diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BillingModeSummary.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BillingModeSummary.h index de6a5ea4e86..1540eaa2b57 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BillingModeSummary.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/BillingModeSummary.h @@ -25,8 +25,8 @@ namespace Model { * PROVISIONED and PAY_PER_REQUEST billing modes. For * more information about these modes, see Read/write - * capacity mode.

                  You may need to switch to on-demand mode at - * least once in order to return a BillingModeSummary response.

                  + * capacity mode.

                  You may need to switch to on-demand mode at least + * once in order to return a BillingModeSummary response.

                  *

                  See Also:

                  AWS * API Reference

                  diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/Condition.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/Condition.h index 0fa76b1c032..61f26410983 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/Condition.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/Condition.h @@ -89,7 +89,7 @@ class Condition { * than the one provided in the request, the value does not match. For example, * {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not equal {"NS":["6", "2", "1"]}.

                  - *

                • NE : Not equal. NE is supported + *

                • NE : Not equal. NE is supported * for all data types, including lists and maps.

                  * AttributeValueList can contain only one AttributeValue * of type String, Number, Binary, String Set, Number Set, or Binary Set. If an @@ -97,76 +97,76 @@ class Condition { * provided in the request, the value does not match. For example, * {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not equal {"NS":["6", "2", "1"]}.

                  - *

                • LE : Less than or equal.

                  + *

                • LE : Less than or equal.

                  * AttributeValueList can contain only one AttributeValue * element of type String, Number, or Binary (not a set type). If an item contains * an AttributeValue element of a different type than the one provided * in the request, the value does not match. For example, {"S":"6"} * does not equal {"N":"6"}. Also, {"N":"6"} does not - * compare to {"NS":["6", "2", "1"]}.

                • + * compare to {"NS":["6", "2", "1"]}.

                • * LT : Less than.

                  AttributeValueList can * contain only one AttributeValue of type String, Number, or Binary * (not a set type). If an item contains an AttributeValue element of * a different type than the one provided in the request, the value does not match. * For example, {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not compare to {"NS":["6", "2", - * "1"]}.

                • GE : Greater than or equal. - *

                  AttributeValueList can contain only one + * "1"]}.

                • GE : Greater than or + * equal.

                  AttributeValueList can contain only one * AttributeValue element of type String, Number, or Binary (not a set * type). If an item contains an AttributeValue element of a different * type than the one provided in the request, the value does not match. For * example, {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not compare to {"NS":["6", "2", - * "1"]}.

                • GT : Greater than.

                  - * AttributeValueList can contain only one AttributeValue - * element of type String, Number, or Binary (not a set type). If an item contains - * an AttributeValue element of a different type than the one provided - * in the request, the value does not match. For example, {"S":"6"} - * does not equal {"N":"6"}. Also, {"N":"6"} does not - * compare to {"NS":["6", "2", "1"]}.

                • - * NOT_NULL : The attribute exists. NOT_NULL is supported - * for all data types, including lists and maps.

                  This operator tests - * for the existence of an attribute, not its data type. If the data type of - * attribute "a" is null, and you evaluate it using - * NOT_NULL, the result is a Boolean true. This result is + * "1"]}.

                • GT : Greater than.

                  + *

                  AttributeValueList can contain only one + * AttributeValue element of type String, Number, or Binary (not a set + * type). If an item contains an AttributeValue element of a different + * type than the one provided in the request, the value does not match. For + * example, {"S":"6"} does not equal {"N":"6"}. Also, + * {"N":"6"} does not compare to {"NS":["6", "2", + * "1"]}.

                • NOT_NULL : The attribute + * exists. NOT_NULL is supported for all data types, including lists + * and maps.

                  This operator tests for the existence of an attribute, not its + * data type. If the data type of attribute "a" is null, and you + * evaluate it using NOT_NULL, the result is a Boolean + * true. This result is because the attribute "a" exists; + * its data type is not relevant to the NOT_NULL comparison + * operator.

                • NULL : The attribute does not exist. + * NULL is supported for all data types, including lists and maps.

                  + *

                  This operator tests for the nonexistence of an attribute, not its data type. + * If the data type of attribute "a" is null, and you evaluate it + * using NULL, the result is a Boolean false. This is * because the attribute "a" exists; its data type is not relevant to - * the NOT_NULL comparison operator.

                • - * NULL : The attribute does not exist. NULL is supported - * for all data types, including lists and maps.

                  This operator tests - * for the nonexistence of an attribute, not its data type. If the data type of - * attribute "a" is null, and you evaluate it using NULL, - * the result is a Boolean false. This is because the attribute - * "a" exists; its data type is not relevant to the NULL - * comparison operator.

                • CONTAINS : Checks - * for a subsequence, or value in a set.

                  AttributeValueList - * can contain only one AttributeValue element of type String, Number, - * or Binary (not a set type). If the target attribute of the comparison is of type - * String, then the operator checks for a substring match. If the target attribute - * of the comparison is of type Binary, then the operator looks for a subsequence - * of the target that matches the input. If the target attribute of the comparison - * is a set ("SS", "NS", or "BS"), then the - * operator evaluates to true if it finds an exact match with any member of the - * set.

                  CONTAINS is supported for lists: When evaluating "a CONTAINS - * b", "a" can be a list; however, "b" cannot be a - * set, a map, or a list.

                • NOT_CONTAINS : Checks for - * absence of a subsequence, or absence of a value in a set.

                  + * the NULL comparison operator.

                • + * CONTAINS : Checks for a subsequence, or value in a set.

                  * AttributeValueList can contain only one AttributeValue * element of type String, Number, or Binary (not a set type). If the target - * attribute of the comparison is a String, then the operator checks for the - * absence of a substring match. If the target attribute of the comparison is - * Binary, then the operator checks for the absence of a subsequence of the target - * that matches the input. If the target attribute of the comparison is a set - * ("SS", "NS", or "BS"), then the operator - * evaluates to true if it does not find an exact match with any member of - * the set.

                  NOT_CONTAINS is supported for lists: When evaluating "a - * NOT CONTAINS b", "a" can be a list; however, - * "b" cannot be a set, a map, or a list.

                • - * BEGINS_WITH : Checks for a prefix.

                  + * attribute of the comparison is of type String, then the operator checks for a + * substring match. If the target attribute of the comparison is of type Binary, + * then the operator looks for a subsequence of the target that matches the input. + * If the target attribute of the comparison is a set ("SS", + * "NS", or "BS"), then the operator evaluates to true if + * it finds an exact match with any member of the set.

                  CONTAINS is supported + * for lists: When evaluating "a CONTAINS b", "a" can be + * a list; however, "b" cannot be a set, a map, or a list.

                • + *
                • NOT_CONTAINS : Checks for absence of a subsequence, or + * absence of a value in a set.

                  AttributeValueList can contain + * only one AttributeValue element of type String, Number, or Binary + * (not a set type). If the target attribute of the comparison is a String, then + * the operator checks for the absence of a substring match. If the target + * attribute of the comparison is Binary, then the operator checks for the absence + * of a subsequence of the target that matches the input. If the target attribute + * of the comparison is a set ("SS", "NS", or + * "BS"), then the operator evaluates to true if it does not + * find an exact match with any member of the set.

                  NOT_CONTAINS is supported + * for lists: When evaluating "a NOT CONTAINS b", "a" can + * be a list; however, "b" cannot be a set, a map, or a list.

                  + *
                • BEGINS_WITH : Checks for a prefix.

                  * AttributeValueList can contain only one AttributeValue * of type String or Binary (not a Number or a set type). The target attribute of * the comparison must be of type String or Binary (not a Number or a set - * type).

                • IN : Checks for matching elements in - * a list.

                  AttributeValueList can contain one or more + * type).

                • IN : Checks for matching elements + * in a list.

                  AttributeValueList can contain one or more * AttributeValue elements of type String, Number, or Binary. These * attributes are compared against an existing attribute of an item. If any * elements of the input are equal to the item attribute, the expression evaluates diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/CreateTableRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/CreateTableRequest.h index 93941f9b955..a7249348935 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/CreateTableRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/CreateTableRequest.h @@ -109,18 +109,18 @@ class CreateTableRequest : public DynamoDBRequest { * AttributeName - The name of this key attribute.

                • * KeyType - The role that the key attribute will assume:

                    *
                  • HASH - partition key

                  • RANGE - * - sort key

                The partition key of an item is - * also known as its hash attribute. The term "hash attribute" derives from - * the DynamoDB usage of an internal hash function to evenly distribute data items + * - sort key

            The partition key of an item is also + * known as its hash attribute. The term "hash attribute" derives from the + * DynamoDB usage of an internal hash function to evenly distribute data items * across partitions, based on their partition key values.

            The sort key of * an item is also known as its range attribute. The term "range attribute" * derives from the way DynamoDB stores items with the same partition key - * physically close together, in sorted order by the sort key value.

            - *

            For a simple primary key (partition key), you must provide exactly one - * element with a KeyType of HASH.

            For a composite - * primary key (partition key and sort key), you must provide exactly two elements, - * in this order: The first element must have a KeyType of - * HASH, and the second element must have a KeyType of + * physically close together, in sorted order by the sort key value.

            For a + * simple primary key (partition key), you must provide exactly one element with a + * KeyType of HASH.

            For a composite primary key + * (partition key and sort key), you must provide exactly two elements, in this + * order: The first element must have a KeyType of HASH, + * and the second element must have a KeyType of * RANGE.

            For more information, see Working * with Tables in the Amazon DynamoDB Developer Guide.

            @@ -152,7 +152,7 @@ class CreateTableRequest : public DynamoDBRequest { * size limit per partition key value; otherwise, the size of a local secondary * index is unconstrained.

            Each local secondary index in the array includes * the following:

            • IndexName - The name of the local - * secondary index. Must be unique only for this table.

            • + * secondary index. Must be unique only for this table.

            • * KeySchema - Specifies the key schema for the local secondary index. * The key schema must begin with the same partition key as the table.

            • *
            • Projection - Specifies attributes that are copied @@ -200,8 +200,8 @@ class CreateTableRequest : public DynamoDBRequest { *

              One or more global secondary indexes (the maximum is 20) to be created on the * table. Each global secondary index in the array includes the following:

                *
              • IndexName - The name of the global secondary index. Must - * be unique only for this table.

              • KeySchema - - * Specifies the key schema for the global secondary index. Each global secondary + * be unique only for this table.

              • KeySchema + * - Specifies the key schema for the global secondary index. Each global secondary * index supports up to 4 partition keys and up to 4 sort keys.

              • * Projection - Specifies attributes that are copied (projected) from * the table into the index. These are in addition to the primary key attributes diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DeleteItemRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DeleteItemRequest.h index 173eed9821f..cd741a27d4d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DeleteItemRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DeleteItemRequest.h @@ -207,9 +207,9 @@ class DeleteItemRequest : public DynamoDBRequest { * following:

                • Functions: attribute_exists | * attribute_not_exists | attribute_type | contains | begins_with | size *

                  These function names are case-sensitive.

                • Comparison - * operators: = | <> | < | > | <= | >= | BETWEEN | IN - *

                • Logical operators: AND | OR | NOT

                  - *

                For more information about condition expressions, see = | <> | < | > | <= | >= | BETWEEN | IN

              • + *

                Logical operators: AND | OR | NOT

              For more + * information about condition expressions, see Condition * Expressions in the Amazon DynamoDB Developer Guide.

              */ @@ -248,8 +248,8 @@ class DeleteItemRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

              • *

                #P = :val

              Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

              For more - * information on expression attribute names, see

              For more information on + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

              */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DescribeTimeToLiveResult.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DescribeTimeToLiveResult.h index c36f3b93835..65a049f5d75 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DescribeTimeToLiveResult.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/DescribeTimeToLiveResult.h @@ -30,7 +30,7 @@ class DescribeTimeToLiveResult { ///@{ /** - *

              + *

              */ inline const TimeToLiveDescription& GetTimeToLiveDescription() const { return m_timeToLiveDescription; } template diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExpectedAttributeValue.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExpectedAttributeValue.h index b8d87bb236e..ebf4776fd34 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExpectedAttributeValue.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExpectedAttributeValue.h @@ -123,7 +123,7 @@ class ExpectedAttributeValue { * than the one provided in the request, the value does not match. For example, * {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not equal {"NS":["6", "2", "1"]}.

              - *

            • NE : Not equal. NE is supported + *

            • NE : Not equal. NE is supported * for all data types, including lists and maps.

              * AttributeValueList can contain only one AttributeValue * of type String, Number, Binary, String Set, Number Set, or Binary Set. If an @@ -131,76 +131,76 @@ class ExpectedAttributeValue { * provided in the request, the value does not match. For example, * {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not equal {"NS":["6", "2", "1"]}.

              - *

            • LE : Less than or equal.

              + *

            • LE : Less than or equal.

              * AttributeValueList can contain only one AttributeValue * element of type String, Number, or Binary (not a set type). If an item contains * an AttributeValue element of a different type than the one provided * in the request, the value does not match. For example, {"S":"6"} * does not equal {"N":"6"}. Also, {"N":"6"} does not - * compare to {"NS":["6", "2", "1"]}.

            • + * compare to {"NS":["6", "2", "1"]}.

            • * LT : Less than.

              AttributeValueList can * contain only one AttributeValue of type String, Number, or Binary * (not a set type). If an item contains an AttributeValue element of * a different type than the one provided in the request, the value does not match. * For example, {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not compare to {"NS":["6", "2", - * "1"]}.

            • GE : Greater than or equal. - *

              AttributeValueList can contain only one + * "1"]}.

            • GE : Greater than or + * equal.

              AttributeValueList can contain only one * AttributeValue element of type String, Number, or Binary (not a set * type). If an item contains an AttributeValue element of a different * type than the one provided in the request, the value does not match. For * example, {"S":"6"} does not equal {"N":"6"}. Also, * {"N":"6"} does not compare to {"NS":["6", "2", - * "1"]}.

            • GT : Greater than.

              - * AttributeValueList can contain only one AttributeValue - * element of type String, Number, or Binary (not a set type). If an item contains - * an AttributeValue element of a different type than the one provided - * in the request, the value does not match. For example, {"S":"6"} - * does not equal {"N":"6"}. Also, {"N":"6"} does not - * compare to {"NS":["6", "2", "1"]}.

            • - * NOT_NULL : The attribute exists. NOT_NULL is supported - * for all data types, including lists and maps.

              This operator tests - * for the existence of an attribute, not its data type. If the data type of - * attribute "a" is null, and you evaluate it using - * NOT_NULL, the result is a Boolean true. This result is + * "1"]}.

            • GT : Greater than.

              + *

              AttributeValueList can contain only one + * AttributeValue element of type String, Number, or Binary (not a set + * type). If an item contains an AttributeValue element of a different + * type than the one provided in the request, the value does not match. For + * example, {"S":"6"} does not equal {"N":"6"}. Also, + * {"N":"6"} does not compare to {"NS":["6", "2", + * "1"]}.

            • NOT_NULL : The attribute + * exists. NOT_NULL is supported for all data types, including lists + * and maps.

              This operator tests for the existence of an attribute, not its + * data type. If the data type of attribute "a" is null, and you + * evaluate it using NOT_NULL, the result is a Boolean + * true. This result is because the attribute "a" exists; + * its data type is not relevant to the NOT_NULL comparison + * operator.

            • NULL : The attribute does not exist. + * NULL is supported for all data types, including lists and maps.

              + *

              This operator tests for the nonexistence of an attribute, not its data type. + * If the data type of attribute "a" is null, and you evaluate it + * using NULL, the result is a Boolean false. This is * because the attribute "a" exists; its data type is not relevant to - * the NOT_NULL comparison operator.

            • - * NULL : The attribute does not exist. NULL is supported - * for all data types, including lists and maps.

              This operator tests - * for the nonexistence of an attribute, not its data type. If the data type of - * attribute "a" is null, and you evaluate it using NULL, - * the result is a Boolean false. This is because the attribute - * "a" exists; its data type is not relevant to the NULL - * comparison operator.

            • CONTAINS : Checks - * for a subsequence, or value in a set.

              AttributeValueList - * can contain only one AttributeValue element of type String, Number, - * or Binary (not a set type). If the target attribute of the comparison is of type - * String, then the operator checks for a substring match. If the target attribute - * of the comparison is of type Binary, then the operator looks for a subsequence - * of the target that matches the input. If the target attribute of the comparison - * is a set ("SS", "NS", or "BS"), then the - * operator evaluates to true if it finds an exact match with any member of the - * set.

              CONTAINS is supported for lists: When evaluating "a CONTAINS - * b", "a" can be a list; however, "b" cannot be a - * set, a map, or a list.

            • NOT_CONTAINS : Checks for - * absence of a subsequence, or absence of a value in a set.

              + * the NULL comparison operator.

            • + * CONTAINS : Checks for a subsequence, or value in a set.

              * AttributeValueList can contain only one AttributeValue * element of type String, Number, or Binary (not a set type). If the target - * attribute of the comparison is a String, then the operator checks for the - * absence of a substring match. If the target attribute of the comparison is - * Binary, then the operator checks for the absence of a subsequence of the target - * that matches the input. If the target attribute of the comparison is a set - * ("SS", "NS", or "BS"), then the operator - * evaluates to true if it does not find an exact match with any member of - * the set.

              NOT_CONTAINS is supported for lists: When evaluating "a - * NOT CONTAINS b", "a" can be a list; however, - * "b" cannot be a set, a map, or a list.

            • - * BEGINS_WITH : Checks for a prefix.

              + * attribute of the comparison is of type String, then the operator checks for a + * substring match. If the target attribute of the comparison is of type Binary, + * then the operator looks for a subsequence of the target that matches the input. + * If the target attribute of the comparison is a set ("SS", + * "NS", or "BS"), then the operator evaluates to true if + * it finds an exact match with any member of the set.

              CONTAINS is supported + * for lists: When evaluating "a CONTAINS b", "a" can be + * a list; however, "b" cannot be a set, a map, or a list.

            • + *
            • NOT_CONTAINS : Checks for absence of a subsequence, or + * absence of a value in a set.

              AttributeValueList can contain + * only one AttributeValue element of type String, Number, or Binary + * (not a set type). If the target attribute of the comparison is a String, then + * the operator checks for the absence of a substring match. If the target + * attribute of the comparison is Binary, then the operator checks for the absence + * of a subsequence of the target that matches the input. If the target attribute + * of the comparison is a set ("SS", "NS", or + * "BS"), then the operator evaluates to true if it does not + * find an exact match with any member of the set.

              NOT_CONTAINS is supported + * for lists: When evaluating "a NOT CONTAINS b", "a" can + * be a list; however, "b" cannot be a set, a map, or a list.

              + *
            • BEGINS_WITH : Checks for a prefix.

              * AttributeValueList can contain only one AttributeValue * of type String or Binary (not a Number or a set type). The target attribute of * the comparison must be of type String or Binary (not a Number or a set - * type).

            • IN : Checks for matching elements in - * a list.

              AttributeValueList can contain one or more + * type).

            • IN : Checks for matching elements + * in a list.

              AttributeValueList can contain one or more * AttributeValue elements of type String, Number, or Binary. These * attributes are compared against an existing attribute of an item. If any * elements of the input are equal to the item attribute, the expression evaluates diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExportTableToPointInTimeRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExportTableToPointInTimeRequest.h index 82047c06783..0908672fbbe 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExportTableToPointInTimeRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ExportTableToPointInTimeRequest.h @@ -126,8 +126,8 @@ class ExportTableToPointInTimeRequest : public DynamoDBRequest { ///@{ /** *

              The ID of the Amazon Web Services account that owns the bucket the export - * will be stored in.

              S3BucketOwner is a required parameter when - * exporting to a S3 bucket in another account.

              + * will be stored in.

              S3BucketOwner is a required parameter when exporting + * to a S3 bucket in another account.

              */ inline const Aws::String& GetS3BucketOwner() const { return m_s3BucketOwner; } inline bool S3BucketOwnerHasBeenSet() const { return m_s3BucketOwnerHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GetItemRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GetItemRequest.h index d8b3b2e9444..afedb29cc25 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GetItemRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GetItemRequest.h @@ -195,8 +195,8 @@ class GetItemRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

              • *

                #P = :val

              Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

              For more - * information on expression attribute names, see

              For more information on + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

              */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GlobalSecondaryIndexDescription.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GlobalSecondaryIndexDescription.h index 4d52dec3920..194e58e3ac5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GlobalSecondaryIndexDescription.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/GlobalSecondaryIndexDescription.h @@ -142,9 +142,9 @@ class GlobalSecondaryIndexDescription { * when IndexStatus is set to CREATING and Backfilling is * true. You can't delete the index that is being created when * IndexStatus is set to CREATING and Backfilling is - * false.

              For indexes that were created during a - * CreateTable operation, the Backfilling attribute does - * not appear in the DescribeTable output.

              + * false.

              For indexes that were created during a CreateTable + * operation, the Backfilling attribute does not appear in the + * DescribeTable output.

              */ inline bool GetBackfilling() const { return m_backfilling; } inline bool BackfillingHasBeenSet() const { return m_backfillingHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/KeysAndAttributes.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/KeysAndAttributes.h index 3baaa577acc..685e4897bec 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/KeysAndAttributes.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/KeysAndAttributes.h @@ -28,7 +28,7 @@ namespace Model { * all of the key attributes. For example, with a simple primary key, you * only need to provide the partition key. For a composite primary key, you must * provide both the partition key and the sort key.

              See Also:

              - * AWS * API Reference

              */ @@ -155,8 +155,8 @@ class KeysAndAttributes { * then use this substitution in an expression, as in this example:

              • *

                #P = :val

              Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

              For more - * information on expression attribute names, see

              For more information on + * expression attribute names, see Accessing * Item Attributes in the Amazon DynamoDB Developer Guide.

              */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndex.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndex.h index 536b55a935e..8474f3b4e7c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndex.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndex.h @@ -59,13 +59,13 @@ class LocalSecondaryIndex { *

              The complete key schema for the local secondary index, consisting of one or * more pairs of attribute names and key types:

              • HASH * - partition key

              • RANGE - sort key

              - *

              The partition key of an item is also known as its hash - * attribute. The term "hash attribute" derives from DynamoDB's usage of an - * internal hash function to evenly distribute data items across partitions, based - * on their partition key values.

              The sort key of an item is also known as - * its range attribute. The term "range attribute" derives from the way - * DynamoDB stores items with the same partition key physically close together, in - * sorted order by the sort key value.

              + *

              The partition key of an item is also known as its hash attribute. The + * term "hash attribute" derives from DynamoDB's usage of an internal hash function + * to evenly distribute data items across partitions, based on their partition key + * values.

              The sort key of an item is also known as its range + * attribute. The term "range attribute" derives from the way DynamoDB stores + * items with the same partition key physically close together, in sorted order by + * the sort key value.

              */ inline const Aws::Vector& GetKeySchema() const { return m_keySchema; } inline bool KeySchemaHasBeenSet() const { return m_keySchemaHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexDescription.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexDescription.h index e3f65385e00..98e47e72693 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexDescription.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexDescription.h @@ -58,13 +58,13 @@ class LocalSecondaryIndexDescription { *

              The complete key schema for the local secondary index, consisting of one or * more pairs of attribute names and key types:

              • HASH * - partition key

              • RANGE - sort key

              - *

              The partition key of an item is also known as its hash - * attribute. The term "hash attribute" derives from DynamoDB's usage of an - * internal hash function to evenly distribute data items across partitions, based - * on their partition key values.

              The sort key of an item is also known as - * its range attribute. The term "range attribute" derives from the way - * DynamoDB stores items with the same partition key physically close together, in - * sorted order by the sort key value.

              + *

              The partition key of an item is also known as its hash attribute. The + * term "hash attribute" derives from DynamoDB's usage of an internal hash function + * to evenly distribute data items across partitions, based on their partition key + * values.

              The sort key of an item is also known as its range + * attribute. The term "range attribute" derives from the way DynamoDB stores + * items with the same partition key physically close together, in sorted order by + * the sort key value.

              */ inline const Aws::Vector& GetKeySchema() const { return m_keySchema; } inline bool KeySchemaHasBeenSet() const { return m_keySchemaHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexInfo.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexInfo.h index e3e57344b28..8aca34ec6ac 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexInfo.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/LocalSecondaryIndexInfo.h @@ -58,13 +58,13 @@ class LocalSecondaryIndexInfo { *

              The complete key schema for a local secondary index, which consists of one or * more pairs of attribute names and key types:

              • HASH * - partition key

              • RANGE - sort key

              - *

              The partition key of an item is also known as its hash - * attribute. The term "hash attribute" derives from DynamoDB's usage of an - * internal hash function to evenly distribute data items across partitions, based - * on their partition key values.

              The sort key of an item is also known as - * its range attribute. The term "range attribute" derives from the way - * DynamoDB stores items with the same partition key physically close together, in - * sorted order by the sort key value.

              + *

              The partition key of an item is also known as its hash attribute. The + * term "hash attribute" derives from DynamoDB's usage of an internal hash function + * to evenly distribute data items across partitions, based on their partition key + * values.

              The sort key of an item is also known as its range + * attribute. The term "range attribute" derives from the way DynamoDB stores + * items with the same partition key physically close together, in sorted order by + * the sort key value.

              */ inline const Aws::Vector& GetKeySchema() const { return m_keySchema; } inline bool KeySchemaHasBeenSet() const { return m_keySchemaHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutItemRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutItemRequest.h index d1ebc15d43a..16deaad5746 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutItemRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutItemRequest.h @@ -226,9 +226,9 @@ class PutItemRequest : public DynamoDBRequest { * of the following:

              • Functions: attribute_exists | * attribute_not_exists | attribute_type | contains | begins_with | size *

                These function names are case-sensitive.

              • Comparison - * operators: = | <> | < | > | <= | >= | BETWEEN | IN - *

              • Logical operators: AND | OR | NOT

                - *

              For more information on condition expressions, see = | <> | < | > | <= | >= | BETWEEN | IN

            • + *

              Logical operators: AND | OR | NOT

            For more + * information on condition expressions, see Condition * Expressions in the Amazon DynamoDB Developer Guide.

            */ @@ -267,8 +267,8 @@ class PutItemRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

            • *

              #P = :val

            Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

            For more - * information on expression attribute names, see

            For more information on + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

            */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutResourcePolicyRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutResourcePolicyRequest.h index 620bd3cbff5..29d000a94bd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutResourcePolicyRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/PutResourcePolicyRequest.h @@ -91,12 +91,12 @@ class PutResourcePolicyRequest : public DynamoDBRequest { /** *

            A string value that you can use to conditionally update your policy. You can * provide the revision ID of your existing policy to make mutating requests - * against that policy.

            When you provide an expected revision ID, if - * the revision ID of the existing policy on the resource doesn't match or if - * there's no policy attached to the resource, your request will be rejected with a - * PolicyNotFoundException.

            To conditionally attach a - * policy when no policy exists for the resource, specify NO_POLICY - * for the revision ID.

            + * against that policy.

            When you provide an expected revision ID, if the + * revision ID of the existing policy on the resource doesn't match or if there's + * no policy attached to the resource, your request will be rejected with a + * PolicyNotFoundException.

            To conditionally attach a policy + * when no policy exists for the resource, specify NO_POLICY for the + * revision ID.

            */ inline const Aws::String& GetExpectedRevisionId() const { return m_expectedRevisionId; } inline bool ExpectedRevisionIdHasBeenSet() const { return m_expectedRevisionIdHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/QueryRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/QueryRequest.h index d121e6a9596..a78827f823c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/QueryRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/QueryRequest.h @@ -122,10 +122,10 @@ class QueryRequest : public DynamoDBRequest { * single request, unless the value for Select is * SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying * ProjectionExpression without any value for - * Select.)

            If you use the - * ProjectionExpression parameter, then the value for - * Select can only be SPECIFIC_ATTRIBUTES. Any other - * value for Select will return an error.

            + * Select.)

            If you use the ProjectionExpression + * parameter, then the value for Select can only be + * SPECIFIC_ATTRIBUTES. Any other value for Select will + * return an error.

            */ inline Select GetSelect() const { return m_select; } inline bool SelectHasBeenSet() const { return m_selectHasBeenSet; } @@ -385,9 +385,9 @@ class QueryRequest : public DynamoDBRequest { * Query operation, but before the data is returned to you. Items that * do not satisfy the FilterExpression criteria are not returned.

            *

            A FilterExpression does not allow key attributes. You cannot - * define a filter expression based on a partition key or a sort key.

            - *

            A FilterExpression is applied after the items have already been - * read; the process of filtering does not consume any additional read capacity + * define a filter expression based on a partition key or a sort key.

            A + * FilterExpression is applied after the items have already been read; + * the process of filtering does not consume any additional read capacity * units.

            For more information, see Filter * Expressions in the Amazon DynamoDB Developer Guide.

            @@ -426,32 +426,32 @@ class QueryRequest : public DynamoDBRequest { * are as follows:

            • sortKeyName = * :sortkeyval - true if the sort key value is equal to * :sortkeyval.

            • sortKeyName - * < :sortkeyval - true if the sort key value is less + * < :sortkeyval - true if the sort key value is less * than :sortkeyval.

            • sortKeyName - * <= :sortkeyval - true if the sort key value is less + * <= :sortkeyval - true if the sort key value is less * than or equal to :sortkeyval.

            • - * sortKeyName > :sortkeyval - true if - * the sort key value is greater than :sortkeyval.

            • - * sortKeyName >= :sortkeyval - true if - * the sort key value is greater than or equal to :sortkeyval.

              - *
            • sortKeyName BETWEEN - * :sortkeyval1 AND :sortkeyval2 - true if - * the sort key value is greater than or equal to :sortkeyval1, and - * less than or equal to :sortkeyval2.

            • - * begins_with ( sortKeyName, :sortkeyval - * ) - true if the sort key value begins with a particular operand. - * (You cannot use this function with a sort key that is of type Number.) Note that - * the function name begins_with is case-sensitive.

            - *

            Use the ExpressionAttributeValues parameter to replace tokens - * such as :partitionval and :sortval with actual values - * at runtime.

            You can optionally use the - * ExpressionAttributeNames parameter to replace the names of the - * partition key and sort key with placeholder tokens. This option might be - * necessary if an attribute name conflicts with a DynamoDB reserved word. For - * example, the following KeyConditionExpression parameter causes an - * error because Size is a reserved word:

            • Size = - * :myval

            To work around this, define a placeholder - * (such a #S) to represent the attribute name Size. + * sortKeyName > :sortkeyval - true if the + * sort key value is greater than :sortkeyval.

          • + * sortKeyName >= :sortkeyval - true if the + * sort key value is greater than or equal to :sortkeyval.

          • + *
          • sortKeyName BETWEEN :sortkeyval1 + * AND :sortkeyval2 - true if the sort key value is + * greater than or equal to :sortkeyval1, and less than or equal to + * :sortkeyval2.

          • begins_with ( + * sortKeyName, :sortkeyval ) - true if the + * sort key value begins with a particular operand. (You cannot use this function + * with a sort key that is of type Number.) Note that the function name + * begins_with is case-sensitive.

          Use the + * ExpressionAttributeValues parameter to replace tokens such as + * :partitionval and :sortval with actual values at + * runtime.

          You can optionally use the ExpressionAttributeNames + * parameter to replace the names of the partition key and sort key with + * placeholder tokens. This option might be necessary if an attribute name + * conflicts with a DynamoDB reserved word. For example, the following + * KeyConditionExpression parameter causes an error because + * Size is a reserved word:

          • Size = :myval + *

          To work around this, define a placeholder (such a + * #S) to represent the attribute name Size. * KeyConditionExpression then is as follows:

          • * #S = :myval

          For a list of reserved words, see *

          Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

          For more - * information on expression attribute names, see

          For more information on + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

          */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaAutoScalingDescription.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaAutoScalingDescription.h index 91f8b9a49b7..a4d5a728122 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaAutoScalingDescription.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaAutoScalingDescription.h @@ -25,7 +25,7 @@ namespace Model { /** *

          Represents the auto scaling settings of the replica.

          See Also:

          - * AWS * API Reference

          */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaDescription.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaDescription.h index 73d84ef136d..09745133bc7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaDescription.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicaDescription.h @@ -66,14 +66,14 @@ class ReplicaDescription { * is being deleted.

        • ACTIVE - The replica is ready * for use.

        • REGION_DISABLED - The replica is * inaccessible because the Amazon Web Services Region has been disabled.

          - *

          If the Amazon Web Services Region remains inaccessible for more than - * 20 hours, DynamoDB will remove this replica from the replication group. The - * replica will not be deleted and replication will stop from and to this - * region.

        • INACCESSIBLE_ENCRYPTION_CREDENTIALS - * - The KMS key used to encrypt the table is inaccessible.

          - *

          If the KMS key remains inaccessible for more than 20 hours, DynamoDB will - * remove this replica from the replication group. The replica will not be deleted - * and replication will stop from and to this region.

        + *

        If the Amazon Web Services Region remains inaccessible for more than 20 + * hours, DynamoDB will remove this replica from the replication group. The replica + * will not be deleted and replication will stop from and to this region.

        + *
      • INACCESSIBLE_ENCRYPTION_CREDENTIALS - The KMS key + * used to encrypt the table is inaccessible.

        If the KMS key remains + * inaccessible for more than 20 hours, DynamoDB will remove this replica from the + * replication group. The replica will not be deleted and replication will stop + * from and to this region.

      */ inline ReplicaStatus GetReplicaStatus() const { return m_replicaStatus; } inline bool ReplicaStatusHasBeenSet() const { return m_replicaStatusHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicationGroupUpdate.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicationGroupUpdate.h index a87fc716056..8a55b828e26 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicationGroupUpdate.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ReplicationGroupUpdate.h @@ -29,10 +29,10 @@ namespace Model { * UpdateTable action in the destination Region.

    • An * existing replica to be deleted. The request invokes the * DeleteTableReplica action in the destination Region, deleting the - * replica and all if its items in the destination Region.

    - *

    When you manually remove a table or global table replica, you do not - * automatically remove any associated scalable targets, scaling policies, or - * CloudWatch alarms.

    See Also:

    When + * you manually remove a table or global table replica, you do not automatically + * remove any associated scalable targets, scaling policies, or CloudWatch + * alarms.

    See Also:

    AWS * API Reference

    */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ScanRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ScanRequest.h index 87db6bdd0a9..ec8157292db 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ScanRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/ScanRequest.h @@ -176,10 +176,10 @@ class ScanRequest : public DynamoDBRequest { * single request, unless the value for Select is * SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying * ProjectionExpression without any value for - * Select.)

    If you use the - * ProjectionExpression parameter, then the value for - * Select can only be SPECIFIC_ATTRIBUTES. Any other - * value for Select will return an error.

    + * Select.)

    If you use the ProjectionExpression + * parameter, then the value for Select can only be + * SPECIFIC_ATTRIBUTES. Any other value for Select will + * return an error.

    */ inline Select GetSelect() const { return m_select; } inline bool SelectHasBeenSet() const { return m_selectHasBeenSet; } @@ -366,9 +366,9 @@ class ScanRequest : public DynamoDBRequest { *

    A string that contains conditions that DynamoDB applies after the * Scan operation, but before the data is returned to you. Items that * do not satisfy the FilterExpression criteria are not returned.

    - *

    A FilterExpression is applied after the items have - * already been read; the process of filtering does not consume any additional read - * capacity units.

    For more information, see A FilterExpression is applied after the items have already been + * read; the process of filtering does not consume any additional read capacity + * units.

    For more information, see Filter * Expressions in the Amazon DynamoDB Developer Guide.

    */ @@ -407,8 +407,8 @@ class ScanRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

    • *

      #P = :val

    Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

    For more - * information on expression attribute names, see

    For more information on + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

    */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TableDescription.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TableDescription.h index a5f49a3863d..e9bd25872c3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TableDescription.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TableDescription.h @@ -105,14 +105,14 @@ class TableDescription { * consists of:

    • AttributeName - The name of the * attribute.

    • KeyType - The role of the * attribute:

      • HASH - partition key

      • - *

        RANGE - sort key

      The partition key of - * an item is also known as its hash attribute. The term "hash attribute" + *

      RANGE - sort key

    The partition key of an + * item is also known as its hash attribute. The term "hash attribute" * derives from DynamoDB's usage of an internal hash function to evenly distribute * data items across partitions, based on their partition key values.

    The * sort key of an item is also known as its range attribute. The term "range * attribute" derives from the way DynamoDB stores items with the same partition - * key physically close together, in sorted order by the sort key value.

    - *

    For more information about primary keys, see + *

    For more information about primary keys, see Primary * Key in the Amazon DynamoDB Developer Guide.

    */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TransactionCanceledException.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TransactionCanceledException.h index 57b659104a3..929cca46d6d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TransactionCanceledException.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/TransactionCanceledException.h @@ -67,38 +67,38 @@ namespace Model { * ProvisionedThroughputExceeded

  • Messages:

      *
    • The level of configured provisioned throughput for the table was * exceeded. Consider increasing your provisioning level with the UpdateTable - * API.

      This Message is received when provisioned throughput is - * exceeded is on a provisioned DynamoDB table.

    • The level - * of configured provisioned throughput for one or more global secondary indexes of - * the table was exceeded. Consider increasing your provisioning level for the - * under-provisioned global secondary indexes with the UpdateTable API.

      - *

      This message is returned when provisioned throughput is exceeded is on a - * provisioned GSI.

  • Throttling - * Error:

    • Code: ThrottlingError

    • - *

      Messages:

      • Throughput exceeds the current capacity of your - * table or index. DynamoDB is automatically scaling your table or index so please - * try again shortly. If exceptions persist, check if you have a hot key: + * API.

        This Message is received when provisioned throughput is exceeded is + * on a provisioned DynamoDB table.

      • The level of configured + * provisioned throughput for one or more global secondary indexes of the table was + * exceeded. Consider increasing your provisioning level for the under-provisioned + * global secondary indexes with the UpdateTable API.

        This message is + * returned when provisioned throughput is exceeded is on a provisioned GSI.

        + *
  • Throttling Error:

    • Code: + * ThrottlingError

    • Messages:

      • + *

        Throughput exceeds the current capacity of your table or index. DynamoDB is + * automatically scaling your table or index so please try again shortly. If + * exceptions persist, check if you have a hot key: * https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.

        - *

        This message is returned when writes get throttled on an On-Demand - * table as DynamoDB is automatically scaling the table.

      • - *

        Throughput exceeds the current capacity for one or more global secondary - * indexes. DynamoDB is automatically scaling your index so please try again - * shortly.

        This message is returned when writes get throttled on an - * On-Demand GSI as DynamoDB is automatically scaling the GSI.

      • - *
  • Validation Error:

    • Code: - * ValidationError

    • Messages:

      • One - * or more parameter values were invalid.

      • The update expression - * attempted to update the secondary index key beyond allowed size limits.

        - *
      • The update expression attempted to update the secondary index key - * to unsupported type.

      • An operand in the update expression has - * an incorrect data type.

      • Item size to update has exceeded the - * maximum allowed size.

      • Number overflow. Attempting to store a - * number with magnitude larger than supported range.

      • Type - * mismatch for attribute to update.

      • Nesting Levels have exceeded - * supported limits.

      • The document path provided in the update - * expression is invalid for update.

      • The provided expression - * refers to an attribute that does not exist in the item.

    • - *
  • See Also:

    This message is returned when writes get throttled on an On-Demand table as + * DynamoDB is automatically scaling the table.

  • Throughput + * exceeds the current capacity for one or more global secondary indexes. DynamoDB + * is automatically scaling your index so please try again shortly.

    This + * message is returned when writes get throttled on an On-Demand GSI as DynamoDB is + * automatically scaling the GSI.

  • + *

    Validation Error:

    • Code: ValidationError

      + *
    • Messages:

      • One or more parameter values were + * invalid.

      • The update expression attempted to update the + * secondary index key beyond allowed size limits.

      • The update + * expression attempted to update the secondary index key to unsupported type.

        + *
      • An operand in the update expression has an incorrect data + * type.

      • Item size to update has exceeded the maximum allowed + * size.

      • Number overflow. Attempting to store a number with + * magnitude larger than supported range.

      • Type mismatch for + * attribute to update.

      • Nesting Levels have exceeded supported + * limits.

      • The document path provided in the update expression is + * invalid for update.

      • The provided expression refers to an + * attribute that does not exist in the item.

  • + *

    See Also:

    AWS * API Reference

    */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateItemRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateItemRequest.h index e8c7c8d7903..67d8d49840c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateItemRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateItemRequest.h @@ -256,9 +256,9 @@ class UpdateItemRequest : public DynamoDBRequest { * the data type of the attribute:

    • If the existing attribute is a * number, and if Value is also a number, then Value is * mathematically added to the existing attribute. If Value is a - * negative number, then it is subtracted from the existing attribute.

      - *

      If you use ADD to increment or decrement a number value for an - * item that doesn't exist before the update, DynamoDB uses 0 as the + * negative number, then it is subtracted from the existing attribute.

      If + * you use ADD to increment or decrement a number value for an item + * that doesn't exist before the update, DynamoDB uses 0 as the * initial value.

      Similarly, if you use ADD for an existing * item to increment or decrement an attribute value that doesn't exist before the * update, DynamoDB uses 0 as the initial value. For example, suppose @@ -268,26 +268,25 @@ class UpdateItemRequest : public DynamoDBRequest { * itemcount attribute, set its initial value to 0, and * finally add 3 to it. The result will be a new * itemcount attribute in the item, with a value of - * 3.

    • If the existing data type is a set and - * if Value is also a set, then Value is added to the + * 3.

    • If the existing data type is a set and if + * Value is also a set, then Value is added to the * existing set. For example, if the attribute value is the set [1,2], * and the ADD action specified [3], then the final * attribute value is [1,2,3]. An error occurs if an ADD * action is specified for a set attribute and the attribute type specified does * not match the existing set type.

      Both sets must have the same primitive * data type. For example, if the existing data type is a set of strings, the - * Value must also be a set of strings.

    - *

    The ADD action only supports Number and set data types.

    - *
  • DELETE - Deletes an element from a - * set.

    If a set of values is specified, then those values are subtracted - * from the old set. For example, if the attribute value was the set - * [a,b,c] and the DELETE action specifies - * [a,c], then the final attribute value is [b]. - * Specifying an empty set is an error.

    The DELETE - * action only supports set data types.

  • You can - * have many actions in a single expression, such as the following: SET - * a=:value1, b=:value2 DELETE :value3, :value4, :value5

    For more - * information on update expressions, see Value must also be a set of strings.

    The + * ADD action only supports Number and set data types.

  • + *

    DELETE - Deletes an element from a set.

    If a set of + * values is specified, then those values are subtracted from the old set. For + * example, if the attribute value was the set [a,b,c] and the + * DELETE action specifies [a,c], then the final + * attribute value is [b]. Specifying an empty set is an error.

    + *

    The DELETE action only supports set data types.

  • + *

    You can have many actions in a single expression, such as the following: + * SET a=:value1, b=:value2 DELETE :value3, :value4, :value5

    + *

    For more information on update expressions, see Modifying * Items and Attributes in the Amazon DynamoDB Developer Guide.

    */ @@ -311,10 +310,10 @@ class UpdateItemRequest : public DynamoDBRequest { * succeed.

    An expression can contain any of the following:

    • *

      Functions: attribute_exists | attribute_not_exists | attribute_type | * contains | begins_with | size

      These function names are - * case-sensitive.

    • Comparison operators: = | <> | - * < | > | <= | >= | BETWEEN | IN

    • Logical - * operators: AND | OR | NOT

    For more information - * about condition expressions, see

  • Comparison operators: = | <> | < | > | + * <= | >= | BETWEEN | IN

  • Logical operators: AND + * | OR | NOT

  • For more information about condition + * expressions, see Specifying * Conditions in the Amazon DynamoDB Developer Guide.

    */ @@ -353,8 +352,8 @@ class UpdateItemRequest : public DynamoDBRequest { * then use this substitution in an expression, as in this example:

    • *

      #P = :val

    Tokens that begin with the * : character are expression attribute values, which are - * placeholders for the actual value at runtime.

    For more - * information about expression attribute names, see

    For more information about + * expression attribute names, see Specifying * Item Attributes in the Amazon DynamoDB Developer Guide.

    */ diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateTableRequest.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateTableRequest.h index 0d934177379..625f07afc5a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateTableRequest.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/model/UpdateTableRequest.h @@ -183,10 +183,10 @@ class UpdateTableRequest : public DynamoDBRequest { ///@{ /** - *

    Represents the DynamoDB Streams configuration for the table.

    - *

    You receive a ValidationException if you try to enable a stream - * on a table that already has a stream, or if you try to disable a stream on a - * table that doesn't have a stream.

    + *

    Represents the DynamoDB Streams configuration for the table.

    You + * receive a ValidationException if you try to enable a stream on a + * table that already has a stream, or if you try to disable a stream on a table + * that doesn't have a stream.

    */ inline const StreamSpecification& GetStreamSpecification() const { return m_streamSpecification; } inline bool StreamSpecificationHasBeenSet() const { return m_streamSpecificationHasBeenSet; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ApproximateCreationDateTimePrecision.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ApproximateCreationDateTimePrecision.cpp index 66b4bc6b584..2dc7315b9f7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ApproximateCreationDateTimePrecision.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ApproximateCreationDateTimePrecision.cpp @@ -30,7 +30,6 @@ ApproximateCreationDateTimePrecision GetApproximateCreationDateTimePrecisionForN overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ApproximateCreationDateTimePrecision::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForApproximateCreationDateTimePrecision(ApproximateCreationDa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ArchivalSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ArchivalSummary.cpp index 4a06f68b4bf..cdff3f640b7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ArchivalSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ArchivalSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { ArchivalSummary::ArchivalSummary(JsonView jsonValue) { *this = jsonValue; } -ArchivalSummary& ArchivalSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ArchivalDateTime")) { - m_archivalDateTime = jsonValue.GetDouble("ArchivalDateTime"); - m_archivalDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ArchivalReason")) { - m_archivalReason = jsonValue.GetString("ArchivalReason"); - m_archivalReasonHasBeenSet = true; - } - if (jsonValue.ValueExists("ArchivalBackupArn")) { - m_archivalBackupArn = jsonValue.GetString("ArchivalBackupArn"); - m_archivalBackupArnHasBeenSet = true; - } - return *this; -} +ArchivalSummary& ArchivalSummary::operator=(JsonView jsonValue) { return *this; } JsonValue ArchivalSummary::Jsonize() const { JsonValue payload; - - if (m_archivalDateTimeHasBeenSet) { - payload.WithDouble("ArchivalDateTime", m_archivalDateTime.SecondsWithMSPrecision()); - } - - if (m_archivalReasonHasBeenSet) { - payload.WithString("ArchivalReason", m_archivalReason); - } - - if (m_archivalBackupArnHasBeenSet) { - payload.WithString("ArchivalBackupArn", m_archivalBackupArn); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeAction.cpp index 1712899387f..0eadfaa551e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeAction.cpp @@ -33,7 +33,6 @@ AttributeAction GetAttributeActionForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return AttributeAction::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForAttributeAction(AttributeAction enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeDefinition.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeDefinition.cpp index dea782c110d..085e40a256f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeDefinition.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeDefinition.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { AttributeDefinition::AttributeDefinition(JsonView jsonValue) { *this = jsonValue; } -AttributeDefinition& AttributeDefinition::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("AttributeName")) { - m_attributeName = jsonValue.GetString("AttributeName"); - m_attributeNameHasBeenSet = true; - } - if (jsonValue.ValueExists("AttributeType")) { - m_attributeType = ScalarAttributeTypeMapper::GetScalarAttributeTypeForName(jsonValue.GetString("AttributeType")); - m_attributeTypeHasBeenSet = true; - } - return *this; -} +AttributeDefinition& AttributeDefinition::operator=(JsonView jsonValue) { return *this; } JsonValue AttributeDefinition::Jsonize() const { JsonValue payload; - - if (m_attributeNameHasBeenSet) { - payload.WithString("AttributeName", m_attributeName); - } - - if (m_attributeTypeHasBeenSet) { - payload.WithString("AttributeType", ScalarAttributeTypeMapper::GetNameForScalarAttributeType(m_attributeType)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeValueUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeValueUpdate.cpp index 362e924b56b..6a49f5d964c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeValueUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AttributeValueUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { AttributeValueUpdate::AttributeValueUpdate(JsonView jsonValue) { *this = jsonValue; } -AttributeValueUpdate& AttributeValueUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Value")) { - m_value = jsonValue.GetObject("Value"); - m_valueHasBeenSet = true; - } - if (jsonValue.ValueExists("Action")) { - m_action = AttributeActionMapper::GetAttributeActionForName(jsonValue.GetString("Action")); - m_actionHasBeenSet = true; - } - return *this; -} +AttributeValueUpdate& AttributeValueUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue AttributeValueUpdate::Jsonize() const { JsonValue payload; - - if (m_valueHasBeenSet) { - payload.WithObject("Value", m_value.Jsonize()); - } - - if (m_actionHasBeenSet) { - payload.WithString("Action", AttributeActionMapper::GetNameForAttributeAction(m_action)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyDescription.cpp index f0e3f062c5b..28e0ee07282 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { AutoScalingPolicyDescription::AutoScalingPolicyDescription(JsonView jsonValue) { *this = jsonValue; } -AutoScalingPolicyDescription& AutoScalingPolicyDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("PolicyName")) { - m_policyName = jsonValue.GetString("PolicyName"); - m_policyNameHasBeenSet = true; - } - if (jsonValue.ValueExists("TargetTrackingScalingPolicyConfiguration")) { - m_targetTrackingScalingPolicyConfiguration = jsonValue.GetObject("TargetTrackingScalingPolicyConfiguration"); - m_targetTrackingScalingPolicyConfigurationHasBeenSet = true; - } - return *this; -} +AutoScalingPolicyDescription& AutoScalingPolicyDescription::operator=(JsonView jsonValue) { return *this; } JsonValue AutoScalingPolicyDescription::Jsonize() const { JsonValue payload; - - if (m_policyNameHasBeenSet) { - payload.WithString("PolicyName", m_policyName); - } - - if (m_targetTrackingScalingPolicyConfigurationHasBeenSet) { - payload.WithObject("TargetTrackingScalingPolicyConfiguration", m_targetTrackingScalingPolicyConfiguration.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyUpdate.cpp index 1068ea454fb..7de4aeb9052 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingPolicyUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { AutoScalingPolicyUpdate::AutoScalingPolicyUpdate(JsonView jsonValue) { *this = jsonValue; } -AutoScalingPolicyUpdate& AutoScalingPolicyUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("PolicyName")) { - m_policyName = jsonValue.GetString("PolicyName"); - m_policyNameHasBeenSet = true; - } - if (jsonValue.ValueExists("TargetTrackingScalingPolicyConfiguration")) { - m_targetTrackingScalingPolicyConfiguration = jsonValue.GetObject("TargetTrackingScalingPolicyConfiguration"); - m_targetTrackingScalingPolicyConfigurationHasBeenSet = true; - } - return *this; -} +AutoScalingPolicyUpdate& AutoScalingPolicyUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue AutoScalingPolicyUpdate::Jsonize() const { JsonValue payload; - - if (m_policyNameHasBeenSet) { - payload.WithString("PolicyName", m_policyName); - } - - if (m_targetTrackingScalingPolicyConfigurationHasBeenSet) { - payload.WithObject("TargetTrackingScalingPolicyConfiguration", m_targetTrackingScalingPolicyConfiguration.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsDescription.cpp index 34355cfa213..480ea1d0f9d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,60 +20,10 @@ namespace Model { AutoScalingSettingsDescription::AutoScalingSettingsDescription(JsonView jsonValue) { *this = jsonValue; } -AutoScalingSettingsDescription& AutoScalingSettingsDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("MinimumUnits")) { - m_minimumUnits = jsonValue.GetInt64("MinimumUnits"); - m_minimumUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("MaximumUnits")) { - m_maximumUnits = jsonValue.GetInt64("MaximumUnits"); - m_maximumUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("AutoScalingDisabled")) { - m_autoScalingDisabled = jsonValue.GetBool("AutoScalingDisabled"); - m_autoScalingDisabledHasBeenSet = true; - } - if (jsonValue.ValueExists("AutoScalingRoleArn")) { - m_autoScalingRoleArn = jsonValue.GetString("AutoScalingRoleArn"); - m_autoScalingRoleArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ScalingPolicies")) { - Aws::Utils::Array scalingPoliciesJsonList = jsonValue.GetArray("ScalingPolicies"); - for (unsigned scalingPoliciesIndex = 0; scalingPoliciesIndex < scalingPoliciesJsonList.GetLength(); ++scalingPoliciesIndex) { - m_scalingPolicies.push_back(scalingPoliciesJsonList[scalingPoliciesIndex].AsObject()); - } - m_scalingPoliciesHasBeenSet = true; - } - return *this; -} +AutoScalingSettingsDescription& AutoScalingSettingsDescription::operator=(JsonView jsonValue) { return *this; } JsonValue AutoScalingSettingsDescription::Jsonize() const { JsonValue payload; - - if (m_minimumUnitsHasBeenSet) { - payload.WithInt64("MinimumUnits", m_minimumUnits); - } - - if (m_maximumUnitsHasBeenSet) { - payload.WithInt64("MaximumUnits", m_maximumUnits); - } - - if (m_autoScalingDisabledHasBeenSet) { - payload.WithBool("AutoScalingDisabled", m_autoScalingDisabled); - } - - if (m_autoScalingRoleArnHasBeenSet) { - payload.WithString("AutoScalingRoleArn", m_autoScalingRoleArn); - } - - if (m_scalingPoliciesHasBeenSet) { - Aws::Utils::Array scalingPoliciesJsonList(m_scalingPolicies.size()); - for (unsigned scalingPoliciesIndex = 0; scalingPoliciesIndex < scalingPoliciesJsonList.GetLength(); ++scalingPoliciesIndex) { - scalingPoliciesJsonList[scalingPoliciesIndex].AsObject(m_scalingPolicies[scalingPoliciesIndex].Jsonize()); - } - payload.WithArray("ScalingPolicies", std::move(scalingPoliciesJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsUpdate.cpp index cdb34fdab6a..853f4075b9e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingSettingsUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,53 +20,10 @@ namespace Model { AutoScalingSettingsUpdate::AutoScalingSettingsUpdate(JsonView jsonValue) { *this = jsonValue; } -AutoScalingSettingsUpdate& AutoScalingSettingsUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("MinimumUnits")) { - m_minimumUnits = jsonValue.GetInt64("MinimumUnits"); - m_minimumUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("MaximumUnits")) { - m_maximumUnits = jsonValue.GetInt64("MaximumUnits"); - m_maximumUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("AutoScalingDisabled")) { - m_autoScalingDisabled = jsonValue.GetBool("AutoScalingDisabled"); - m_autoScalingDisabledHasBeenSet = true; - } - if (jsonValue.ValueExists("AutoScalingRoleArn")) { - m_autoScalingRoleArn = jsonValue.GetString("AutoScalingRoleArn"); - m_autoScalingRoleArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ScalingPolicyUpdate")) { - m_scalingPolicyUpdate = jsonValue.GetObject("ScalingPolicyUpdate"); - m_scalingPolicyUpdateHasBeenSet = true; - } - return *this; -} +AutoScalingSettingsUpdate& AutoScalingSettingsUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue AutoScalingSettingsUpdate::Jsonize() const { JsonValue payload; - - if (m_minimumUnitsHasBeenSet) { - payload.WithInt64("MinimumUnits", m_minimumUnits); - } - - if (m_maximumUnitsHasBeenSet) { - payload.WithInt64("MaximumUnits", m_maximumUnits); - } - - if (m_autoScalingDisabledHasBeenSet) { - payload.WithBool("AutoScalingDisabled", m_autoScalingDisabled); - } - - if (m_autoScalingRoleArnHasBeenSet) { - payload.WithString("AutoScalingRoleArn", m_autoScalingRoleArn); - } - - if (m_scalingPolicyUpdateHasBeenSet) { - payload.WithObject("ScalingPolicyUpdate", m_scalingPolicyUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationDescription.cpp index 18156f51ea0..8d38dca485f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -22,44 +25,11 @@ AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTarge AutoScalingTargetTrackingScalingPolicyConfigurationDescription& AutoScalingTargetTrackingScalingPolicyConfigurationDescription::operator=( JsonView jsonValue) { - if (jsonValue.ValueExists("DisableScaleIn")) { - m_disableScaleIn = jsonValue.GetBool("DisableScaleIn"); - m_disableScaleInHasBeenSet = true; - } - if (jsonValue.ValueExists("ScaleInCooldown")) { - m_scaleInCooldown = jsonValue.GetInteger("ScaleInCooldown"); - m_scaleInCooldownHasBeenSet = true; - } - if (jsonValue.ValueExists("ScaleOutCooldown")) { - m_scaleOutCooldown = jsonValue.GetInteger("ScaleOutCooldown"); - m_scaleOutCooldownHasBeenSet = true; - } - if (jsonValue.ValueExists("TargetValue")) { - m_targetValue = jsonValue.GetDouble("TargetValue"); - m_targetValueHasBeenSet = true; - } return *this; } JsonValue AutoScalingTargetTrackingScalingPolicyConfigurationDescription::Jsonize() const { JsonValue payload; - - if (m_disableScaleInHasBeenSet) { - payload.WithBool("DisableScaleIn", m_disableScaleIn); - } - - if (m_scaleInCooldownHasBeenSet) { - payload.WithInteger("ScaleInCooldown", m_scaleInCooldown); - } - - if (m_scaleOutCooldownHasBeenSet) { - payload.WithInteger("ScaleOutCooldown", m_scaleOutCooldown); - } - - if (m_targetValueHasBeenSet) { - payload.WithDouble("TargetValue", m_targetValue); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.cpp index 80d0103a78c..2f251b256b9 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -21,44 +24,11 @@ AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrac AutoScalingTargetTrackingScalingPolicyConfigurationUpdate& AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::operator=( JsonView jsonValue) { - if (jsonValue.ValueExists("DisableScaleIn")) { - m_disableScaleIn = jsonValue.GetBool("DisableScaleIn"); - m_disableScaleInHasBeenSet = true; - } - if (jsonValue.ValueExists("ScaleInCooldown")) { - m_scaleInCooldown = jsonValue.GetInteger("ScaleInCooldown"); - m_scaleInCooldownHasBeenSet = true; - } - if (jsonValue.ValueExists("ScaleOutCooldown")) { - m_scaleOutCooldown = jsonValue.GetInteger("ScaleOutCooldown"); - m_scaleOutCooldownHasBeenSet = true; - } - if (jsonValue.ValueExists("TargetValue")) { - m_targetValue = jsonValue.GetDouble("TargetValue"); - m_targetValueHasBeenSet = true; - } return *this; } JsonValue AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::Jsonize() const { JsonValue payload; - - if (m_disableScaleInHasBeenSet) { - payload.WithBool("DisableScaleIn", m_disableScaleIn); - } - - if (m_scaleInCooldownHasBeenSet) { - payload.WithInteger("ScaleInCooldown", m_scaleInCooldown); - } - - if (m_scaleOutCooldownHasBeenSet) { - payload.WithInteger("ScaleOutCooldown", m_scaleOutCooldown); - } - - if (m_targetValueHasBeenSet) { - payload.WithDouble("TargetValue", m_targetValue); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDescription.cpp index 4aba991cbd2..7b4385e5601 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { BackupDescription::BackupDescription(JsonView jsonValue) { *this = jsonValue; } -BackupDescription& BackupDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("BackupDetails")) { - m_backupDetails = jsonValue.GetObject("BackupDetails"); - m_backupDetailsHasBeenSet = true; - } - if (jsonValue.ValueExists("SourceTableDetails")) { - m_sourceTableDetails = jsonValue.GetObject("SourceTableDetails"); - m_sourceTableDetailsHasBeenSet = true; - } - if (jsonValue.ValueExists("SourceTableFeatureDetails")) { - m_sourceTableFeatureDetails = jsonValue.GetObject("SourceTableFeatureDetails"); - m_sourceTableFeatureDetailsHasBeenSet = true; - } - return *this; -} +BackupDescription& BackupDescription::operator=(JsonView jsonValue) { return *this; } JsonValue BackupDescription::Jsonize() const { JsonValue payload; - - if (m_backupDetailsHasBeenSet) { - payload.WithObject("BackupDetails", m_backupDetails.Jsonize()); - } - - if (m_sourceTableDetailsHasBeenSet) { - payload.WithObject("SourceTableDetails", m_sourceTableDetails.Jsonize()); - } - - if (m_sourceTableFeatureDetailsHasBeenSet) { - payload.WithObject("SourceTableFeatureDetails", m_sourceTableFeatureDetails.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDetails.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDetails.cpp index 013db8ad2bb..0de396ae355 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDetails.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupDetails.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,69 +20,10 @@ namespace Model { BackupDetails::BackupDetails(JsonView jsonValue) { *this = jsonValue; } -BackupDetails& BackupDetails::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("BackupArn")) { - m_backupArn = jsonValue.GetString("BackupArn"); - m_backupArnHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupName")) { - m_backupName = jsonValue.GetString("BackupName"); - m_backupNameHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupSizeBytes")) { - m_backupSizeBytes = jsonValue.GetInt64("BackupSizeBytes"); - m_backupSizeBytesHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupStatus")) { - m_backupStatus = BackupStatusMapper::GetBackupStatusForName(jsonValue.GetString("BackupStatus")); - m_backupStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupType")) { - m_backupType = BackupTypeMapper::GetBackupTypeForName(jsonValue.GetString("BackupType")); - m_backupTypeHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupCreationDateTime")) { - m_backupCreationDateTime = jsonValue.GetDouble("BackupCreationDateTime"); - m_backupCreationDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupExpiryDateTime")) { - m_backupExpiryDateTime = jsonValue.GetDouble("BackupExpiryDateTime"); - m_backupExpiryDateTimeHasBeenSet = true; - } - return *this; -} +BackupDetails& BackupDetails::operator=(JsonView jsonValue) { return *this; } JsonValue BackupDetails::Jsonize() const { JsonValue payload; - - if (m_backupArnHasBeenSet) { - payload.WithString("BackupArn", m_backupArn); - } - - if (m_backupNameHasBeenSet) { - payload.WithString("BackupName", m_backupName); - } - - if (m_backupSizeBytesHasBeenSet) { - payload.WithInt64("BackupSizeBytes", m_backupSizeBytes); - } - - if (m_backupStatusHasBeenSet) { - payload.WithString("BackupStatus", BackupStatusMapper::GetNameForBackupStatus(m_backupStatus)); - } - - if (m_backupTypeHasBeenSet) { - payload.WithString("BackupType", BackupTypeMapper::GetNameForBackupType(m_backupType)); - } - - if (m_backupCreationDateTimeHasBeenSet) { - payload.WithDouble("BackupCreationDateTime", m_backupCreationDateTime.SecondsWithMSPrecision()); - } - - if (m_backupExpiryDateTimeHasBeenSet) { - payload.WithDouble("BackupExpiryDateTime", m_backupExpiryDateTime.SecondsWithMSPrecision()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupStatus.cpp index ab53e06c00d..3bb7e4ee609 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupStatus.cpp @@ -33,7 +33,6 @@ BackupStatus GetBackupStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BackupStatus::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForBackupStatus(BackupStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupSummary.cpp index 252db4385cd..da600da83b6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,93 +20,10 @@ namespace Model { BackupSummary::BackupSummary(JsonView jsonValue) { *this = jsonValue; } -BackupSummary& BackupSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("TableId")) { - m_tableId = jsonValue.GetString("TableId"); - m_tableIdHasBeenSet = true; - } - if (jsonValue.ValueExists("TableArn")) { - m_tableArn = jsonValue.GetString("TableArn"); - m_tableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupArn")) { - m_backupArn = jsonValue.GetString("BackupArn"); - m_backupArnHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupName")) { - m_backupName = jsonValue.GetString("BackupName"); - m_backupNameHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupCreationDateTime")) { - m_backupCreationDateTime = jsonValue.GetDouble("BackupCreationDateTime"); - m_backupCreationDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupExpiryDateTime")) { - m_backupExpiryDateTime = jsonValue.GetDouble("BackupExpiryDateTime"); - m_backupExpiryDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupStatus")) { - m_backupStatus = BackupStatusMapper::GetBackupStatusForName(jsonValue.GetString("BackupStatus")); - m_backupStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupType")) { - m_backupType = BackupTypeMapper::GetBackupTypeForName(jsonValue.GetString("BackupType")); - m_backupTypeHasBeenSet = true; - } - if (jsonValue.ValueExists("BackupSizeBytes")) { - m_backupSizeBytes = jsonValue.GetInt64("BackupSizeBytes"); - m_backupSizeBytesHasBeenSet = true; - } - return *this; -} +BackupSummary& BackupSummary::operator=(JsonView jsonValue) { return *this; } JsonValue BackupSummary::Jsonize() const { JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_tableIdHasBeenSet) { - payload.WithString("TableId", m_tableId); - } - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_backupArnHasBeenSet) { - payload.WithString("BackupArn", m_backupArn); - } - - if (m_backupNameHasBeenSet) { - payload.WithString("BackupName", m_backupName); - } - - if (m_backupCreationDateTimeHasBeenSet) { - payload.WithDouble("BackupCreationDateTime", m_backupCreationDateTime.SecondsWithMSPrecision()); - } - - if (m_backupExpiryDateTimeHasBeenSet) { - payload.WithDouble("BackupExpiryDateTime", m_backupExpiryDateTime.SecondsWithMSPrecision()); - } - - if (m_backupStatusHasBeenSet) { - payload.WithString("BackupStatus", BackupStatusMapper::GetNameForBackupStatus(m_backupStatus)); - } - - if (m_backupTypeHasBeenSet) { - payload.WithString("BackupType", BackupTypeMapper::GetNameForBackupType(m_backupType)); - } - - if (m_backupSizeBytesHasBeenSet) { - payload.WithInt64("BackupSizeBytes", m_backupSizeBytes); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupType.cpp index 8dc60924246..c1537097561 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupType.cpp @@ -33,7 +33,6 @@ BackupType GetBackupTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BackupType::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForBackupType(BackupType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupTypeFilter.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupTypeFilter.cpp index 18cf1f4a498..f75dad6c669 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupTypeFilter.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BackupTypeFilter.cpp @@ -36,7 +36,6 @@ BackupTypeFilter GetBackupTypeFilterForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BackupTypeFilter::NOT_SET; } @@ -57,7 +56,6 @@ Aws::String GetNameForBackupTypeFilter(BackupTypeFilter enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementRequest.cpp index 66067f09e95..87237bc09e1 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String BatchExecuteStatementRequest::SerializePayload() const { - JsonValue payload; - - if (m_statementsHasBeenSet) { - Aws::Utils::Array statementsJsonList(m_statements.size()); - for (unsigned statementsIndex = 0; statementsIndex < statementsJsonList.GetLength(); ++statementsIndex) { - statementsJsonList[statementsIndex].AsObject(m_statements[statementsIndex].Jsonize()); - } - payload.WithArray("Statements", std::move(statementsJsonList)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - return payload.View().WriteReadable(); -} +Aws::String BatchExecuteStatementRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection BatchExecuteStatementRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementResult.cpp index fcbe6f98c6b..f8667122ef6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchExecuteStatementResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,30 +20,4 @@ using namespace Aws; BatchExecuteStatementResult::BatchExecuteStatementResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -BatchExecuteStatementResult& BatchExecuteStatementResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Responses")) { - Aws::Utils::Array responsesJsonList = jsonValue.GetArray("Responses"); - for (unsigned responsesIndex = 0; responsesIndex < responsesJsonList.GetLength(); ++responsesIndex) { - m_responses.push_back(responsesJsonList[responsesIndex].AsObject()); - } - m_responsesHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - Aws::Utils::Array consumedCapacityJsonList = jsonValue.GetArray("ConsumedCapacity"); - for (unsigned consumedCapacityIndex = 0; consumedCapacityIndex < consumedCapacityJsonList.GetLength(); ++consumedCapacityIndex) { - m_consumedCapacity.push_back(consumedCapacityJsonList[consumedCapacityIndex].AsObject()); - } - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +BatchExecuteStatementResult& BatchExecuteStatementResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemRequest.cpp index a78b6ba0b35..6c3b0240ac6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String BatchGetItemRequest::SerializePayload() const { - JsonValue payload; - - if (m_requestItemsHasBeenSet) { - JsonValue requestItemsJsonMap; - for (auto& requestItemsItem : m_requestItems) { - requestItemsJsonMap.WithObject(requestItemsItem.first, requestItemsItem.second.Jsonize()); - } - payload.WithObject("RequestItems", std::move(requestItemsJsonMap)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - return payload.View().WriteReadable(); -} +Aws::String BatchGetItemRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection BatchGetItemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemResult.cpp index 393b12f4a76..1763adbedb4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchGetItemResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,48 +20,4 @@ using namespace Aws; BatchGetItemResult::BatchGetItemResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -BatchGetItemResult& BatchGetItemResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Responses")) { - Aws::Map responsesJsonMap = jsonValue.GetObject("Responses").GetAllObjects(); - for (auto& responsesItem : responsesJsonMap) { - Aws::Utils::Array itemList2JsonList = responsesItem.second.AsArray(); - Aws::Vector> itemList2List; - itemList2List.reserve((size_t)itemList2JsonList.GetLength()); - for (unsigned itemList2Index = 0; itemList2Index < itemList2JsonList.GetLength(); ++itemList2Index) { - Aws::Map attributeMap3JsonMap = itemList2JsonList[itemList2Index].GetAllObjects(); - Aws::Map attributeMap3Map; - for (auto& attributeMap3Item : attributeMap3JsonMap) { - attributeMap3Map[attributeMap3Item.first] = attributeMap3Item.second.AsObject(); - } - itemList2List.push_back(std::move(attributeMap3Map)); - } - m_responses[responsesItem.first] = std::move(itemList2List); - } - m_responsesHasBeenSet = true; - } - if (jsonValue.ValueExists("UnprocessedKeys")) { - Aws::Map unprocessedKeysJsonMap = jsonValue.GetObject("UnprocessedKeys").GetAllObjects(); - for (auto& unprocessedKeysItem : unprocessedKeysJsonMap) { - m_unprocessedKeys[unprocessedKeysItem.first] = unprocessedKeysItem.second.AsObject(); - } - m_unprocessedKeysHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - Aws::Utils::Array consumedCapacityJsonList = jsonValue.GetArray("ConsumedCapacity"); - for (unsigned consumedCapacityIndex = 0; consumedCapacityIndex < consumedCapacityJsonList.GetLength(); ++consumedCapacityIndex) { - m_consumedCapacity.push_back(consumedCapacityJsonList[consumedCapacityIndex].AsObject()); - } - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +BatchGetItemResult& BatchGetItemResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementError.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementError.cpp index bfc58b55089..88def7e2103 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementError.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementError.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,44 +20,10 @@ namespace Model { BatchStatementError::BatchStatementError(JsonView jsonValue) { *this = jsonValue; } -BatchStatementError& BatchStatementError::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Code")) { - m_code = BatchStatementErrorCodeEnumMapper::GetBatchStatementErrorCodeEnumForName(jsonValue.GetString("Code")); - m_codeHasBeenSet = true; - } - if (jsonValue.ValueExists("Message")) { - m_message = jsonValue.GetString("Message"); - m_messageHasBeenSet = true; - } - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - return *this; -} +BatchStatementError& BatchStatementError::operator=(JsonView jsonValue) { return *this; } JsonValue BatchStatementError::Jsonize() const { JsonValue payload; - - if (m_codeHasBeenSet) { - payload.WithString("Code", BatchStatementErrorCodeEnumMapper::GetNameForBatchStatementErrorCodeEnum(m_code)); - } - - if (m_messageHasBeenSet) { - payload.WithString("Message", m_message); - } - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementErrorCodeEnum.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementErrorCodeEnum.cpp index 8737a7bc8e9..17e12d0be38 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementErrorCodeEnum.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementErrorCodeEnum.cpp @@ -57,7 +57,6 @@ BatchStatementErrorCodeEnum GetBatchStatementErrorCodeEnumForName(const Aws::Str overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BatchStatementErrorCodeEnum::NOT_SET; } @@ -92,7 +91,6 @@ Aws::String GetNameForBatchStatementErrorCodeEnum(BatchStatementErrorCodeEnum en if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementRequest.cpp index bb96a31be64..5f30534e2a3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementRequest.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,55 +20,10 @@ namespace Model { BatchStatementRequest::BatchStatementRequest(JsonView jsonValue) { *this = jsonValue; } -BatchStatementRequest& BatchStatementRequest::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Statement")) { - m_statement = jsonValue.GetString("Statement"); - m_statementHasBeenSet = true; - } - if (jsonValue.ValueExists("Parameters")) { - Aws::Utils::Array parametersJsonList = jsonValue.GetArray("Parameters"); - for (unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { - m_parameters.push_back(parametersJsonList[parametersIndex].AsObject()); - } - m_parametersHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsistentRead")) { - m_consistentRead = jsonValue.GetBool("ConsistentRead"); - m_consistentReadHasBeenSet = true; - } - if (jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { - m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName( - jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); - m_returnValuesOnConditionCheckFailureHasBeenSet = true; - } - return *this; -} +BatchStatementRequest& BatchStatementRequest::operator=(JsonView jsonValue) { return *this; } JsonValue BatchStatementRequest::Jsonize() const { JsonValue payload; - - if (m_statementHasBeenSet) { - payload.WithString("Statement", m_statement); - } - - if (m_parametersHasBeenSet) { - Aws::Utils::Array parametersJsonList(m_parameters.size()); - for (unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { - parametersJsonList[parametersIndex].AsObject(m_parameters[parametersIndex].Jsonize()); - } - payload.WithArray("Parameters", std::move(parametersJsonList)); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementResponse.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementResponse.cpp index 75f5662b55d..05f6e82d940 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementResponse.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchStatementResponse.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,44 +20,10 @@ namespace Model { BatchStatementResponse::BatchStatementResponse(JsonView jsonValue) { *this = jsonValue; } -BatchStatementResponse& BatchStatementResponse::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Error")) { - m_error = jsonValue.GetObject("Error"); - m_errorHasBeenSet = true; - } - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - return *this; -} +BatchStatementResponse& BatchStatementResponse::operator=(JsonView jsonValue) { return *this; } JsonValue BatchStatementResponse::Jsonize() const { JsonValue payload; - - if (m_errorHasBeenSet) { - payload.WithObject("Error", m_error.Jsonize()); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemRequest.cpp index 9d5afbd995f..2167603d26d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemRequest.cpp @@ -3,41 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String BatchWriteItemRequest::SerializePayload() const { - JsonValue payload; - - if (m_requestItemsHasBeenSet) { - JsonValue requestItemsJsonMap; - for (auto& requestItemsItem : m_requestItems) { - Aws::Utils::Array writeRequestsJsonList(requestItemsItem.second.size()); - for (unsigned writeRequestsIndex = 0; writeRequestsIndex < writeRequestsJsonList.GetLength(); ++writeRequestsIndex) { - writeRequestsJsonList[writeRequestsIndex].AsObject(requestItemsItem.second[writeRequestsIndex].Jsonize()); - } - requestItemsJsonMap.WithArray(requestItemsItem.first, std::move(writeRequestsJsonList)); - } - payload.WithObject("RequestItems", std::move(requestItemsJsonMap)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_returnItemCollectionMetricsHasBeenSet) { - payload.WithString("ReturnItemCollectionMetrics", - ReturnItemCollectionMetricsMapper::GetNameForReturnItemCollectionMetrics(m_returnItemCollectionMetrics)); - } - - return payload.View().WriteReadable(); -} +Aws::String BatchWriteItemRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection BatchWriteItemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemResult.cpp index a66d3b611c1..d0bba156882 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BatchWriteItemResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,52 +20,4 @@ using namespace Aws; BatchWriteItemResult::BatchWriteItemResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -BatchWriteItemResult& BatchWriteItemResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("UnprocessedItems")) { - Aws::Map unprocessedItemsJsonMap = jsonValue.GetObject("UnprocessedItems").GetAllObjects(); - for (auto& unprocessedItemsItem : unprocessedItemsJsonMap) { - Aws::Utils::Array writeRequests2JsonList = unprocessedItemsItem.second.AsArray(); - Aws::Vector writeRequests2List; - writeRequests2List.reserve((size_t)writeRequests2JsonList.GetLength()); - for (unsigned writeRequests2Index = 0; writeRequests2Index < writeRequests2JsonList.GetLength(); ++writeRequests2Index) { - writeRequests2List.push_back(writeRequests2JsonList[writeRequests2Index].AsObject()); - } - m_unprocessedItems[unprocessedItemsItem.first] = std::move(writeRequests2List); - } - m_unprocessedItemsHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCollectionMetrics")) { - Aws::Map itemCollectionMetricsJsonMap = jsonValue.GetObject("ItemCollectionMetrics").GetAllObjects(); - for (auto& itemCollectionMetricsItem : itemCollectionMetricsJsonMap) { - Aws::Utils::Array itemCollectionMetricsMultiple2JsonList = itemCollectionMetricsItem.second.AsArray(); - Aws::Vector itemCollectionMetricsMultiple2List; - itemCollectionMetricsMultiple2List.reserve((size_t)itemCollectionMetricsMultiple2JsonList.GetLength()); - for (unsigned itemCollectionMetricsMultiple2Index = 0; - itemCollectionMetricsMultiple2Index < itemCollectionMetricsMultiple2JsonList.GetLength(); - ++itemCollectionMetricsMultiple2Index) { - itemCollectionMetricsMultiple2List.push_back( - itemCollectionMetricsMultiple2JsonList[itemCollectionMetricsMultiple2Index].AsObject()); - } - m_itemCollectionMetrics[itemCollectionMetricsItem.first] = std::move(itemCollectionMetricsMultiple2List); - } - m_itemCollectionMetricsHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - Aws::Utils::Array consumedCapacityJsonList = jsonValue.GetArray("ConsumedCapacity"); - for (unsigned consumedCapacityIndex = 0; consumedCapacityIndex < consumedCapacityJsonList.GetLength(); ++consumedCapacityIndex) { - m_consumedCapacity.push_back(consumedCapacityJsonList[consumedCapacityIndex].AsObject()); - } - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +BatchWriteItemResult& BatchWriteItemResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingMode.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingMode.cpp index 0e2baa1fdc3..d4fca19219b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingMode.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingMode.cpp @@ -30,7 +30,6 @@ BillingMode GetBillingModeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return BillingMode::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForBillingMode(BillingMode enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingModeSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingModeSummary.cpp index 16ec6c94abb..7bad7c890ee 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingModeSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/BillingModeSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { BillingModeSummary::BillingModeSummary(JsonView jsonValue) { *this = jsonValue; } -BillingModeSummary& BillingModeSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("BillingMode")) { - m_billingMode = BillingModeMapper::GetBillingModeForName(jsonValue.GetString("BillingMode")); - m_billingModeHasBeenSet = true; - } - if (jsonValue.ValueExists("LastUpdateToPayPerRequestDateTime")) { - m_lastUpdateToPayPerRequestDateTime = jsonValue.GetDouble("LastUpdateToPayPerRequestDateTime"); - m_lastUpdateToPayPerRequestDateTimeHasBeenSet = true; - } - return *this; -} +BillingModeSummary& BillingModeSummary::operator=(JsonView jsonValue) { return *this; } JsonValue BillingModeSummary::Jsonize() const { JsonValue payload; - - if (m_billingModeHasBeenSet) { - payload.WithString("BillingMode", BillingModeMapper::GetNameForBillingMode(m_billingMode)); - } - - if (m_lastUpdateToPayPerRequestDateTimeHasBeenSet) { - payload.WithDouble("LastUpdateToPayPerRequestDateTime", m_lastUpdateToPayPerRequestDateTime.SecondsWithMSPrecision()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CancellationReason.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CancellationReason.cpp index fb569c3d346..215eca7969b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CancellationReason.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CancellationReason.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,44 +20,10 @@ namespace Model { CancellationReason::CancellationReason(JsonView jsonValue) { *this = jsonValue; } -CancellationReason& CancellationReason::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - if (jsonValue.ValueExists("Code")) { - m_code = jsonValue.GetString("Code"); - m_codeHasBeenSet = true; - } - if (jsonValue.ValueExists("Message")) { - m_message = jsonValue.GetString("Message"); - m_messageHasBeenSet = true; - } - return *this; -} +CancellationReason& CancellationReason::operator=(JsonView jsonValue) { return *this; } JsonValue CancellationReason::Jsonize() const { JsonValue payload; - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - - if (m_codeHasBeenSet) { - payload.WithString("Code", m_code); - } - - if (m_messageHasBeenSet) { - payload.WithString("Message", m_message); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Capacity.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Capacity.cpp index e74406eb488..d330ad259b3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Capacity.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Capacity.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { Capacity::Capacity(JsonView jsonValue) { *this = jsonValue; } -Capacity& Capacity::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ReadCapacityUnits")) { - m_readCapacityUnits = jsonValue.GetDouble("ReadCapacityUnits"); - m_readCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("WriteCapacityUnits")) { - m_writeCapacityUnits = jsonValue.GetDouble("WriteCapacityUnits"); - m_writeCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("CapacityUnits")) { - m_capacityUnits = jsonValue.GetDouble("CapacityUnits"); - m_capacityUnitsHasBeenSet = true; - } - return *this; -} +Capacity& Capacity::operator=(JsonView jsonValue) { return *this; } JsonValue Capacity::Jsonize() const { JsonValue payload; - - if (m_readCapacityUnitsHasBeenSet) { - payload.WithDouble("ReadCapacityUnits", m_readCapacityUnits); - } - - if (m_writeCapacityUnitsHasBeenSet) { - payload.WithDouble("WriteCapacityUnits", m_writeCapacityUnits); - } - - if (m_capacityUnitsHasBeenSet) { - payload.WithDouble("CapacityUnits", m_capacityUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ComparisonOperator.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ComparisonOperator.cpp index fc2058d1d39..1f41ec6b424 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ComparisonOperator.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ComparisonOperator.cpp @@ -63,7 +63,6 @@ ComparisonOperator GetComparisonOperatorForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ComparisonOperator::NOT_SET; } @@ -102,7 +101,6 @@ Aws::String GetNameForComparisonOperator(ComparisonOperator enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Condition.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Condition.cpp index 914ab2da0b8..fb55ef107cc 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Condition.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Condition.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,38 +20,10 @@ namespace Model { Condition::Condition(JsonView jsonValue) { *this = jsonValue; } -Condition& Condition::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("AttributeValueList")) { - Aws::Utils::Array attributeValueListJsonList = jsonValue.GetArray("AttributeValueList"); - for (unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); - ++attributeValueListIndex) { - m_attributeValueList.push_back(attributeValueListJsonList[attributeValueListIndex].AsObject()); - } - m_attributeValueListHasBeenSet = true; - } - if (jsonValue.ValueExists("ComparisonOperator")) { - m_comparisonOperator = ComparisonOperatorMapper::GetComparisonOperatorForName(jsonValue.GetString("ComparisonOperator")); - m_comparisonOperatorHasBeenSet = true; - } - return *this; -} +Condition& Condition::operator=(JsonView jsonValue) { return *this; } JsonValue Condition::Jsonize() const { JsonValue payload; - - if (m_attributeValueListHasBeenSet) { - Aws::Utils::Array attributeValueListJsonList(m_attributeValueList.size()); - for (unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); - ++attributeValueListIndex) { - attributeValueListJsonList[attributeValueListIndex].AsObject(m_attributeValueList[attributeValueListIndex].Jsonize()); - } - payload.WithArray("AttributeValueList", std::move(attributeValueListJsonList)); - } - - if (m_comparisonOperatorHasBeenSet) { - payload.WithString("ComparisonOperator", ComparisonOperatorMapper::GetNameForComparisonOperator(m_comparisonOperator)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionCheck.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionCheck.cpp index 06efdf6164b..0818dca3d0b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionCheck.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionCheck.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,85 +20,10 @@ namespace Model { ConditionCheck::ConditionCheck(JsonView jsonValue) { *this = jsonValue; } -ConditionCheck& ConditionCheck::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Key")) { - Aws::Map keyJsonMap = jsonValue.GetObject("Key").GetAllObjects(); - for (auto& keyItem : keyJsonMap) { - m_key[keyItem.first] = keyItem.second.AsObject(); - } - m_keyHasBeenSet = true; - } - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ConditionExpression")) { - m_conditionExpression = jsonValue.GetString("ConditionExpression"); - m_conditionExpressionHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeNames")) { - Aws::Map expressionAttributeNamesJsonMap = jsonValue.GetObject("ExpressionAttributeNames").GetAllObjects(); - for (auto& expressionAttributeNamesItem : expressionAttributeNamesJsonMap) { - m_expressionAttributeNames[expressionAttributeNamesItem.first] = expressionAttributeNamesItem.second.AsString(); - } - m_expressionAttributeNamesHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeValues")) { - Aws::Map expressionAttributeValuesJsonMap = jsonValue.GetObject("ExpressionAttributeValues").GetAllObjects(); - for (auto& expressionAttributeValuesItem : expressionAttributeValuesJsonMap) { - m_expressionAttributeValues[expressionAttributeValuesItem.first] = expressionAttributeValuesItem.second.AsObject(); - } - m_expressionAttributeValuesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { - m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName( - jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); - m_returnValuesOnConditionCheckFailureHasBeenSet = true; - } - return *this; -} +ConditionCheck& ConditionCheck::operator=(JsonView jsonValue) { return *this; } JsonValue ConditionCheck::Jsonize() const { JsonValue payload; - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_conditionExpressionHasBeenSet) { - payload.WithString("ConditionExpression", m_conditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalCheckFailedException.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalCheckFailedException.cpp index be827460480..1bca59973d4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalCheckFailedException.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalCheckFailedException.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { ConditionalCheckFailedException::ConditionalCheckFailedException(JsonView jsonValue) { *this = jsonValue; } -ConditionalCheckFailedException& ConditionalCheckFailedException::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("message")) { - m_message = jsonValue.GetString("message"); - m_messageHasBeenSet = true; - } - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - return *this; -} +ConditionalCheckFailedException& ConditionalCheckFailedException::operator=(JsonView jsonValue) { return *this; } JsonValue ConditionalCheckFailedException::Jsonize() const { JsonValue payload; - - if (m_messageHasBeenSet) { - payload.WithString("message", m_message); - } - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalOperator.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalOperator.cpp index 606b4c1e891..bd60093ba70 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalOperator.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConditionalOperator.cpp @@ -30,7 +30,6 @@ ConditionalOperator GetConditionalOperatorForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ConditionalOperator::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForConditionalOperator(ConditionalOperator enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConsumedCapacity.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConsumedCapacity.cpp index e8d051ac407..8e69b82ad25 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ConsumedCapacity.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ConsumedCapacity.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,98 +20,10 @@ namespace Model { ConsumedCapacity::ConsumedCapacity(JsonView jsonValue) { *this = jsonValue; } -ConsumedCapacity& ConsumedCapacity::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("CapacityUnits")) { - m_capacityUnits = jsonValue.GetDouble("CapacityUnits"); - m_capacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReadCapacityUnits")) { - m_readCapacityUnits = jsonValue.GetDouble("ReadCapacityUnits"); - m_readCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("WriteCapacityUnits")) { - m_writeCapacityUnits = jsonValue.GetDouble("WriteCapacityUnits"); - m_writeCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("Table")) { - m_table = jsonValue.GetObject("Table"); - m_tableHasBeenSet = true; - } - if (jsonValue.ValueExists("LocalSecondaryIndexes")) { - Aws::Map localSecondaryIndexesJsonMap = jsonValue.GetObject("LocalSecondaryIndexes").GetAllObjects(); - for (auto& localSecondaryIndexesItem : localSecondaryIndexesJsonMap) { - m_localSecondaryIndexes[localSecondaryIndexesItem.first] = localSecondaryIndexesItem.second.AsObject(); - } - m_localSecondaryIndexesHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalSecondaryIndexes")) { - Aws::Map globalSecondaryIndexesJsonMap = jsonValue.GetObject("GlobalSecondaryIndexes").GetAllObjects(); - for (auto& globalSecondaryIndexesItem : globalSecondaryIndexesJsonMap) { - m_globalSecondaryIndexes[globalSecondaryIndexesItem.first] = globalSecondaryIndexesItem.second.AsObject(); - } - m_globalSecondaryIndexesHasBeenSet = true; - } - if (jsonValue.ValueExists("VectorIndexes")) { - Aws::Map vectorIndexesJsonMap = jsonValue.GetObject("VectorIndexes").GetAllObjects(); - for (auto& vectorIndexesItem : vectorIndexesJsonMap) { - m_vectorIndexes[vectorIndexesItem.first] = vectorIndexesItem.second.AsObject(); - } - m_vectorIndexesHasBeenSet = true; - } - return *this; -} +ConsumedCapacity& ConsumedCapacity::operator=(JsonView jsonValue) { return *this; } JsonValue ConsumedCapacity::Jsonize() const { JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_capacityUnitsHasBeenSet) { - payload.WithDouble("CapacityUnits", m_capacityUnits); - } - - if (m_readCapacityUnitsHasBeenSet) { - payload.WithDouble("ReadCapacityUnits", m_readCapacityUnits); - } - - if (m_writeCapacityUnitsHasBeenSet) { - payload.WithDouble("WriteCapacityUnits", m_writeCapacityUnits); - } - - if (m_tableHasBeenSet) { - payload.WithObject("Table", m_table.Jsonize()); - } - - if (m_localSecondaryIndexesHasBeenSet) { - JsonValue localSecondaryIndexesJsonMap; - for (auto& localSecondaryIndexesItem : m_localSecondaryIndexes) { - localSecondaryIndexesJsonMap.WithObject(localSecondaryIndexesItem.first, localSecondaryIndexesItem.second.Jsonize()); - } - payload.WithObject("LocalSecondaryIndexes", std::move(localSecondaryIndexesJsonMap)); - } - - if (m_globalSecondaryIndexesHasBeenSet) { - JsonValue globalSecondaryIndexesJsonMap; - for (auto& globalSecondaryIndexesItem : m_globalSecondaryIndexes) { - globalSecondaryIndexesJsonMap.WithObject(globalSecondaryIndexesItem.first, globalSecondaryIndexesItem.second.Jsonize()); - } - payload.WithObject("GlobalSecondaryIndexes", std::move(globalSecondaryIndexesJsonMap)); - } - - if (m_vectorIndexesHasBeenSet) { - JsonValue vectorIndexesJsonMap; - for (auto& vectorIndexesItem : m_vectorIndexes) { - vectorIndexesJsonMap.WithObject(vectorIndexesItem.first, vectorIndexesItem.second.Jsonize()); - } - payload.WithObject("VectorIndexes", std::move(vectorIndexesJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsDescription.cpp index 8b9c5de9e79..302cb10c375 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,31 +20,10 @@ namespace Model { ContinuousBackupsDescription::ContinuousBackupsDescription(JsonView jsonValue) { *this = jsonValue; } -ContinuousBackupsDescription& ContinuousBackupsDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ContinuousBackupsStatus")) { - m_continuousBackupsStatus = - ContinuousBackupsStatusMapper::GetContinuousBackupsStatusForName(jsonValue.GetString("ContinuousBackupsStatus")); - m_continuousBackupsStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("PointInTimeRecoveryDescription")) { - m_pointInTimeRecoveryDescription = jsonValue.GetObject("PointInTimeRecoveryDescription"); - m_pointInTimeRecoveryDescriptionHasBeenSet = true; - } - return *this; -} +ContinuousBackupsDescription& ContinuousBackupsDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ContinuousBackupsDescription::Jsonize() const { JsonValue payload; - - if (m_continuousBackupsStatusHasBeenSet) { - payload.WithString("ContinuousBackupsStatus", - ContinuousBackupsStatusMapper::GetNameForContinuousBackupsStatus(m_continuousBackupsStatus)); - } - - if (m_pointInTimeRecoveryDescriptionHasBeenSet) { - payload.WithObject("PointInTimeRecoveryDescription", m_pointInTimeRecoveryDescription.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsStatus.cpp index 61d2479eb5d..51d0e7c68dd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContinuousBackupsStatus.cpp @@ -30,7 +30,6 @@ ContinuousBackupsStatus GetContinuousBackupsStatusForName(const Aws::String& nam overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ContinuousBackupsStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForContinuousBackupsStatus(ContinuousBackupsStatus enumValue) if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsAction.cpp index 546cb99293c..c5795e289a6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsAction.cpp @@ -30,7 +30,6 @@ ContributorInsightsAction GetContributorInsightsActionForName(const Aws::String& overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ContributorInsightsAction::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForContributorInsightsAction(ContributorInsightsAction enumVa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsMode.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsMode.cpp index bbd601f70a0..5e75129864d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsMode.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsMode.cpp @@ -30,7 +30,6 @@ ContributorInsightsMode GetContributorInsightsModeForName(const Aws::String& nam overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ContributorInsightsMode::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForContributorInsightsMode(ContributorInsightsMode enumValue) if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsStatus.cpp index 1ce463d95fd..68c0047f88c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsStatus.cpp @@ -39,7 +39,6 @@ ContributorInsightsStatus GetContributorInsightsStatusForName(const Aws::String& overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ContributorInsightsStatus::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForContributorInsightsStatus(ContributorInsightsStatus enumVa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsSummary.cpp index 17a0950bc2c..7d006285b15 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ContributorInsightsSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,49 +20,10 @@ namespace Model { ContributorInsightsSummary::ContributorInsightsSummary(JsonView jsonValue) { *this = jsonValue; } -ContributorInsightsSummary& ContributorInsightsSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ContributorInsightsStatus")) { - m_contributorInsightsStatus = - ContributorInsightsStatusMapper::GetContributorInsightsStatusForName(jsonValue.GetString("ContributorInsightsStatus")); - m_contributorInsightsStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ContributorInsightsMode")) { - m_contributorInsightsMode = - ContributorInsightsModeMapper::GetContributorInsightsModeForName(jsonValue.GetString("ContributorInsightsMode")); - m_contributorInsightsModeHasBeenSet = true; - } - return *this; -} +ContributorInsightsSummary& ContributorInsightsSummary::operator=(JsonView jsonValue) { return *this; } JsonValue ContributorInsightsSummary::Jsonize() const { JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_contributorInsightsStatusHasBeenSet) { - payload.WithString("ContributorInsightsStatus", - ContributorInsightsStatusMapper::GetNameForContributorInsightsStatus(m_contributorInsightsStatus)); - } - - if (m_contributorInsightsModeHasBeenSet) { - payload.WithString("ContributorInsightsMode", - ContributorInsightsModeMapper::GetNameForContributorInsightsMode(m_contributorInsightsMode)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupRequest.cpp index d70d97a2308..2b2261bd71d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupRequest.cpp @@ -3,28 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String CreateBackupRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_backupNameHasBeenSet) { - payload.WithString("BackupName", m_backupName); - } - - return payload.View().WriteReadable(); -} +Aws::String CreateBackupRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection CreateBackupRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupResult.cpp index 8b61cae251c..786158eb0bb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateBackupResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; CreateBackupResult::CreateBackupResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CreateBackupResult& CreateBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("BackupDetails")) { - m_backupDetails = jsonValue.GetObject("BackupDetails"); - m_backupDetailsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CreateBackupResult& CreateBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalSecondaryIndexAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalSecondaryIndexAction.cpp index 3afed9a4eae..2cd95ce39f2 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalSecondaryIndexAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalSecondaryIndexAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,68 +20,10 @@ namespace Model { CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction(JsonView jsonValue) { *this = jsonValue; } -CreateGlobalSecondaryIndexAction& CreateGlobalSecondaryIndexAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughput")) { - m_provisionedThroughput = jsonValue.GetObject("ProvisionedThroughput"); - m_provisionedThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughput")) { - m_onDemandThroughput = jsonValue.GetObject("OnDemandThroughput"); - m_onDemandThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("WarmThroughput")) { - m_warmThroughput = jsonValue.GetObject("WarmThroughput"); - m_warmThroughputHasBeenSet = true; - } - return *this; -} +CreateGlobalSecondaryIndexAction& CreateGlobalSecondaryIndexAction::operator=(JsonView jsonValue) { return *this; } JsonValue CreateGlobalSecondaryIndexAction::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_provisionedThroughputHasBeenSet) { - payload.WithObject("ProvisionedThroughput", m_provisionedThroughput.Jsonize()); - } - - if (m_onDemandThroughputHasBeenSet) { - payload.WithObject("OnDemandThroughput", m_onDemandThroughput.Jsonize()); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableRequest.cpp index 1931215bba2..1a6993ede6f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String CreateGlobalTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_globalTableNameHasBeenSet) { - payload.WithString("GlobalTableName", m_globalTableName); - } - - if (m_replicationGroupHasBeenSet) { - Aws::Utils::Array replicationGroupJsonList(m_replicationGroup.size()); - for (unsigned replicationGroupIndex = 0; replicationGroupIndex < replicationGroupJsonList.GetLength(); ++replicationGroupIndex) { - replicationGroupJsonList[replicationGroupIndex].AsObject(m_replicationGroup[replicationGroupIndex].Jsonize()); - } - payload.WithArray("ReplicationGroup", std::move(replicationGroupJsonList)); - } - - return payload.View().WriteReadable(); -} +Aws::String CreateGlobalTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection CreateGlobalTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableResult.cpp index 638cdb93526..28b98491332 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; CreateGlobalTableResult::CreateGlobalTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CreateGlobalTableResult& CreateGlobalTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("GlobalTableDescription")) { - m_globalTableDescription = jsonValue.GetObject("GlobalTableDescription"); - m_globalTableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CreateGlobalTableResult& CreateGlobalTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableWitnessGroupMemberAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableWitnessGroupMemberAction.cpp index 658e98daa37..9286d66eb21 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableWitnessGroupMemberAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateGlobalTableWitnessGroupMemberAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { CreateGlobalTableWitnessGroupMemberAction::CreateGlobalTableWitnessGroupMemberAction(JsonView jsonValue) { *this = jsonValue; } -CreateGlobalTableWitnessGroupMemberAction& CreateGlobalTableWitnessGroupMemberAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +CreateGlobalTableWitnessGroupMemberAction& CreateGlobalTableWitnessGroupMemberAction::operator=(JsonView jsonValue) { return *this; } JsonValue CreateGlobalTableWitnessGroupMemberAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicaAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicaAction.cpp index 7a8a1a570a6..12b58fe4b0f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicaAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicaAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { CreateReplicaAction::CreateReplicaAction(JsonView jsonValue) { *this = jsonValue; } -CreateReplicaAction& CreateReplicaAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +CreateReplicaAction& CreateReplicaAction::operator=(JsonView jsonValue) { return *this; } JsonValue CreateReplicaAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicationGroupMemberAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicationGroupMemberAction.cpp index 3bf2ae1974c..7021711bd56 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicationGroupMemberAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateReplicationGroupMemberAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,70 +20,10 @@ namespace Model { CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction(JsonView jsonValue) { *this = jsonValue; } -CreateReplicationGroupMemberAction& CreateReplicationGroupMemberAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KMSMasterKeyId")) { - m_kMSMasterKeyId = jsonValue.GetString("KMSMasterKeyId"); - m_kMSMasterKeyIdHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughputOverride")) { - m_provisionedThroughputOverride = jsonValue.GetObject("ProvisionedThroughputOverride"); - m_provisionedThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughputOverride")) { - m_onDemandThroughputOverride = jsonValue.GetObject("OnDemandThroughputOverride"); - m_onDemandThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalSecondaryIndexes")) { - Aws::Utils::Array globalSecondaryIndexesJsonList = jsonValue.GetArray("GlobalSecondaryIndexes"); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - m_globalSecondaryIndexes.push_back(globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject()); - } - m_globalSecondaryIndexesHasBeenSet = true; - } - if (jsonValue.ValueExists("TableClassOverride")) { - m_tableClassOverride = TableClassMapper::GetTableClassForName(jsonValue.GetString("TableClassOverride")); - m_tableClassOverrideHasBeenSet = true; - } - return *this; -} +CreateReplicationGroupMemberAction& CreateReplicationGroupMemberAction::operator=(JsonView jsonValue) { return *this; } JsonValue CreateReplicationGroupMemberAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_kMSMasterKeyIdHasBeenSet) { - payload.WithString("KMSMasterKeyId", m_kMSMasterKeyId); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - - if (m_globalSecondaryIndexesHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexesJsonList(m_globalSecondaryIndexes.size()); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject(m_globalSecondaryIndexes[globalSecondaryIndexesIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexes", std::move(globalSecondaryIndexesJsonList)); - } - - if (m_tableClassOverrideHasBeenSet) { - payload.WithString("TableClassOverride", TableClassMapper::GetNameForTableClass(m_tableClassOverride)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableRequest.cpp index 8e0182308cf..3d495fee264 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableRequest.cpp @@ -3,121 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String CreateTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_attributeDefinitionsHasBeenSet) { - Aws::Utils::Array attributeDefinitionsJsonList(m_attributeDefinitions.size()); - for (unsigned attributeDefinitionsIndex = 0; attributeDefinitionsIndex < attributeDefinitionsJsonList.GetLength(); - ++attributeDefinitionsIndex) { - attributeDefinitionsJsonList[attributeDefinitionsIndex].AsObject(m_attributeDefinitions[attributeDefinitionsIndex].Jsonize()); - } - payload.WithArray("AttributeDefinitions", std::move(attributeDefinitionsJsonList)); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_localSecondaryIndexesHasBeenSet) { - Aws::Utils::Array localSecondaryIndexesJsonList(m_localSecondaryIndexes.size()); - for (unsigned localSecondaryIndexesIndex = 0; localSecondaryIndexesIndex < localSecondaryIndexesJsonList.GetLength(); - ++localSecondaryIndexesIndex) { - localSecondaryIndexesJsonList[localSecondaryIndexesIndex].AsObject(m_localSecondaryIndexes[localSecondaryIndexesIndex].Jsonize()); - } - payload.WithArray("LocalSecondaryIndexes", std::move(localSecondaryIndexesJsonList)); - } - - if (m_globalSecondaryIndexesHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexesJsonList(m_globalSecondaryIndexes.size()); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject(m_globalSecondaryIndexes[globalSecondaryIndexesIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexes", std::move(globalSecondaryIndexesJsonList)); - } - - if (m_billingModeHasBeenSet) { - payload.WithString("BillingMode", BillingModeMapper::GetNameForBillingMode(m_billingMode)); - } - - if (m_provisionedThroughputHasBeenSet) { - payload.WithObject("ProvisionedThroughput", m_provisionedThroughput.Jsonize()); - } - - if (m_streamSpecificationHasBeenSet) { - payload.WithObject("StreamSpecification", m_streamSpecification.Jsonize()); - } - - if (m_sSESpecificationHasBeenSet) { - payload.WithObject("SSESpecification", m_sSESpecification.Jsonize()); - } - - if (m_tagsHasBeenSet) { - Aws::Utils::Array tagsJsonList(m_tags.size()); - for (unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { - tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); - } - payload.WithArray("Tags", std::move(tagsJsonList)); - } - - if (m_tableClassHasBeenSet) { - payload.WithString("TableClass", TableClassMapper::GetNameForTableClass(m_tableClass)); - } - - if (m_deletionProtectionEnabledHasBeenSet) { - payload.WithBool("DeletionProtectionEnabled", m_deletionProtectionEnabled); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - - if (m_resourcePolicyHasBeenSet) { - payload.WithString("ResourcePolicy", m_resourcePolicy); - } - - if (m_onDemandThroughputHasBeenSet) { - payload.WithObject("OnDemandThroughput", m_onDemandThroughput.Jsonize()); - } - - if (m_globalTableSourceArnHasBeenSet) { - payload.WithString("GlobalTableSourceArn", m_globalTableSourceArn); - } - - if (m_globalTableSettingsReplicationModeHasBeenSet) { - payload.WithString( - "GlobalTableSettingsReplicationMode", - GlobalTableSettingsReplicationModeMapper::GetNameForGlobalTableSettingsReplicationMode(m_globalTableSettingsReplicationMode)); - } - - if (m_vectorIndexesHasBeenSet) { - Aws::Utils::Array vectorIndexesJsonList(m_vectorIndexes.size()); - for (unsigned vectorIndexesIndex = 0; vectorIndexesIndex < vectorIndexesJsonList.GetLength(); ++vectorIndexesIndex) { - vectorIndexesJsonList[vectorIndexesIndex].AsObject(m_vectorIndexes[vectorIndexesIndex].Jsonize()); - } - payload.WithArray("VectorIndexes", std::move(vectorIndexesJsonList)); - } - - return payload.View().WriteReadable(); -} +Aws::String CreateTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection CreateTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableResult.cpp index d1e0fa4b8b1..124d1710142 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; CreateTableResult::CreateTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -CreateTableResult& CreateTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableDescription")) { - m_tableDescription = jsonValue.GetObject("TableDescription"); - m_tableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +CreateTableResult& CreateTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateVectorIndexAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateVectorIndexAction.cpp index 662bf08b3b3..787cb2093cc 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateVectorIndexAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CreateVectorIndexAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,68 +20,10 @@ namespace Model { CreateVectorIndexAction::CreateVectorIndexAction(JsonView jsonValue) { *this = jsonValue; } -CreateVectorIndexAction& CreateVectorIndexAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("VectorAttribute")) { - m_vectorAttribute = jsonValue.GetObject("VectorAttribute"); - m_vectorAttributeHasBeenSet = true; - } - if (jsonValue.ValueExists("SearchSchema")) { - Aws::Utils::Array searchSchemaJsonList = jsonValue.GetArray("SearchSchema"); - for (unsigned searchSchemaIndex = 0; searchSchemaIndex < searchSchemaJsonList.GetLength(); ++searchSchemaIndex) { - m_searchSchema.push_back(searchSchemaJsonList[searchSchemaIndex].AsObject()); - } - m_searchSchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("Dimensions")) { - m_dimensions = jsonValue.GetInt64("Dimensions"); - m_dimensionsHasBeenSet = true; - } - if (jsonValue.ValueExists("DistanceFunction")) { - m_distanceFunction = VectorDistanceFunctionMapper::GetVectorDistanceFunctionForName(jsonValue.GetString("DistanceFunction")); - m_distanceFunctionHasBeenSet = true; - } - return *this; -} +CreateVectorIndexAction& CreateVectorIndexAction::operator=(JsonView jsonValue) { return *this; } JsonValue CreateVectorIndexAction::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_vectorAttributeHasBeenSet) { - payload.WithObject("VectorAttribute", m_vectorAttribute.Jsonize()); - } - - if (m_searchSchemaHasBeenSet) { - Aws::Utils::Array searchSchemaJsonList(m_searchSchema.size()); - for (unsigned searchSchemaIndex = 0; searchSchemaIndex < searchSchemaJsonList.GetLength(); ++searchSchemaIndex) { - searchSchemaJsonList[searchSchemaIndex].AsObject(m_searchSchema[searchSchemaIndex].Jsonize()); - } - payload.WithArray("SearchSchema", std::move(searchSchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_dimensionsHasBeenSet) { - payload.WithInt64("Dimensions", m_dimensions); - } - - if (m_distanceFunctionHasBeenSet) { - payload.WithString("DistanceFunction", VectorDistanceFunctionMapper::GetNameForVectorDistanceFunction(m_distanceFunction)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/CsvOptions.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/CsvOptions.cpp index da48ac64ac5..9b658fc3e66 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/CsvOptions.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/CsvOptions.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { CsvOptions::CsvOptions(JsonView jsonValue) { *this = jsonValue; } -CsvOptions& CsvOptions::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Delimiter")) { - m_delimiter = jsonValue.GetString("Delimiter"); - m_delimiterHasBeenSet = true; - } - if (jsonValue.ValueExists("HeaderList")) { - Aws::Utils::Array headerListJsonList = jsonValue.GetArray("HeaderList"); - for (unsigned headerListIndex = 0; headerListIndex < headerListJsonList.GetLength(); ++headerListIndex) { - m_headerList.push_back(headerListJsonList[headerListIndex].AsString()); - } - m_headerListHasBeenSet = true; - } - return *this; -} +CsvOptions& CsvOptions::operator=(JsonView jsonValue) { return *this; } JsonValue CsvOptions::Jsonize() const { JsonValue payload; - - if (m_delimiterHasBeenSet) { - payload.WithString("Delimiter", m_delimiter); - } - - if (m_headerListHasBeenSet) { - Aws::Utils::Array headerListJsonList(m_headerList.size()); - for (unsigned headerListIndex = 0; headerListIndex < headerListJsonList.GetLength(); ++headerListIndex) { - headerListJsonList[headerListIndex].AsString(m_headerList[headerListIndex]); - } - payload.WithArray("HeaderList", std::move(headerListJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Delete.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Delete.cpp index 409b3296687..a8dba54d00d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Delete.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Delete.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,85 +20,10 @@ namespace Model { Delete::Delete(JsonView jsonValue) { *this = jsonValue; } -Delete& Delete::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Key")) { - Aws::Map keyJsonMap = jsonValue.GetObject("Key").GetAllObjects(); - for (auto& keyItem : keyJsonMap) { - m_key[keyItem.first] = keyItem.second.AsObject(); - } - m_keyHasBeenSet = true; - } - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ConditionExpression")) { - m_conditionExpression = jsonValue.GetString("ConditionExpression"); - m_conditionExpressionHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeNames")) { - Aws::Map expressionAttributeNamesJsonMap = jsonValue.GetObject("ExpressionAttributeNames").GetAllObjects(); - for (auto& expressionAttributeNamesItem : expressionAttributeNamesJsonMap) { - m_expressionAttributeNames[expressionAttributeNamesItem.first] = expressionAttributeNamesItem.second.AsString(); - } - m_expressionAttributeNamesHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeValues")) { - Aws::Map expressionAttributeValuesJsonMap = jsonValue.GetObject("ExpressionAttributeValues").GetAllObjects(); - for (auto& expressionAttributeValuesItem : expressionAttributeValuesJsonMap) { - m_expressionAttributeValues[expressionAttributeValuesItem.first] = expressionAttributeValuesItem.second.AsObject(); - } - m_expressionAttributeValuesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { - m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName( - jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); - m_returnValuesOnConditionCheckFailureHasBeenSet = true; - } - return *this; -} +Delete& Delete::operator=(JsonView jsonValue) { return *this; } JsonValue Delete::Jsonize() const { JsonValue payload; - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_conditionExpressionHasBeenSet) { - payload.WithString("ConditionExpression", m_conditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupRequest.cpp index a33c4ee7d9b..85b5731cd44 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DeleteBackupRequest::SerializePayload() const { - JsonValue payload; - - if (m_backupArnHasBeenSet) { - payload.WithString("BackupArn", m_backupArn); - } - - return payload.View().WriteReadable(); -} +Aws::String DeleteBackupRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DeleteBackupRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupResult.cpp index f38dd255bee..d2771af5a68 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteBackupResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DeleteBackupResult::DeleteBackupResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteBackupResult& DeleteBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("BackupDescription")) { - m_backupDescription = jsonValue.GetObject("BackupDescription"); - m_backupDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteBackupResult& DeleteBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalSecondaryIndexAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalSecondaryIndexAction.cpp index b3e62e4d12a..55d9cb62610 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalSecondaryIndexAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalSecondaryIndexAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { DeleteGlobalSecondaryIndexAction::DeleteGlobalSecondaryIndexAction(JsonView jsonValue) { *this = jsonValue; } -DeleteGlobalSecondaryIndexAction& DeleteGlobalSecondaryIndexAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - return *this; -} +DeleteGlobalSecondaryIndexAction& DeleteGlobalSecondaryIndexAction::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteGlobalSecondaryIndexAction::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalTableWitnessGroupMemberAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalTableWitnessGroupMemberAction.cpp index 0a15568d80a..4a156fdf879 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalTableWitnessGroupMemberAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteGlobalTableWitnessGroupMemberAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { DeleteGlobalTableWitnessGroupMemberAction::DeleteGlobalTableWitnessGroupMemberAction(JsonView jsonValue) { *this = jsonValue; } -DeleteGlobalTableWitnessGroupMemberAction& DeleteGlobalTableWitnessGroupMemberAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +DeleteGlobalTableWitnessGroupMemberAction& DeleteGlobalTableWitnessGroupMemberAction::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteGlobalTableWitnessGroupMemberAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemRequest.cpp index ef1461eae53..3f1a95cb882 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemRequest.cpp @@ -3,83 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DeleteItemRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - - if (m_expectedHasBeenSet) { - JsonValue expectedJsonMap; - for (auto& expectedItem : m_expected) { - expectedJsonMap.WithObject(expectedItem.first, expectedItem.second.Jsonize()); - } - payload.WithObject("Expected", std::move(expectedJsonMap)); - } - - if (m_conditionalOperatorHasBeenSet) { - payload.WithString("ConditionalOperator", ConditionalOperatorMapper::GetNameForConditionalOperator(m_conditionalOperator)); - } - - if (m_returnValuesHasBeenSet) { - payload.WithString("ReturnValues", ReturnValueMapper::GetNameForReturnValue(m_returnValues)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_returnItemCollectionMetricsHasBeenSet) { - payload.WithString("ReturnItemCollectionMetrics", - ReturnItemCollectionMetricsMapper::GetNameForReturnItemCollectionMetrics(m_returnItemCollectionMetrics)); - } - - if (m_conditionExpressionHasBeenSet) { - payload.WithString("ConditionExpression", m_conditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - - return payload.View().WriteReadable(); -} +Aws::String DeleteItemRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DeleteItemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemResult.cpp index d5756f07277..41fdf350f7b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteItemResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,31 +20,4 @@ using namespace Aws; DeleteItemResult::DeleteItemResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteItemResult& DeleteItemResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Attributes")) { - Aws::Map attributesJsonMap = jsonValue.GetObject("Attributes").GetAllObjects(); - for (auto& attributesItem : attributesJsonMap) { - m_attributes[attributesItem.first] = attributesItem.second.AsObject(); - } - m_attributesHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCollectionMetrics")) { - m_itemCollectionMetrics = jsonValue.GetObject("ItemCollectionMetrics"); - m_itemCollectionMetricsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteItemResult& DeleteItemResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicaAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicaAction.cpp index ed88f5b0f09..0adfd21263d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicaAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicaAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { DeleteReplicaAction::DeleteReplicaAction(JsonView jsonValue) { *this = jsonValue; } -DeleteReplicaAction& DeleteReplicaAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +DeleteReplicaAction& DeleteReplicaAction::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteReplicaAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicationGroupMemberAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicationGroupMemberAction.cpp index 602a013ca30..b65828fc609 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicationGroupMemberAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteReplicationGroupMemberAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { DeleteReplicationGroupMemberAction::DeleteReplicationGroupMemberAction(JsonView jsonValue) { *this = jsonValue; } -DeleteReplicationGroupMemberAction& DeleteReplicationGroupMemberAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +DeleteReplicationGroupMemberAction& DeleteReplicationGroupMemberAction::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteReplicationGroupMemberAction::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteRequest.cpp index 467a4c9b811..bce51b90b7e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteRequest.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,28 +20,10 @@ namespace Model { DeleteRequest::DeleteRequest(JsonView jsonValue) { *this = jsonValue; } -DeleteRequest& DeleteRequest::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Key")) { - Aws::Map keyJsonMap = jsonValue.GetObject("Key").GetAllObjects(); - for (auto& keyItem : keyJsonMap) { - m_key[keyItem.first] = keyItem.second.AsObject(); - } - m_keyHasBeenSet = true; - } - return *this; -} +DeleteRequest& DeleteRequest::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteRequest::Jsonize() const { JsonValue payload; - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyRequest.cpp index 16f66d5294d..bffb9bfa7d1 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyRequest.cpp @@ -3,28 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DeleteResourcePolicyRequest::SerializePayload() const { - JsonValue payload; - - if (m_resourceArnHasBeenSet) { - payload.WithString("ResourceArn", m_resourceArn); - } - - if (m_expectedRevisionIdHasBeenSet) { - payload.WithString("ExpectedRevisionId", m_expectedRevisionId); - } - - return payload.View().WriteReadable(); -} +Aws::String DeleteResourcePolicyRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DeleteResourcePolicyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyResult.cpp index 12649711759..03baa026845 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteResourcePolicyResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DeleteResourcePolicyResult::DeleteResourcePolicyResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteResourcePolicyResult& DeleteResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("RevisionId")) { - m_revisionId = jsonValue.GetString("RevisionId"); - m_revisionIdHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteResourcePolicyResult& DeleteResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableRequest.cpp index 013bde863ce..3a4800c6e18 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DeleteTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DeleteTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DeleteTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableResult.cpp index 1c95e0e7320..9e5c44b24b1 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DeleteTableResult::DeleteTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DeleteTableResult& DeleteTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableDescription")) { - m_tableDescription = jsonValue.GetObject("TableDescription"); - m_tableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DeleteTableResult& DeleteTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteVectorIndexAction.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteVectorIndexAction.cpp index b09a42775bf..18a61d2962e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteVectorIndexAction.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DeleteVectorIndexAction.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { DeleteVectorIndexAction::DeleteVectorIndexAction(JsonView jsonValue) { *this = jsonValue; } -DeleteVectorIndexAction& DeleteVectorIndexAction::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - return *this; -} +DeleteVectorIndexAction& DeleteVectorIndexAction::operator=(JsonView jsonValue) { return *this; } JsonValue DeleteVectorIndexAction::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupRequest.cpp index 9794f8b8a67..88e047ef22a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeBackupRequest::SerializePayload() const { - JsonValue payload; - - if (m_backupArnHasBeenSet) { - payload.WithString("BackupArn", m_backupArn); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeBackupRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeBackupRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupResult.cpp index 46fd9fe1554..28a9f4d683e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeBackupResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeBackupResult::DescribeBackupResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeBackupResult& DescribeBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("BackupDescription")) { - m_backupDescription = jsonValue.GetObject("BackupDescription"); - m_backupDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeBackupResult& DescribeBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsRequest.cpp index 5b05f94c27a..5e44807d1a5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeContinuousBackupsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeContinuousBackupsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeContinuousBackupsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsResult.cpp index a8fe683af5a..1d3aa2e2973 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContinuousBackupsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -20,19 +21,5 @@ using namespace Aws; DescribeContinuousBackupsResult::DescribeContinuousBackupsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DescribeContinuousBackupsResult& DescribeContinuousBackupsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ContinuousBackupsDescription")) { - m_continuousBackupsDescription = jsonValue.GetObject("ContinuousBackupsDescription"); - m_continuousBackupsDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsRequest.cpp index aeafadf06c5..b76ebce3dfe 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsRequest.cpp @@ -3,28 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeContributorInsightsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeContributorInsightsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeContributorInsightsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsResult.cpp index f3dd6dd815f..d65e9591d78 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeContributorInsightsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -22,49 +23,5 @@ DescribeContributorInsightsResult::DescribeContributorInsightsResult(const Aws:: } DescribeContributorInsightsResult& DescribeContributorInsightsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ContributorInsightsRuleList")) { - Aws::Utils::Array contributorInsightsRuleListJsonList = jsonValue.GetArray("ContributorInsightsRuleList"); - for (unsigned contributorInsightsRuleListIndex = 0; contributorInsightsRuleListIndex < contributorInsightsRuleListJsonList.GetLength(); - ++contributorInsightsRuleListIndex) { - m_contributorInsightsRuleList.push_back(contributorInsightsRuleListJsonList[contributorInsightsRuleListIndex].AsString()); - } - m_contributorInsightsRuleListHasBeenSet = true; - } - if (jsonValue.ValueExists("ContributorInsightsStatus")) { - m_contributorInsightsStatus = - ContributorInsightsStatusMapper::GetContributorInsightsStatusForName(jsonValue.GetString("ContributorInsightsStatus")); - m_contributorInsightsStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("LastUpdateDateTime")) { - m_lastUpdateDateTime = jsonValue.GetDouble("LastUpdateDateTime"); - m_lastUpdateDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("FailureException")) { - m_failureException = jsonValue.GetObject("FailureException"); - m_failureExceptionHasBeenSet = true; - } - if (jsonValue.ValueExists("ContributorInsightsMode")) { - m_contributorInsightsMode = - ContributorInsightsModeMapper::GetContributorInsightsModeForName(jsonValue.GetString("ContributorInsightsMode")); - m_contributorInsightsModeHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsRequest.cpp index ca966bfb111..8d19b9c6a18 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsRequest.cpp @@ -3,9 +3,15 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsResult.cpp index 5d4d9d45ce5..24a65ea5853 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeEndpointsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,23 +20,4 @@ using namespace Aws; DescribeEndpointsResult::DescribeEndpointsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeEndpointsResult& DescribeEndpointsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Endpoints")) { - Aws::Utils::Array endpointsJsonList = jsonValue.GetArray("Endpoints"); - for (unsigned endpointsIndex = 0; endpointsIndex < endpointsJsonList.GetLength(); ++endpointsIndex) { - m_endpoints.push_back(endpointsJsonList[endpointsIndex].AsObject()); - } - m_endpointsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeEndpointsResult& DescribeEndpointsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportRequest.cpp index 24590ca7ab7..063360b99d8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeExportRequest::SerializePayload() const { - JsonValue payload; - - if (m_exportArnHasBeenSet) { - payload.WithString("ExportArn", m_exportArn); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeExportRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeExportRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportResult.cpp index 0d105bfb6bc..8371b02d293 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeExportResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeExportResult::DescribeExportResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeExportResult& DescribeExportResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ExportDescription")) { - m_exportDescription = jsonValue.GetObject("ExportDescription"); - m_exportDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeExportResult& DescribeExportResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableRequest.cpp index 55492519566..dd67f4382bb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeGlobalTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_globalTableNameHasBeenSet) { - payload.WithString("GlobalTableName", m_globalTableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeGlobalTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeGlobalTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableResult.cpp index ce2b9a99263..f56bb859d1e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeGlobalTableResult::DescribeGlobalTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeGlobalTableResult& DescribeGlobalTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("GlobalTableDescription")) { - m_globalTableDescription = jsonValue.GetObject("GlobalTableDescription"); - m_globalTableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeGlobalTableResult& DescribeGlobalTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsRequest.cpp index adccb280743..4580e0782ac 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeGlobalTableSettingsRequest::SerializePayload() const { - JsonValue payload; - - if (m_globalTableNameHasBeenSet) { - payload.WithString("GlobalTableName", m_globalTableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeGlobalTableSettingsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeGlobalTableSettingsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsResult.cpp index 75bfe5889be..009c576c4e4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeGlobalTableSettingsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -22,26 +23,5 @@ DescribeGlobalTableSettingsResult::DescribeGlobalTableSettingsResult(const Aws:: } DescribeGlobalTableSettingsResult& DescribeGlobalTableSettingsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("GlobalTableName")) { - m_globalTableName = jsonValue.GetString("GlobalTableName"); - m_globalTableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaSettings")) { - Aws::Utils::Array replicaSettingsJsonList = jsonValue.GetArray("ReplicaSettings"); - for (unsigned replicaSettingsIndex = 0; replicaSettingsIndex < replicaSettingsJsonList.GetLength(); ++replicaSettingsIndex) { - m_replicaSettings.push_back(replicaSettingsJsonList[replicaSettingsIndex].AsObject()); - } - m_replicaSettingsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportRequest.cpp index 930acf9fc97..3937d00b8a6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeImportRequest::SerializePayload() const { - JsonValue payload; - - if (m_importArnHasBeenSet) { - payload.WithString("ImportArn", m_importArn); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeImportRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeImportRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportResult.cpp index cf378948500..49f44fd48d8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeImportResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeImportResult::DescribeImportResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeImportResult& DescribeImportResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ImportTableDescription")) { - m_importTableDescription = jsonValue.GetObject("ImportTableDescription"); - m_importTableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeImportResult& DescribeImportResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationRequest.cpp index b59b5dc7055..aa9105cad6a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeKinesisStreamingDestinationRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeKinesisStreamingDestinationRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeKinesisStreamingDestinationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationResult.cpp index b9c56915bfc..898c745423c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeKinesisStreamingDestinationResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -23,27 +24,5 @@ DescribeKinesisStreamingDestinationResult::DescribeKinesisStreamingDestinationRe DescribeKinesisStreamingDestinationResult& DescribeKinesisStreamingDestinationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KinesisDataStreamDestinations")) { - Aws::Utils::Array kinesisDataStreamDestinationsJsonList = jsonValue.GetArray("KinesisDataStreamDestinations"); - for (unsigned kinesisDataStreamDestinationsIndex = 0; - kinesisDataStreamDestinationsIndex < kinesisDataStreamDestinationsJsonList.GetLength(); ++kinesisDataStreamDestinationsIndex) { - m_kinesisDataStreamDestinations.push_back(kinesisDataStreamDestinationsJsonList[kinesisDataStreamDestinationsIndex].AsObject()); - } - m_kinesisDataStreamDestinationsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsRequest.cpp index 6d526778477..cb0c934b23d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsRequest.cpp @@ -3,9 +3,15 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsResult.cpp index d72fe3de7c4..e2825eef88c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeLimitsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,32 +20,4 @@ using namespace Aws; DescribeLimitsResult::DescribeLimitsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeLimitsResult& DescribeLimitsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("AccountMaxReadCapacityUnits")) { - m_accountMaxReadCapacityUnits = jsonValue.GetInt64("AccountMaxReadCapacityUnits"); - m_accountMaxReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("AccountMaxWriteCapacityUnits")) { - m_accountMaxWriteCapacityUnits = jsonValue.GetInt64("AccountMaxWriteCapacityUnits"); - m_accountMaxWriteCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("TableMaxReadCapacityUnits")) { - m_tableMaxReadCapacityUnits = jsonValue.GetInt64("TableMaxReadCapacityUnits"); - m_tableMaxReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("TableMaxWriteCapacityUnits")) { - m_tableMaxWriteCapacityUnits = jsonValue.GetInt64("TableMaxWriteCapacityUnits"); - m_tableMaxWriteCapacityUnitsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeLimitsResult& DescribeLimitsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingRequest.cpp index ff7ef63a8c0..964850ca73b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeTableReplicaAutoScalingRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeTableReplicaAutoScalingRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeTableReplicaAutoScalingRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingResult.cpp index b79c504e67b..6d0703b7ada 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableReplicaAutoScalingResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -23,19 +24,5 @@ DescribeTableReplicaAutoScalingResult::DescribeTableReplicaAutoScalingResult(con DescribeTableReplicaAutoScalingResult& DescribeTableReplicaAutoScalingResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableAutoScalingDescription")) { - m_tableAutoScalingDescription = jsonValue.GetObject("TableAutoScalingDescription"); - m_tableAutoScalingDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableRequest.cpp index a056f2b5a32..5176a23ccf5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableResult.cpp index b8f75f76c94..ae36fcf3fcf 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeTableResult::DescribeTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeTableResult& DescribeTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Table")) { - m_table = jsonValue.GetObject("Table"); - m_tableHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeTableResult& DescribeTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveRequest.cpp index 3b260920bc5..d68a10c06d9 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DescribeTimeToLiveRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - return payload.View().WriteReadable(); -} +Aws::String DescribeTimeToLiveRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DescribeTimeToLiveRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveResult.cpp index a1a892299e2..98a2280584d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DescribeTimeToLiveResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; DescribeTimeToLiveResult::DescribeTimeToLiveResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -DescribeTimeToLiveResult& DescribeTimeToLiveResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TimeToLiveDescription")) { - m_timeToLiveDescription = jsonValue.GetObject("TimeToLiveDescription"); - m_timeToLiveDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +DescribeTimeToLiveResult& DescribeTimeToLiveResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DestinationStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DestinationStatus.cpp index bbe1ae197b2..51fdf847654 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DestinationStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DestinationStatus.cpp @@ -42,7 +42,6 @@ DestinationStatus GetDestinationStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return DestinationStatus::NOT_SET; } @@ -67,7 +66,6 @@ Aws::String GetNameForDestinationStatus(DestinationStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationRequest.cpp index 37feffedda0..21644f14fbe 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String DisableKinesisStreamingDestinationRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_streamArnHasBeenSet) { - payload.WithString("StreamArn", m_streamArn); - } - - if (m_enableKinesisStreamingConfigurationHasBeenSet) { - payload.WithObject("EnableKinesisStreamingConfiguration", m_enableKinesisStreamingConfiguration.Jsonize()); - } - - return payload.View().WriteReadable(); -} +Aws::String DisableKinesisStreamingDestinationRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection DisableKinesisStreamingDestinationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationResult.cpp index 2b6ea235016..587630aa78a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/DisableKinesisStreamingDestinationResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -23,31 +24,5 @@ DisableKinesisStreamingDestinationResult::DisableKinesisStreamingDestinationResu DisableKinesisStreamingDestinationResult& DisableKinesisStreamingDestinationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("StreamArn")) { - m_streamArn = jsonValue.GetString("StreamArn"); - m_streamArnHasBeenSet = true; - } - if (jsonValue.ValueExists("DestinationStatus")) { - m_destinationStatus = DestinationStatusMapper::GetDestinationStatusForName(jsonValue.GetString("DestinationStatus")); - m_destinationStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("EnableKinesisStreamingConfiguration")) { - m_enableKinesisStreamingConfiguration = jsonValue.GetObject("EnableKinesisStreamingConfiguration"); - m_enableKinesisStreamingConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingConfiguration.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingConfiguration.cpp index 035db50f956..1df9d157a47 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingConfiguration.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingConfiguration.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,24 +20,10 @@ namespace Model { EnableKinesisStreamingConfiguration::EnableKinesisStreamingConfiguration(JsonView jsonValue) { *this = jsonValue; } -EnableKinesisStreamingConfiguration& EnableKinesisStreamingConfiguration::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ApproximateCreationDateTimePrecision")) { - m_approximateCreationDateTimePrecision = ApproximateCreationDateTimePrecisionMapper::GetApproximateCreationDateTimePrecisionForName( - jsonValue.GetString("ApproximateCreationDateTimePrecision")); - m_approximateCreationDateTimePrecisionHasBeenSet = true; - } - return *this; -} +EnableKinesisStreamingConfiguration& EnableKinesisStreamingConfiguration::operator=(JsonView jsonValue) { return *this; } JsonValue EnableKinesisStreamingConfiguration::Jsonize() const { JsonValue payload; - - if (m_approximateCreationDateTimePrecisionHasBeenSet) { - payload.WithString( - "ApproximateCreationDateTimePrecision", - ApproximateCreationDateTimePrecisionMapper::GetNameForApproximateCreationDateTimePrecision(m_approximateCreationDateTimePrecision)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationRequest.cpp index 507118ee2bc..d9b528b052a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String EnableKinesisStreamingDestinationRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_streamArnHasBeenSet) { - payload.WithString("StreamArn", m_streamArn); - } - - if (m_enableKinesisStreamingConfigurationHasBeenSet) { - payload.WithObject("EnableKinesisStreamingConfiguration", m_enableKinesisStreamingConfiguration.Jsonize()); - } - - return payload.View().WriteReadable(); -} +Aws::String EnableKinesisStreamingDestinationRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection EnableKinesisStreamingDestinationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationResult.cpp index 860c749aa66..a60f2251c2b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/EnableKinesisStreamingDestinationResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -23,31 +24,5 @@ EnableKinesisStreamingDestinationResult::EnableKinesisStreamingDestinationResult EnableKinesisStreamingDestinationResult& EnableKinesisStreamingDestinationResult::operator=( const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("StreamArn")) { - m_streamArn = jsonValue.GetString("StreamArn"); - m_streamArnHasBeenSet = true; - } - if (jsonValue.ValueExists("DestinationStatus")) { - m_destinationStatus = DestinationStatusMapper::GetDestinationStatusForName(jsonValue.GetString("DestinationStatus")); - m_destinationStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("EnableKinesisStreamingConfiguration")) { - m_enableKinesisStreamingConfiguration = jsonValue.GetObject("EnableKinesisStreamingConfiguration"); - m_enableKinesisStreamingConfigurationHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Endpoint.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Endpoint.cpp index 15782ed8fb0..fecf665325a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Endpoint.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Endpoint.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { Endpoint::Endpoint(JsonView jsonValue) { *this = jsonValue; } -Endpoint& Endpoint::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Address")) { - m_address = jsonValue.GetString("Address"); - m_addressHasBeenSet = true; - } - if (jsonValue.ValueExists("CachePeriodInMinutes")) { - m_cachePeriodInMinutes = jsonValue.GetInt64("CachePeriodInMinutes"); - m_cachePeriodInMinutesHasBeenSet = true; - } - return *this; -} +Endpoint& Endpoint::operator=(JsonView jsonValue) { return *this; } JsonValue Endpoint::Jsonize() const { JsonValue payload; - - if (m_addressHasBeenSet) { - payload.WithString("Address", m_address); - } - - if (m_cachePeriodInMinutesHasBeenSet) { - payload.WithInt64("CachePeriodInMinutes", m_cachePeriodInMinutes); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementRequest.cpp index 0267b082567..5c2b142986e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementRequest.cpp @@ -3,54 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ExecuteStatementRequest::SerializePayload() const { - JsonValue payload; - - if (m_statementHasBeenSet) { - payload.WithString("Statement", m_statement); - } - - if (m_parametersHasBeenSet) { - Aws::Utils::Array parametersJsonList(m_parameters.size()); - for (unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { - parametersJsonList[parametersIndex].AsObject(m_parameters[parametersIndex].Jsonize()); - } - payload.WithArray("Parameters", std::move(parametersJsonList)); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - if (m_nextTokenHasBeenSet) { - payload.WithString("NextToken", m_nextToken); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - - return payload.View().WriteReadable(); -} +Aws::String ExecuteStatementRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ExecuteStatementRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementResult.cpp index 083dcf30209..58623b0b8c3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteStatementResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,43 +20,4 @@ using namespace Aws; ExecuteStatementResult::ExecuteStatementResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ExecuteStatementResult& ExecuteStatementResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Items")) { - Aws::Utils::Array itemsJsonList = jsonValue.GetArray("Items"); - for (unsigned itemsIndex = 0; itemsIndex < itemsJsonList.GetLength(); ++itemsIndex) { - Aws::Map attributeMap2JsonMap = itemsJsonList[itemsIndex].GetAllObjects(); - Aws::Map attributeMap2Map; - for (auto& attributeMap2Item : attributeMap2JsonMap) { - attributeMap2Map[attributeMap2Item.first] = attributeMap2Item.second.AsObject(); - } - m_items.push_back(std::move(attributeMap2Map)); - } - m_itemsHasBeenSet = true; - } - if (jsonValue.ValueExists("NextToken")) { - m_nextToken = jsonValue.GetString("NextToken"); - m_nextTokenHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedKey")) { - Aws::Map lastEvaluatedKeyJsonMap = jsonValue.GetObject("LastEvaluatedKey").GetAllObjects(); - for (auto& lastEvaluatedKeyItem : lastEvaluatedKeyJsonMap) { - m_lastEvaluatedKey[lastEvaluatedKeyItem.first] = lastEvaluatedKeyItem.second.AsObject(); - } - m_lastEvaluatedKeyHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ExecuteStatementResult& ExecuteStatementResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionRequest.cpp index fdc97fae4a4..2b61fc6cd1d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionRequest.cpp @@ -3,37 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ExecuteTransactionRequest::SerializePayload() const { - JsonValue payload; - - if (m_transactStatementsHasBeenSet) { - Aws::Utils::Array transactStatementsJsonList(m_transactStatements.size()); - for (unsigned transactStatementsIndex = 0; transactStatementsIndex < transactStatementsJsonList.GetLength(); - ++transactStatementsIndex) { - transactStatementsJsonList[transactStatementsIndex].AsObject(m_transactStatements[transactStatementsIndex].Jsonize()); - } - payload.WithArray("TransactStatements", std::move(transactStatementsJsonList)); - } - - if (m_clientRequestTokenHasBeenSet) { - payload.WithString("ClientRequestToken", m_clientRequestToken); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - return payload.View().WriteReadable(); -} +Aws::String ExecuteTransactionRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ExecuteTransactionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionResult.cpp index 6a4bfd2dafe..dd51e556063 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExecuteTransactionResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,30 +20,4 @@ using namespace Aws; ExecuteTransactionResult::ExecuteTransactionResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ExecuteTransactionResult& ExecuteTransactionResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Responses")) { - Aws::Utils::Array responsesJsonList = jsonValue.GetArray("Responses"); - for (unsigned responsesIndex = 0; responsesIndex < responsesJsonList.GetLength(); ++responsesIndex) { - m_responses.push_back(responsesJsonList[responsesIndex].AsObject()); - } - m_responsesHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - Aws::Utils::Array consumedCapacityJsonList = jsonValue.GetArray("ConsumedCapacity"); - for (unsigned consumedCapacityIndex = 0; consumedCapacityIndex < consumedCapacityJsonList.GetLength(); ++consumedCapacityIndex) { - m_consumedCapacity.push_back(consumedCapacityJsonList[consumedCapacityIndex].AsObject()); - } - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ExecuteTransactionResult& ExecuteTransactionResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExpectedAttributeValue.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExpectedAttributeValue.cpp index 48a0b001acc..851808f69be 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExpectedAttributeValue.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExpectedAttributeValue.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,54 +20,10 @@ namespace Model { ExpectedAttributeValue::ExpectedAttributeValue(JsonView jsonValue) { *this = jsonValue; } -ExpectedAttributeValue& ExpectedAttributeValue::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Value")) { - m_value = jsonValue.GetObject("Value"); - m_valueHasBeenSet = true; - } - if (jsonValue.ValueExists("Exists")) { - m_exists = jsonValue.GetBool("Exists"); - m_existsHasBeenSet = true; - } - if (jsonValue.ValueExists("ComparisonOperator")) { - m_comparisonOperator = ComparisonOperatorMapper::GetComparisonOperatorForName(jsonValue.GetString("ComparisonOperator")); - m_comparisonOperatorHasBeenSet = true; - } - if (jsonValue.ValueExists("AttributeValueList")) { - Aws::Utils::Array attributeValueListJsonList = jsonValue.GetArray("AttributeValueList"); - for (unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); - ++attributeValueListIndex) { - m_attributeValueList.push_back(attributeValueListJsonList[attributeValueListIndex].AsObject()); - } - m_attributeValueListHasBeenSet = true; - } - return *this; -} +ExpectedAttributeValue& ExpectedAttributeValue::operator=(JsonView jsonValue) { return *this; } JsonValue ExpectedAttributeValue::Jsonize() const { JsonValue payload; - - if (m_valueHasBeenSet) { - payload.WithObject("Value", m_value.Jsonize()); - } - - if (m_existsHasBeenSet) { - payload.WithBool("Exists", m_exists); - } - - if (m_comparisonOperatorHasBeenSet) { - payload.WithString("ComparisonOperator", ComparisonOperatorMapper::GetNameForComparisonOperator(m_comparisonOperator)); - } - - if (m_attributeValueListHasBeenSet) { - Aws::Utils::Array attributeValueListJsonList(m_attributeValueList.size()); - for (unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); - ++attributeValueListIndex) { - attributeValueListJsonList[attributeValueListIndex].AsObject(m_attributeValueList[attributeValueListIndex].Jsonize()); - } - payload.WithArray("AttributeValueList", std::move(attributeValueListJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportDescription.cpp index 77ff34da9bc..11ebcc42eeb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,181 +20,10 @@ namespace Model { ExportDescription::ExportDescription(JsonView jsonValue) { *this = jsonValue; } -ExportDescription& ExportDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ExportArn")) { - m_exportArn = jsonValue.GetString("ExportArn"); - m_exportArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportStatus")) { - m_exportStatus = ExportStatusMapper::GetExportStatusForName(jsonValue.GetString("ExportStatus")); - m_exportStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("StartTime")) { - m_startTime = jsonValue.GetDouble("StartTime"); - m_startTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("EndTime")) { - m_endTime = jsonValue.GetDouble("EndTime"); - m_endTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportManifest")) { - m_exportManifest = jsonValue.GetString("ExportManifest"); - m_exportManifestHasBeenSet = true; - } - if (jsonValue.ValueExists("TableArn")) { - m_tableArn = jsonValue.GetString("TableArn"); - m_tableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("TableId")) { - m_tableId = jsonValue.GetString("TableId"); - m_tableIdHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportTime")) { - m_exportTime = jsonValue.GetDouble("ExportTime"); - m_exportTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ClientToken")) { - m_clientToken = jsonValue.GetString("ClientToken"); - m_clientTokenHasBeenSet = true; - } - if (jsonValue.ValueExists("S3Bucket")) { - m_s3Bucket = jsonValue.GetString("S3Bucket"); - m_s3BucketHasBeenSet = true; - } - if (jsonValue.ValueExists("S3BucketOwner")) { - m_s3BucketOwner = jsonValue.GetString("S3BucketOwner"); - m_s3BucketOwnerHasBeenSet = true; - } - if (jsonValue.ValueExists("S3Prefix")) { - m_s3Prefix = jsonValue.GetString("S3Prefix"); - m_s3PrefixHasBeenSet = true; - } - if (jsonValue.ValueExists("S3SseAlgorithm")) { - m_s3SseAlgorithm = S3SseAlgorithmMapper::GetS3SseAlgorithmForName(jsonValue.GetString("S3SseAlgorithm")); - m_s3SseAlgorithmHasBeenSet = true; - } - if (jsonValue.ValueExists("S3SseKmsKeyId")) { - m_s3SseKmsKeyId = jsonValue.GetString("S3SseKmsKeyId"); - m_s3SseKmsKeyIdHasBeenSet = true; - } - if (jsonValue.ValueExists("FailureCode")) { - m_failureCode = jsonValue.GetString("FailureCode"); - m_failureCodeHasBeenSet = true; - } - if (jsonValue.ValueExists("FailureMessage")) { - m_failureMessage = jsonValue.GetString("FailureMessage"); - m_failureMessageHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportFormat")) { - m_exportFormat = ExportFormatMapper::GetExportFormatForName(jsonValue.GetString("ExportFormat")); - m_exportFormatHasBeenSet = true; - } - if (jsonValue.ValueExists("BilledSizeBytes")) { - m_billedSizeBytes = jsonValue.GetInt64("BilledSizeBytes"); - m_billedSizeBytesHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCount")) { - m_itemCount = jsonValue.GetInt64("ItemCount"); - m_itemCountHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportType")) { - m_exportType = ExportTypeMapper::GetExportTypeForName(jsonValue.GetString("ExportType")); - m_exportTypeHasBeenSet = true; - } - if (jsonValue.ValueExists("IncrementalExportSpecification")) { - m_incrementalExportSpecification = jsonValue.GetObject("IncrementalExportSpecification"); - m_incrementalExportSpecificationHasBeenSet = true; - } - return *this; -} +ExportDescription& ExportDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ExportDescription::Jsonize() const { JsonValue payload; - - if (m_exportArnHasBeenSet) { - payload.WithString("ExportArn", m_exportArn); - } - - if (m_exportStatusHasBeenSet) { - payload.WithString("ExportStatus", ExportStatusMapper::GetNameForExportStatus(m_exportStatus)); - } - - if (m_startTimeHasBeenSet) { - payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision()); - } - - if (m_endTimeHasBeenSet) { - payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision()); - } - - if (m_exportManifestHasBeenSet) { - payload.WithString("ExportManifest", m_exportManifest); - } - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_tableIdHasBeenSet) { - payload.WithString("TableId", m_tableId); - } - - if (m_exportTimeHasBeenSet) { - payload.WithDouble("ExportTime", m_exportTime.SecondsWithMSPrecision()); - } - - if (m_clientTokenHasBeenSet) { - payload.WithString("ClientToken", m_clientToken); - } - - if (m_s3BucketHasBeenSet) { - payload.WithString("S3Bucket", m_s3Bucket); - } - - if (m_s3BucketOwnerHasBeenSet) { - payload.WithString("S3BucketOwner", m_s3BucketOwner); - } - - if (m_s3PrefixHasBeenSet) { - payload.WithString("S3Prefix", m_s3Prefix); - } - - if (m_s3SseAlgorithmHasBeenSet) { - payload.WithString("S3SseAlgorithm", S3SseAlgorithmMapper::GetNameForS3SseAlgorithm(m_s3SseAlgorithm)); - } - - if (m_s3SseKmsKeyIdHasBeenSet) { - payload.WithString("S3SseKmsKeyId", m_s3SseKmsKeyId); - } - - if (m_failureCodeHasBeenSet) { - payload.WithString("FailureCode", m_failureCode); - } - - if (m_failureMessageHasBeenSet) { - payload.WithString("FailureMessage", m_failureMessage); - } - - if (m_exportFormatHasBeenSet) { - payload.WithString("ExportFormat", ExportFormatMapper::GetNameForExportFormat(m_exportFormat)); - } - - if (m_billedSizeBytesHasBeenSet) { - payload.WithInt64("BilledSizeBytes", m_billedSizeBytes); - } - - if (m_itemCountHasBeenSet) { - payload.WithInt64("ItemCount", m_itemCount); - } - - if (m_exportTypeHasBeenSet) { - payload.WithString("ExportType", ExportTypeMapper::GetNameForExportType(m_exportType)); - } - - if (m_incrementalExportSpecificationHasBeenSet) { - payload.WithObject("IncrementalExportSpecification", m_incrementalExportSpecification.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportFormat.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportFormat.cpp index 61d9d2a17b6..a0fd24ddfec 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportFormat.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportFormat.cpp @@ -30,7 +30,6 @@ ExportFormat GetExportFormatForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExportFormat::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExportFormat(ExportFormat enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportStatus.cpp index 7b67b7b3bf3..2c2b0c8a12d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportStatus.cpp @@ -33,7 +33,6 @@ ExportStatus GetExportStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExportStatus::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForExportStatus(ExportStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportSummary.cpp index df244fc8a63..8bdac690021 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { ExportSummary::ExportSummary(JsonView jsonValue) { *this = jsonValue; } -ExportSummary& ExportSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ExportArn")) { - m_exportArn = jsonValue.GetString("ExportArn"); - m_exportArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportStatus")) { - m_exportStatus = ExportStatusMapper::GetExportStatusForName(jsonValue.GetString("ExportStatus")); - m_exportStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportType")) { - m_exportType = ExportTypeMapper::GetExportTypeForName(jsonValue.GetString("ExportType")); - m_exportTypeHasBeenSet = true; - } - return *this; -} +ExportSummary& ExportSummary::operator=(JsonView jsonValue) { return *this; } JsonValue ExportSummary::Jsonize() const { JsonValue payload; - - if (m_exportArnHasBeenSet) { - payload.WithString("ExportArn", m_exportArn); - } - - if (m_exportStatusHasBeenSet) { - payload.WithString("ExportStatus", ExportStatusMapper::GetNameForExportStatus(m_exportStatus)); - } - - if (m_exportTypeHasBeenSet) { - payload.WithString("ExportType", ExportTypeMapper::GetNameForExportType(m_exportType)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeRequest.cpp index 07bc6402b59..5a40b6b26ee 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeRequest.cpp @@ -3,64 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ExportTableToPointInTimeRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_exportTimeHasBeenSet) { - payload.WithDouble("ExportTime", m_exportTime.SecondsWithMSPrecision()); - } - - if (m_clientTokenHasBeenSet) { - payload.WithString("ClientToken", m_clientToken); - } - - if (m_s3BucketHasBeenSet) { - payload.WithString("S3Bucket", m_s3Bucket); - } - - if (m_s3BucketOwnerHasBeenSet) { - payload.WithString("S3BucketOwner", m_s3BucketOwner); - } - - if (m_s3PrefixHasBeenSet) { - payload.WithString("S3Prefix", m_s3Prefix); - } - - if (m_s3SseAlgorithmHasBeenSet) { - payload.WithString("S3SseAlgorithm", S3SseAlgorithmMapper::GetNameForS3SseAlgorithm(m_s3SseAlgorithm)); - } - - if (m_s3SseKmsKeyIdHasBeenSet) { - payload.WithString("S3SseKmsKeyId", m_s3SseKmsKeyId); - } - - if (m_exportFormatHasBeenSet) { - payload.WithString("ExportFormat", ExportFormatMapper::GetNameForExportFormat(m_exportFormat)); - } - - if (m_exportTypeHasBeenSet) { - payload.WithString("ExportType", ExportTypeMapper::GetNameForExportType(m_exportType)); - } - - if (m_incrementalExportSpecificationHasBeenSet) { - payload.WithObject("IncrementalExportSpecification", m_incrementalExportSpecification.Jsonize()); - } - - return payload.View().WriteReadable(); -} +Aws::String ExportTableToPointInTimeRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ExportTableToPointInTimeRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeResult.cpp index 418e01802ac..6c017f54251 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportTableToPointInTimeResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -20,19 +21,5 @@ using namespace Aws; ExportTableToPointInTimeResult::ExportTableToPointInTimeResult(const Aws::AmazonWebServiceResult& result) { *this = result; } ExportTableToPointInTimeResult& ExportTableToPointInTimeResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ExportDescription")) { - m_exportDescription = jsonValue.GetObject("ExportDescription"); - m_exportDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportType.cpp index 8daa0955add..2828e20bacd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportType.cpp @@ -30,7 +30,6 @@ ExportType GetExportTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExportType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExportType(ExportType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportViewType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportViewType.cpp index 45bee3428dc..46e6b044322 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportViewType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ExportViewType.cpp @@ -30,7 +30,6 @@ ExportViewType GetExportViewTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ExportViewType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForExportViewType(ExportViewType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/FailureException.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/FailureException.cpp index 026ab4bb795..832b4c527ff 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/FailureException.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/FailureException.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { FailureException::FailureException(JsonView jsonValue) { *this = jsonValue; } -FailureException& FailureException::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ExceptionName")) { - m_exceptionName = jsonValue.GetString("ExceptionName"); - m_exceptionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ExceptionDescription")) { - m_exceptionDescription = jsonValue.GetString("ExceptionDescription"); - m_exceptionDescriptionHasBeenSet = true; - } - return *this; -} +FailureException& FailureException::operator=(JsonView jsonValue) { return *this; } JsonValue FailureException::Jsonize() const { JsonValue payload; - - if (m_exceptionNameHasBeenSet) { - payload.WithString("ExceptionName", m_exceptionName); - } - - if (m_exceptionDescriptionHasBeenSet) { - payload.WithString("ExceptionDescription", m_exceptionDescription); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Get.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Get.cpp index 3d704ae8d90..af652043d20 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Get.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Get.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,59 +20,10 @@ namespace Model { Get::Get(JsonView jsonValue) { *this = jsonValue; } -Get& Get::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Key")) { - Aws::Map keyJsonMap = jsonValue.GetObject("Key").GetAllObjects(); - for (auto& keyItem : keyJsonMap) { - m_key[keyItem.first] = keyItem.second.AsObject(); - } - m_keyHasBeenSet = true; - } - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProjectionExpression")) { - m_projectionExpression = jsonValue.GetString("ProjectionExpression"); - m_projectionExpressionHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeNames")) { - Aws::Map expressionAttributeNamesJsonMap = jsonValue.GetObject("ExpressionAttributeNames").GetAllObjects(); - for (auto& expressionAttributeNamesItem : expressionAttributeNamesJsonMap) { - m_expressionAttributeNames[expressionAttributeNamesItem.first] = expressionAttributeNamesItem.second.AsString(); - } - m_expressionAttributeNamesHasBeenSet = true; - } - return *this; -} +Get& Get::operator=(JsonView jsonValue) { return *this; } JsonValue Get::Jsonize() const { JsonValue payload; - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemRequest.cpp index ca9c1b6effc..e2a2c6890bf 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemRequest.cpp @@ -3,60 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String GetItemRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_keyHasBeenSet) { - JsonValue keyJsonMap; - for (auto& keyItem : m_key) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - payload.WithObject("Key", std::move(keyJsonMap)); - } - - if (m_attributesToGetHasBeenSet) { - Aws::Utils::Array attributesToGetJsonList(m_attributesToGet.size()); - for (unsigned attributesToGetIndex = 0; attributesToGetIndex < attributesToGetJsonList.GetLength(); ++attributesToGetIndex) { - attributesToGetJsonList[attributesToGetIndex].AsString(m_attributesToGet[attributesToGetIndex]); - } - payload.WithArray("AttributesToGet", std::move(attributesToGetJsonList)); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - return payload.View().WriteReadable(); -} +Aws::String GetItemRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection GetItemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemResult.cpp index 5307b42ed87..97754463c60 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetItemResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; GetItemResult::GetItemResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetItemResult& GetItemResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetItemResult& GetItemResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyRequest.cpp index 03c0e354bb3..dfe7f6c811a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyRequest.cpp @@ -3,24 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String GetResourcePolicyRequest::SerializePayload() const { - JsonValue payload; - - if (m_resourceArnHasBeenSet) { - payload.WithString("ResourceArn", m_resourceArn); - } - - return payload.View().WriteReadable(); -} +Aws::String GetResourcePolicyRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection GetResourcePolicyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyResult.cpp index d514063da75..c1f75be616e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GetResourcePolicyResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,24 +20,4 @@ using namespace Aws; GetResourcePolicyResult::GetResourcePolicyResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -GetResourcePolicyResult& GetResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Policy")) { - m_policy = jsonValue.GetString("Policy"); - m_policyHasBeenSet = true; - } - if (jsonValue.ValueExists("RevisionId")) { - m_revisionId = jsonValue.GetString("RevisionId"); - m_revisionIdHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +GetResourcePolicyResult& GetResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndex.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndex.cpp index 9fca9f85388..e5094e5034a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndex.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndex.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,68 +20,10 @@ namespace Model { GlobalSecondaryIndex::GlobalSecondaryIndex(JsonView jsonValue) { *this = jsonValue; } -GlobalSecondaryIndex& GlobalSecondaryIndex::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughput")) { - m_provisionedThroughput = jsonValue.GetObject("ProvisionedThroughput"); - m_provisionedThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughput")) { - m_onDemandThroughput = jsonValue.GetObject("OnDemandThroughput"); - m_onDemandThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("WarmThroughput")) { - m_warmThroughput = jsonValue.GetObject("WarmThroughput"); - m_warmThroughputHasBeenSet = true; - } - return *this; -} +GlobalSecondaryIndex& GlobalSecondaryIndex::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalSecondaryIndex::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_provisionedThroughputHasBeenSet) { - payload.WithObject("ProvisionedThroughput", m_provisionedThroughput.Jsonize()); - } - - if (m_onDemandThroughputHasBeenSet) { - payload.WithObject("OnDemandThroughput", m_onDemandThroughput.Jsonize()); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexAutoScalingUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexAutoScalingUpdate.cpp index be03eb46d4a..078c584d3e8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexAutoScalingUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexAutoScalingUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate(JsonView jsonValue) { *this = jsonValue; } -GlobalSecondaryIndexAutoScalingUpdate& GlobalSecondaryIndexAutoScalingUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityAutoScalingUpdate")) { - m_provisionedWriteCapacityAutoScalingUpdate = jsonValue.GetObject("ProvisionedWriteCapacityAutoScalingUpdate"); - m_provisionedWriteCapacityAutoScalingUpdateHasBeenSet = true; - } - return *this; -} +GlobalSecondaryIndexAutoScalingUpdate& GlobalSecondaryIndexAutoScalingUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalSecondaryIndexAutoScalingUpdate::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedWriteCapacityAutoScalingUpdateHasBeenSet) { - payload.WithObject("ProvisionedWriteCapacityAutoScalingUpdate", m_provisionedWriteCapacityAutoScalingUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexDescription.cpp index b054c341f80..da8697e2498 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,108 +20,10 @@ namespace Model { GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription(JsonView jsonValue) { *this = jsonValue; } -GlobalSecondaryIndexDescription& GlobalSecondaryIndexDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexStatus")) { - m_indexStatus = IndexStatusMapper::GetIndexStatusForName(jsonValue.GetString("IndexStatus")); - m_indexStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("Backfilling")) { - m_backfilling = jsonValue.GetBool("Backfilling"); - m_backfillingHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughput")) { - m_provisionedThroughput = jsonValue.GetObject("ProvisionedThroughput"); - m_provisionedThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexSizeBytes")) { - m_indexSizeBytes = jsonValue.GetInt64("IndexSizeBytes"); - m_indexSizeBytesHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCount")) { - m_itemCount = jsonValue.GetInt64("ItemCount"); - m_itemCountHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexArn")) { - m_indexArn = jsonValue.GetString("IndexArn"); - m_indexArnHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughput")) { - m_onDemandThroughput = jsonValue.GetObject("OnDemandThroughput"); - m_onDemandThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("WarmThroughput")) { - m_warmThroughput = jsonValue.GetObject("WarmThroughput"); - m_warmThroughputHasBeenSet = true; - } - return *this; -} +GlobalSecondaryIndexDescription& GlobalSecondaryIndexDescription::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalSecondaryIndexDescription::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_indexStatusHasBeenSet) { - payload.WithString("IndexStatus", IndexStatusMapper::GetNameForIndexStatus(m_indexStatus)); - } - - if (m_backfillingHasBeenSet) { - payload.WithBool("Backfilling", m_backfilling); - } - - if (m_provisionedThroughputHasBeenSet) { - payload.WithObject("ProvisionedThroughput", m_provisionedThroughput.Jsonize()); - } - - if (m_indexSizeBytesHasBeenSet) { - payload.WithInt64("IndexSizeBytes", m_indexSizeBytes); - } - - if (m_itemCountHasBeenSet) { - payload.WithInt64("ItemCount", m_itemCount); - } - - if (m_indexArnHasBeenSet) { - payload.WithString("IndexArn", m_indexArn); - } - - if (m_onDemandThroughputHasBeenSet) { - payload.WithObject("OnDemandThroughput", m_onDemandThroughput.Jsonize()); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexInfo.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexInfo.cpp index 9b9063670e0..4e19995fa60 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexInfo.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexInfo.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,60 +20,10 @@ namespace Model { GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo(JsonView jsonValue) { *this = jsonValue; } -GlobalSecondaryIndexInfo& GlobalSecondaryIndexInfo::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughput")) { - m_provisionedThroughput = jsonValue.GetObject("ProvisionedThroughput"); - m_provisionedThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughput")) { - m_onDemandThroughput = jsonValue.GetObject("OnDemandThroughput"); - m_onDemandThroughputHasBeenSet = true; - } - return *this; -} +GlobalSecondaryIndexInfo& GlobalSecondaryIndexInfo::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalSecondaryIndexInfo::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_provisionedThroughputHasBeenSet) { - payload.WithObject("ProvisionedThroughput", m_provisionedThroughput.Jsonize()); - } - - if (m_onDemandThroughputHasBeenSet) { - payload.WithObject("OnDemandThroughput", m_onDemandThroughput.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexUpdate.cpp index dc24f7638a2..fc99a5ae0a3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate(JsonView jsonValue) { *this = jsonValue; } -GlobalSecondaryIndexUpdate& GlobalSecondaryIndexUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Update")) { - m_update = jsonValue.GetObject("Update"); - m_updateHasBeenSet = true; - } - if (jsonValue.ValueExists("Create")) { - m_create = jsonValue.GetObject("Create"); - m_createHasBeenSet = true; - } - if (jsonValue.ValueExists("Delete")) { - m_delete = jsonValue.GetObject("Delete"); - m_deleteHasBeenSet = true; - } - return *this; -} +GlobalSecondaryIndexUpdate& GlobalSecondaryIndexUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalSecondaryIndexUpdate::Jsonize() const { JsonValue payload; - - if (m_updateHasBeenSet) { - payload.WithObject("Update", m_update.Jsonize()); - } - - if (m_createHasBeenSet) { - payload.WithObject("Create", m_create.Jsonize()); - } - - if (m_deleteHasBeenSet) { - payload.WithObject("Delete", m_delete.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexWarmThroughputDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexWarmThroughputDescription.cpp index 14fe2e80dcc..7a5252358cc 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexWarmThroughputDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalSecondaryIndexWarmThroughputDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -18,36 +21,11 @@ namespace Model { GlobalSecondaryIndexWarmThroughputDescription::GlobalSecondaryIndexWarmThroughputDescription(JsonView jsonValue) { *this = jsonValue; } GlobalSecondaryIndexWarmThroughputDescription& GlobalSecondaryIndexWarmThroughputDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ReadUnitsPerSecond")) { - m_readUnitsPerSecond = jsonValue.GetInt64("ReadUnitsPerSecond"); - m_readUnitsPerSecondHasBeenSet = true; - } - if (jsonValue.ValueExists("WriteUnitsPerSecond")) { - m_writeUnitsPerSecond = jsonValue.GetInt64("WriteUnitsPerSecond"); - m_writeUnitsPerSecondHasBeenSet = true; - } - if (jsonValue.ValueExists("Status")) { - m_status = IndexStatusMapper::GetIndexStatusForName(jsonValue.GetString("Status")); - m_statusHasBeenSet = true; - } return *this; } JsonValue GlobalSecondaryIndexWarmThroughputDescription::Jsonize() const { JsonValue payload; - - if (m_readUnitsPerSecondHasBeenSet) { - payload.WithInt64("ReadUnitsPerSecond", m_readUnitsPerSecond); - } - - if (m_writeUnitsPerSecondHasBeenSet) { - payload.WithInt64("WriteUnitsPerSecond", m_writeUnitsPerSecond); - } - - if (m_statusHasBeenSet) { - payload.WithString("Status", IndexStatusMapper::GetNameForIndexStatus(m_status)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTable.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTable.cpp index 6617286dbac..f29d05c1ac7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTable.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTable.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { GlobalTable::GlobalTable(JsonView jsonValue) { *this = jsonValue; } -GlobalTable& GlobalTable::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("GlobalTableName")) { - m_globalTableName = jsonValue.GetString("GlobalTableName"); - m_globalTableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicationGroup")) { - Aws::Utils::Array replicationGroupJsonList = jsonValue.GetArray("ReplicationGroup"); - for (unsigned replicationGroupIndex = 0; replicationGroupIndex < replicationGroupJsonList.GetLength(); ++replicationGroupIndex) { - m_replicationGroup.push_back(replicationGroupJsonList[replicationGroupIndex].AsObject()); - } - m_replicationGroupHasBeenSet = true; - } - return *this; -} +GlobalTable& GlobalTable::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalTable::Jsonize() const { JsonValue payload; - - if (m_globalTableNameHasBeenSet) { - payload.WithString("GlobalTableName", m_globalTableName); - } - - if (m_replicationGroupHasBeenSet) { - Aws::Utils::Array replicationGroupJsonList(m_replicationGroup.size()); - for (unsigned replicationGroupIndex = 0; replicationGroupIndex < replicationGroupJsonList.GetLength(); ++replicationGroupIndex) { - replicationGroupJsonList[replicationGroupIndex].AsObject(m_replicationGroup[replicationGroupIndex].Jsonize()); - } - payload.WithArray("ReplicationGroup", std::move(replicationGroupJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableDescription.cpp index 6a761569eca..b8af3ba4554 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,60 +20,10 @@ namespace Model { GlobalTableDescription::GlobalTableDescription(JsonView jsonValue) { *this = jsonValue; } -GlobalTableDescription& GlobalTableDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ReplicationGroup")) { - Aws::Utils::Array replicationGroupJsonList = jsonValue.GetArray("ReplicationGroup"); - for (unsigned replicationGroupIndex = 0; replicationGroupIndex < replicationGroupJsonList.GetLength(); ++replicationGroupIndex) { - m_replicationGroup.push_back(replicationGroupJsonList[replicationGroupIndex].AsObject()); - } - m_replicationGroupHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalTableArn")) { - m_globalTableArn = jsonValue.GetString("GlobalTableArn"); - m_globalTableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("CreationDateTime")) { - m_creationDateTime = jsonValue.GetDouble("CreationDateTime"); - m_creationDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalTableStatus")) { - m_globalTableStatus = GlobalTableStatusMapper::GetGlobalTableStatusForName(jsonValue.GetString("GlobalTableStatus")); - m_globalTableStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalTableName")) { - m_globalTableName = jsonValue.GetString("GlobalTableName"); - m_globalTableNameHasBeenSet = true; - } - return *this; -} +GlobalTableDescription& GlobalTableDescription::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalTableDescription::Jsonize() const { JsonValue payload; - - if (m_replicationGroupHasBeenSet) { - Aws::Utils::Array replicationGroupJsonList(m_replicationGroup.size()); - for (unsigned replicationGroupIndex = 0; replicationGroupIndex < replicationGroupJsonList.GetLength(); ++replicationGroupIndex) { - replicationGroupJsonList[replicationGroupIndex].AsObject(m_replicationGroup[replicationGroupIndex].Jsonize()); - } - payload.WithArray("ReplicationGroup", std::move(replicationGroupJsonList)); - } - - if (m_globalTableArnHasBeenSet) { - payload.WithString("GlobalTableArn", m_globalTableArn); - } - - if (m_creationDateTimeHasBeenSet) { - payload.WithDouble("CreationDateTime", m_creationDateTime.SecondsWithMSPrecision()); - } - - if (m_globalTableStatusHasBeenSet) { - payload.WithString("GlobalTableStatus", GlobalTableStatusMapper::GetNameForGlobalTableStatus(m_globalTableStatus)); - } - - if (m_globalTableNameHasBeenSet) { - payload.WithString("GlobalTableName", m_globalTableName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableGlobalSecondaryIndexSettingsUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableGlobalSecondaryIndexSettingsUpdate.cpp index da12dcaae5f..fc279f325a2 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableGlobalSecondaryIndexSettingsUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableGlobalSecondaryIndexSettingsUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -18,36 +21,11 @@ namespace Model { GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate(JsonView jsonValue) { *this = jsonValue; } GlobalTableGlobalSecondaryIndexSettingsUpdate& GlobalTableGlobalSecondaryIndexSettingsUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityUnits")) { - m_provisionedWriteCapacityUnits = jsonValue.GetInt64("ProvisionedWriteCapacityUnits"); - m_provisionedWriteCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityAutoScalingSettingsUpdate")) { - m_provisionedWriteCapacityAutoScalingSettingsUpdate = jsonValue.GetObject("ProvisionedWriteCapacityAutoScalingSettingsUpdate"); - m_provisionedWriteCapacityAutoScalingSettingsUpdateHasBeenSet = true; - } return *this; } JsonValue GlobalTableGlobalSecondaryIndexSettingsUpdate::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedWriteCapacityUnitsHasBeenSet) { - payload.WithInt64("ProvisionedWriteCapacityUnits", m_provisionedWriteCapacityUnits); - } - - if (m_provisionedWriteCapacityAutoScalingSettingsUpdateHasBeenSet) { - payload.WithObject("ProvisionedWriteCapacityAutoScalingSettingsUpdate", m_provisionedWriteCapacityAutoScalingSettingsUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableSettingsReplicationMode.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableSettingsReplicationMode.cpp index 77da6fa01e8..c24526e712c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableSettingsReplicationMode.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableSettingsReplicationMode.cpp @@ -33,7 +33,6 @@ GlobalTableSettingsReplicationMode GetGlobalTableSettingsReplicationModeForName( overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return GlobalTableSettingsReplicationMode::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForGlobalTableSettingsReplicationMode(GlobalTableSettingsRepl if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableStatus.cpp index 06cb20a08d7..4fab6180cfe 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableStatus.cpp @@ -36,7 +36,6 @@ GlobalTableStatus GetGlobalTableStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return GlobalTableStatus::NOT_SET; } @@ -57,7 +56,6 @@ Aws::String GetNameForGlobalTableStatus(GlobalTableStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessDescription.cpp index 13c2a8ec8c8..5e80ba66dba 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { GlobalTableWitnessDescription::GlobalTableWitnessDescription(JsonView jsonValue) { *this = jsonValue; } -GlobalTableWitnessDescription& GlobalTableWitnessDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("WitnessStatus")) { - m_witnessStatus = WitnessStatusMapper::GetWitnessStatusForName(jsonValue.GetString("WitnessStatus")); - m_witnessStatusHasBeenSet = true; - } - return *this; -} +GlobalTableWitnessDescription& GlobalTableWitnessDescription::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalTableWitnessDescription::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_witnessStatusHasBeenSet) { - payload.WithString("WitnessStatus", WitnessStatusMapper::GetNameForWitnessStatus(m_witnessStatus)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessGroupUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessGroupUpdate.cpp index 8f82d3911d7..57b1f0ceef5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessGroupUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/GlobalTableWitnessGroupUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { GlobalTableWitnessGroupUpdate::GlobalTableWitnessGroupUpdate(JsonView jsonValue) { *this = jsonValue; } -GlobalTableWitnessGroupUpdate& GlobalTableWitnessGroupUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Create")) { - m_create = jsonValue.GetObject("Create"); - m_createHasBeenSet = true; - } - if (jsonValue.ValueExists("Delete")) { - m_delete = jsonValue.GetObject("Delete"); - m_deleteHasBeenSet = true; - } - return *this; -} +GlobalTableWitnessGroupUpdate& GlobalTableWitnessGroupUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue GlobalTableWitnessGroupUpdate::Jsonize() const { JsonValue payload; - - if (m_createHasBeenSet) { - payload.WithObject("Create", m_create.Jsonize()); - } - - if (m_deleteHasBeenSet) { - payload.WithObject("Delete", m_delete.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportStatus.cpp index 3e91c575a5d..6ca75152371 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportStatus.cpp @@ -39,7 +39,6 @@ ImportStatus GetImportStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ImportStatus::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForImportStatus(ImportStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportSummary.cpp index f2fcd509890..aee2e3572d7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,77 +20,10 @@ namespace Model { ImportSummary::ImportSummary(JsonView jsonValue) { *this = jsonValue; } -ImportSummary& ImportSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ImportArn")) { - m_importArn = jsonValue.GetString("ImportArn"); - m_importArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ImportStatus")) { - m_importStatus = ImportStatusMapper::GetImportStatusForName(jsonValue.GetString("ImportStatus")); - m_importStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("TableArn")) { - m_tableArn = jsonValue.GetString("TableArn"); - m_tableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("S3BucketSource")) { - m_s3BucketSource = jsonValue.GetObject("S3BucketSource"); - m_s3BucketSourceHasBeenSet = true; - } - if (jsonValue.ValueExists("CloudWatchLogGroupArn")) { - m_cloudWatchLogGroupArn = jsonValue.GetString("CloudWatchLogGroupArn"); - m_cloudWatchLogGroupArnHasBeenSet = true; - } - if (jsonValue.ValueExists("InputFormat")) { - m_inputFormat = InputFormatMapper::GetInputFormatForName(jsonValue.GetString("InputFormat")); - m_inputFormatHasBeenSet = true; - } - if (jsonValue.ValueExists("StartTime")) { - m_startTime = jsonValue.GetDouble("StartTime"); - m_startTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("EndTime")) { - m_endTime = jsonValue.GetDouble("EndTime"); - m_endTimeHasBeenSet = true; - } - return *this; -} +ImportSummary& ImportSummary::operator=(JsonView jsonValue) { return *this; } JsonValue ImportSummary::Jsonize() const { JsonValue payload; - - if (m_importArnHasBeenSet) { - payload.WithString("ImportArn", m_importArn); - } - - if (m_importStatusHasBeenSet) { - payload.WithString("ImportStatus", ImportStatusMapper::GetNameForImportStatus(m_importStatus)); - } - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_s3BucketSourceHasBeenSet) { - payload.WithObject("S3BucketSource", m_s3BucketSource.Jsonize()); - } - - if (m_cloudWatchLogGroupArnHasBeenSet) { - payload.WithString("CloudWatchLogGroupArn", m_cloudWatchLogGroupArn); - } - - if (m_inputFormatHasBeenSet) { - payload.WithString("InputFormat", InputFormatMapper::GetNameForInputFormat(m_inputFormat)); - } - - if (m_startTimeHasBeenSet) { - payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision()); - } - - if (m_endTimeHasBeenSet) { - payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableDescription.cpp index 08062ea18f4..fe147d9c209 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,165 +20,10 @@ namespace Model { ImportTableDescription::ImportTableDescription(JsonView jsonValue) { *this = jsonValue; } -ImportTableDescription& ImportTableDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ImportArn")) { - m_importArn = jsonValue.GetString("ImportArn"); - m_importArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ImportStatus")) { - m_importStatus = ImportStatusMapper::GetImportStatusForName(jsonValue.GetString("ImportStatus")); - m_importStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("TableArn")) { - m_tableArn = jsonValue.GetString("TableArn"); - m_tableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("TableId")) { - m_tableId = jsonValue.GetString("TableId"); - m_tableIdHasBeenSet = true; - } - if (jsonValue.ValueExists("ClientToken")) { - m_clientToken = jsonValue.GetString("ClientToken"); - m_clientTokenHasBeenSet = true; - } - if (jsonValue.ValueExists("S3BucketSource")) { - m_s3BucketSource = jsonValue.GetObject("S3BucketSource"); - m_s3BucketSourceHasBeenSet = true; - } - if (jsonValue.ValueExists("ErrorCount")) { - m_errorCount = jsonValue.GetInt64("ErrorCount"); - m_errorCountHasBeenSet = true; - } - if (jsonValue.ValueExists("CloudWatchLogGroupArn")) { - m_cloudWatchLogGroupArn = jsonValue.GetString("CloudWatchLogGroupArn"); - m_cloudWatchLogGroupArnHasBeenSet = true; - } - if (jsonValue.ValueExists("InputFormat")) { - m_inputFormat = InputFormatMapper::GetInputFormatForName(jsonValue.GetString("InputFormat")); - m_inputFormatHasBeenSet = true; - } - if (jsonValue.ValueExists("InputFormatOptions")) { - m_inputFormatOptions = jsonValue.GetObject("InputFormatOptions"); - m_inputFormatOptionsHasBeenSet = true; - } - if (jsonValue.ValueExists("InputCompressionType")) { - m_inputCompressionType = InputCompressionTypeMapper::GetInputCompressionTypeForName(jsonValue.GetString("InputCompressionType")); - m_inputCompressionTypeHasBeenSet = true; - } - if (jsonValue.ValueExists("TableCreationParameters")) { - m_tableCreationParameters = jsonValue.GetObject("TableCreationParameters"); - m_tableCreationParametersHasBeenSet = true; - } - if (jsonValue.ValueExists("StartTime")) { - m_startTime = jsonValue.GetDouble("StartTime"); - m_startTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("EndTime")) { - m_endTime = jsonValue.GetDouble("EndTime"); - m_endTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ProcessedSizeBytes")) { - m_processedSizeBytes = jsonValue.GetInt64("ProcessedSizeBytes"); - m_processedSizeBytesHasBeenSet = true; - } - if (jsonValue.ValueExists("ProcessedItemCount")) { - m_processedItemCount = jsonValue.GetInt64("ProcessedItemCount"); - m_processedItemCountHasBeenSet = true; - } - if (jsonValue.ValueExists("ImportedItemCount")) { - m_importedItemCount = jsonValue.GetInt64("ImportedItemCount"); - m_importedItemCountHasBeenSet = true; - } - if (jsonValue.ValueExists("FailureCode")) { - m_failureCode = jsonValue.GetString("FailureCode"); - m_failureCodeHasBeenSet = true; - } - if (jsonValue.ValueExists("FailureMessage")) { - m_failureMessage = jsonValue.GetString("FailureMessage"); - m_failureMessageHasBeenSet = true; - } - return *this; -} +ImportTableDescription& ImportTableDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ImportTableDescription::Jsonize() const { JsonValue payload; - - if (m_importArnHasBeenSet) { - payload.WithString("ImportArn", m_importArn); - } - - if (m_importStatusHasBeenSet) { - payload.WithString("ImportStatus", ImportStatusMapper::GetNameForImportStatus(m_importStatus)); - } - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_tableIdHasBeenSet) { - payload.WithString("TableId", m_tableId); - } - - if (m_clientTokenHasBeenSet) { - payload.WithString("ClientToken", m_clientToken); - } - - if (m_s3BucketSourceHasBeenSet) { - payload.WithObject("S3BucketSource", m_s3BucketSource.Jsonize()); - } - - if (m_errorCountHasBeenSet) { - payload.WithInt64("ErrorCount", m_errorCount); - } - - if (m_cloudWatchLogGroupArnHasBeenSet) { - payload.WithString("CloudWatchLogGroupArn", m_cloudWatchLogGroupArn); - } - - if (m_inputFormatHasBeenSet) { - payload.WithString("InputFormat", InputFormatMapper::GetNameForInputFormat(m_inputFormat)); - } - - if (m_inputFormatOptionsHasBeenSet) { - payload.WithObject("InputFormatOptions", m_inputFormatOptions.Jsonize()); - } - - if (m_inputCompressionTypeHasBeenSet) { - payload.WithString("InputCompressionType", InputCompressionTypeMapper::GetNameForInputCompressionType(m_inputCompressionType)); - } - - if (m_tableCreationParametersHasBeenSet) { - payload.WithObject("TableCreationParameters", m_tableCreationParameters.Jsonize()); - } - - if (m_startTimeHasBeenSet) { - payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision()); - } - - if (m_endTimeHasBeenSet) { - payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision()); - } - - if (m_processedSizeBytesHasBeenSet) { - payload.WithInt64("ProcessedSizeBytes", m_processedSizeBytes); - } - - if (m_processedItemCountHasBeenSet) { - payload.WithInt64("ProcessedItemCount", m_processedItemCount); - } - - if (m_importedItemCountHasBeenSet) { - payload.WithInt64("ImportedItemCount", m_importedItemCount); - } - - if (m_failureCodeHasBeenSet) { - payload.WithString("FailureCode", m_failureCode); - } - - if (m_failureMessageHasBeenSet) { - payload.WithString("FailureMessage", m_failureMessage); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableRequest.cpp index 2321d25d2a5..3493d457186 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableRequest.cpp @@ -3,44 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ImportTableRequest::SerializePayload() const { - JsonValue payload; - - if (m_clientTokenHasBeenSet) { - payload.WithString("ClientToken", m_clientToken); - } - - if (m_s3BucketSourceHasBeenSet) { - payload.WithObject("S3BucketSource", m_s3BucketSource.Jsonize()); - } - - if (m_inputFormatHasBeenSet) { - payload.WithString("InputFormat", InputFormatMapper::GetNameForInputFormat(m_inputFormat)); - } - - if (m_inputFormatOptionsHasBeenSet) { - payload.WithObject("InputFormatOptions", m_inputFormatOptions.Jsonize()); - } - - if (m_inputCompressionTypeHasBeenSet) { - payload.WithString("InputCompressionType", InputCompressionTypeMapper::GetNameForInputCompressionType(m_inputCompressionType)); - } - - if (m_tableCreationParametersHasBeenSet) { - payload.WithObject("TableCreationParameters", m_tableCreationParameters.Jsonize()); - } - - return payload.View().WriteReadable(); -} +Aws::String ImportTableRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ImportTableRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableResult.cpp index c380333db5b..694d0a28364 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ImportTableResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; ImportTableResult::ImportTableResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ImportTableResult& ImportTableResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ImportTableDescription")) { - m_importTableDescription = jsonValue.GetObject("ImportTableDescription"); - m_importTableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ImportTableResult& ImportTableResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/IncrementalExportSpecification.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/IncrementalExportSpecification.cpp index 5af9c27ff61..d3e435d0823 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/IncrementalExportSpecification.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/IncrementalExportSpecification.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { IncrementalExportSpecification::IncrementalExportSpecification(JsonView jsonValue) { *this = jsonValue; } -IncrementalExportSpecification& IncrementalExportSpecification::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ExportFromTime")) { - m_exportFromTime = jsonValue.GetDouble("ExportFromTime"); - m_exportFromTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportToTime")) { - m_exportToTime = jsonValue.GetDouble("ExportToTime"); - m_exportToTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ExportViewType")) { - m_exportViewType = ExportViewTypeMapper::GetExportViewTypeForName(jsonValue.GetString("ExportViewType")); - m_exportViewTypeHasBeenSet = true; - } - return *this; -} +IncrementalExportSpecification& IncrementalExportSpecification::operator=(JsonView jsonValue) { return *this; } JsonValue IncrementalExportSpecification::Jsonize() const { JsonValue payload; - - if (m_exportFromTimeHasBeenSet) { - payload.WithDouble("ExportFromTime", m_exportFromTime.SecondsWithMSPrecision()); - } - - if (m_exportToTimeHasBeenSet) { - payload.WithDouble("ExportToTime", m_exportToTime.SecondsWithMSPrecision()); - } - - if (m_exportViewTypeHasBeenSet) { - payload.WithString("ExportViewType", ExportViewTypeMapper::GetNameForExportViewType(m_exportViewType)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/IndexStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/IndexStatus.cpp index 9fe4c7e137f..4c300b7b946 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/IndexStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/IndexStatus.cpp @@ -36,7 +36,6 @@ IndexStatus GetIndexStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return IndexStatus::NOT_SET; } @@ -57,7 +56,6 @@ Aws::String GetNameForIndexStatus(IndexStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputCompressionType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputCompressionType.cpp index 15e265eb4d0..15f09de130b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputCompressionType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputCompressionType.cpp @@ -33,7 +33,6 @@ InputCompressionType GetInputCompressionTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InputCompressionType::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForInputCompressionType(InputCompressionType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormat.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormat.cpp index 7efdb90756c..e09cf6e3f44 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormat.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormat.cpp @@ -33,7 +33,6 @@ InputFormat GetInputFormatForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return InputFormat::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForInputFormat(InputFormat enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormatOptions.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormatOptions.cpp index e3f2430d9d6..41cbb358391 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormatOptions.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/InputFormatOptions.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { InputFormatOptions::InputFormatOptions(JsonView jsonValue) { *this = jsonValue; } -InputFormatOptions& InputFormatOptions::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Csv")) { - m_csv = jsonValue.GetObject("Csv"); - m_csvHasBeenSet = true; - } - return *this; -} +InputFormatOptions& InputFormatOptions::operator=(JsonView jsonValue) { return *this; } JsonValue InputFormatOptions::Jsonize() const { JsonValue payload; - - if (m_csvHasBeenSet) { - payload.WithObject("Csv", m_csv.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemCollectionMetrics.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemCollectionMetrics.cpp index 0ee834b0fc3..4b9aa321cea 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemCollectionMetrics.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemCollectionMetrics.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,45 +20,10 @@ namespace Model { ItemCollectionMetrics::ItemCollectionMetrics(JsonView jsonValue) { *this = jsonValue; } -ItemCollectionMetrics& ItemCollectionMetrics::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ItemCollectionKey")) { - Aws::Map itemCollectionKeyJsonMap = jsonValue.GetObject("ItemCollectionKey").GetAllObjects(); - for (auto& itemCollectionKeyItem : itemCollectionKeyJsonMap) { - m_itemCollectionKey[itemCollectionKeyItem.first] = itemCollectionKeyItem.second.AsObject(); - } - m_itemCollectionKeyHasBeenSet = true; - } - if (jsonValue.ValueExists("SizeEstimateRangeGB")) { - Aws::Utils::Array sizeEstimateRangeGBJsonList = jsonValue.GetArray("SizeEstimateRangeGB"); - for (unsigned sizeEstimateRangeGBIndex = 0; sizeEstimateRangeGBIndex < sizeEstimateRangeGBJsonList.GetLength(); - ++sizeEstimateRangeGBIndex) { - m_sizeEstimateRangeGB.push_back(sizeEstimateRangeGBJsonList[sizeEstimateRangeGBIndex].AsDouble()); - } - m_sizeEstimateRangeGBHasBeenSet = true; - } - return *this; -} +ItemCollectionMetrics& ItemCollectionMetrics::operator=(JsonView jsonValue) { return *this; } JsonValue ItemCollectionMetrics::Jsonize() const { JsonValue payload; - - if (m_itemCollectionKeyHasBeenSet) { - JsonValue itemCollectionKeyJsonMap; - for (auto& itemCollectionKeyItem : m_itemCollectionKey) { - itemCollectionKeyJsonMap.WithObject(itemCollectionKeyItem.first, itemCollectionKeyItem.second.Jsonize()); - } - payload.WithObject("ItemCollectionKey", std::move(itemCollectionKeyJsonMap)); - } - - if (m_sizeEstimateRangeGBHasBeenSet) { - Aws::Utils::Array sizeEstimateRangeGBJsonList(m_sizeEstimateRangeGB.size()); - for (unsigned sizeEstimateRangeGBIndex = 0; sizeEstimateRangeGBIndex < sizeEstimateRangeGBJsonList.GetLength(); - ++sizeEstimateRangeGBIndex) { - sizeEstimateRangeGBJsonList[sizeEstimateRangeGBIndex].AsDouble(m_sizeEstimateRangeGB[sizeEstimateRangeGBIndex]); - } - payload.WithArray("SizeEstimateRangeGB", std::move(sizeEstimateRangeGBJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemResponse.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemResponse.cpp index e1667b5e024..2e74b97120e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemResponse.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ItemResponse.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,28 +20,10 @@ namespace Model { ItemResponse::ItemResponse(JsonView jsonValue) { *this = jsonValue; } -ItemResponse& ItemResponse::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - return *this; -} +ItemResponse& ItemResponse::operator=(JsonView jsonValue) { return *this; } JsonValue ItemResponse::Jsonize() const { JsonValue payload; - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeySchemaElement.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeySchemaElement.cpp index 347129c9513..e014dcd73aa 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeySchemaElement.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeySchemaElement.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { KeySchemaElement::KeySchemaElement(JsonView jsonValue) { *this = jsonValue; } -KeySchemaElement& KeySchemaElement::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("AttributeName")) { - m_attributeName = jsonValue.GetString("AttributeName"); - m_attributeNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeyType")) { - m_keyType = KeyTypeMapper::GetKeyTypeForName(jsonValue.GetString("KeyType")); - m_keyTypeHasBeenSet = true; - } - return *this; -} +KeySchemaElement& KeySchemaElement::operator=(JsonView jsonValue) { return *this; } JsonValue KeySchemaElement::Jsonize() const { JsonValue payload; - - if (m_attributeNameHasBeenSet) { - payload.WithString("AttributeName", m_attributeName); - } - - if (m_keyTypeHasBeenSet) { - payload.WithString("KeyType", KeyTypeMapper::GetNameForKeyType(m_keyType)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeyType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeyType.cpp index e1c0174d447..05e3aacc524 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeyType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeyType.cpp @@ -30,7 +30,6 @@ KeyType GetKeyTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return KeyType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForKeyType(KeyType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeysAndAttributes.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeysAndAttributes.cpp index 509a317eda0..41c1e79d2ce 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/KeysAndAttributes.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/KeysAndAttributes.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,83 +20,10 @@ namespace Model { KeysAndAttributes::KeysAndAttributes(JsonView jsonValue) { *this = jsonValue; } -KeysAndAttributes& KeysAndAttributes::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Keys")) { - Aws::Utils::Array keysJsonList = jsonValue.GetArray("Keys"); - for (unsigned keysIndex = 0; keysIndex < keysJsonList.GetLength(); ++keysIndex) { - Aws::Map key2JsonMap = keysJsonList[keysIndex].GetAllObjects(); - Aws::Map key2Map; - for (auto& key2Item : key2JsonMap) { - key2Map[key2Item.first] = key2Item.second.AsObject(); - } - m_keys.push_back(std::move(key2Map)); - } - m_keysHasBeenSet = true; - } - if (jsonValue.ValueExists("AttributesToGet")) { - Aws::Utils::Array attributesToGetJsonList = jsonValue.GetArray("AttributesToGet"); - for (unsigned attributesToGetIndex = 0; attributesToGetIndex < attributesToGetJsonList.GetLength(); ++attributesToGetIndex) { - m_attributesToGet.push_back(attributesToGetJsonList[attributesToGetIndex].AsString()); - } - m_attributesToGetHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsistentRead")) { - m_consistentRead = jsonValue.GetBool("ConsistentRead"); - m_consistentReadHasBeenSet = true; - } - if (jsonValue.ValueExists("ProjectionExpression")) { - m_projectionExpression = jsonValue.GetString("ProjectionExpression"); - m_projectionExpressionHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeNames")) { - Aws::Map expressionAttributeNamesJsonMap = jsonValue.GetObject("ExpressionAttributeNames").GetAllObjects(); - for (auto& expressionAttributeNamesItem : expressionAttributeNamesJsonMap) { - m_expressionAttributeNames[expressionAttributeNamesItem.first] = expressionAttributeNamesItem.second.AsString(); - } - m_expressionAttributeNamesHasBeenSet = true; - } - return *this; -} +KeysAndAttributes& KeysAndAttributes::operator=(JsonView jsonValue) { return *this; } JsonValue KeysAndAttributes::Jsonize() const { JsonValue payload; - - if (m_keysHasBeenSet) { - Aws::Utils::Array keysJsonList(m_keys.size()); - for (unsigned keysIndex = 0; keysIndex < keysJsonList.GetLength(); ++keysIndex) { - JsonValue keyJsonMap; - for (auto& keyItem : m_keys[keysIndex]) { - keyJsonMap.WithObject(keyItem.first, keyItem.second.Jsonize()); - } - keysJsonList[keysIndex].AsObject(std::move(keyJsonMap)); - } - payload.WithArray("Keys", std::move(keysJsonList)); - } - - if (m_attributesToGetHasBeenSet) { - Aws::Utils::Array attributesToGetJsonList(m_attributesToGet.size()); - for (unsigned attributesToGetIndex = 0; attributesToGetIndex < attributesToGetJsonList.GetLength(); ++attributesToGetIndex) { - attributesToGetJsonList[attributesToGetIndex].AsString(m_attributesToGet[attributesToGetIndex]); - } - payload.WithArray("AttributesToGet", std::move(attributesToGetJsonList)); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/KinesisDataStreamDestination.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/KinesisDataStreamDestination.cpp index fcf40f0ff0b..36b23d1dde5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/KinesisDataStreamDestination.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/KinesisDataStreamDestination.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,48 +20,10 @@ namespace Model { KinesisDataStreamDestination::KinesisDataStreamDestination(JsonView jsonValue) { *this = jsonValue; } -KinesisDataStreamDestination& KinesisDataStreamDestination::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("StreamArn")) { - m_streamArn = jsonValue.GetString("StreamArn"); - m_streamArnHasBeenSet = true; - } - if (jsonValue.ValueExists("DestinationStatus")) { - m_destinationStatus = DestinationStatusMapper::GetDestinationStatusForName(jsonValue.GetString("DestinationStatus")); - m_destinationStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("DestinationStatusDescription")) { - m_destinationStatusDescription = jsonValue.GetString("DestinationStatusDescription"); - m_destinationStatusDescriptionHasBeenSet = true; - } - if (jsonValue.ValueExists("ApproximateCreationDateTimePrecision")) { - m_approximateCreationDateTimePrecision = ApproximateCreationDateTimePrecisionMapper::GetApproximateCreationDateTimePrecisionForName( - jsonValue.GetString("ApproximateCreationDateTimePrecision")); - m_approximateCreationDateTimePrecisionHasBeenSet = true; - } - return *this; -} +KinesisDataStreamDestination& KinesisDataStreamDestination::operator=(JsonView jsonValue) { return *this; } JsonValue KinesisDataStreamDestination::Jsonize() const { JsonValue payload; - - if (m_streamArnHasBeenSet) { - payload.WithString("StreamArn", m_streamArn); - } - - if (m_destinationStatusHasBeenSet) { - payload.WithString("DestinationStatus", DestinationStatusMapper::GetNameForDestinationStatus(m_destinationStatus)); - } - - if (m_destinationStatusDescriptionHasBeenSet) { - payload.WithString("DestinationStatusDescription", m_destinationStatusDescription); - } - - if (m_approximateCreationDateTimePrecisionHasBeenSet) { - payload.WithString( - "ApproximateCreationDateTimePrecision", - ApproximateCreationDateTimePrecisionMapper::GetNameForApproximateCreationDateTimePrecision(m_approximateCreationDateTimePrecision)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsRequest.cpp index 0cabc5a82f0..869c304af6d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsRequest.cpp @@ -3,44 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListBackupsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - if (m_timeRangeLowerBoundHasBeenSet) { - payload.WithDouble("TimeRangeLowerBound", m_timeRangeLowerBound.SecondsWithMSPrecision()); - } - - if (m_timeRangeUpperBoundHasBeenSet) { - payload.WithDouble("TimeRangeUpperBound", m_timeRangeUpperBound.SecondsWithMSPrecision()); - } - - if (m_exclusiveStartBackupArnHasBeenSet) { - payload.WithString("ExclusiveStartBackupArn", m_exclusiveStartBackupArn); - } - - if (m_backupTypeHasBeenSet) { - payload.WithString("BackupType", BackupTypeFilterMapper::GetNameForBackupTypeFilter(m_backupType)); - } - - return payload.View().WriteReadable(); -} +Aws::String ListBackupsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListBackupsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsResult.cpp index c960e7ef5d6..edc692dbb3b 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListBackupsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListBackupsResult::ListBackupsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListBackupsResult& ListBackupsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("BackupSummaries")) { - Aws::Utils::Array backupSummariesJsonList = jsonValue.GetArray("BackupSummaries"); - for (unsigned backupSummariesIndex = 0; backupSummariesIndex < backupSummariesJsonList.GetLength(); ++backupSummariesIndex) { - m_backupSummaries.push_back(backupSummariesJsonList[backupSummariesIndex].AsObject()); - } - m_backupSummariesHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedBackupArn")) { - m_lastEvaluatedBackupArn = jsonValue.GetString("LastEvaluatedBackupArn"); - m_lastEvaluatedBackupArnHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListBackupsResult& ListBackupsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsRequest.cpp index 9213a629a47..e337a8dd71d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListContributorInsightsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_nextTokenHasBeenSet) { - payload.WithString("NextToken", m_nextToken); - } - - if (m_maxResultsHasBeenSet) { - payload.WithInteger("MaxResults", m_maxResults); - } - - return payload.View().WriteReadable(); -} +Aws::String ListContributorInsightsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListContributorInsightsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsResult.cpp index b52ec083c50..bba3ced5e27 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListContributorInsightsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -20,27 +21,5 @@ using namespace Aws; ListContributorInsightsResult::ListContributorInsightsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } ListContributorInsightsResult& ListContributorInsightsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ContributorInsightsSummaries")) { - Aws::Utils::Array contributorInsightsSummariesJsonList = jsonValue.GetArray("ContributorInsightsSummaries"); - for (unsigned contributorInsightsSummariesIndex = 0; - contributorInsightsSummariesIndex < contributorInsightsSummariesJsonList.GetLength(); ++contributorInsightsSummariesIndex) { - m_contributorInsightsSummaries.push_back(contributorInsightsSummariesJsonList[contributorInsightsSummariesIndex].AsObject()); - } - m_contributorInsightsSummariesHasBeenSet = true; - } - if (jsonValue.ValueExists("NextToken")) { - m_nextToken = jsonValue.GetString("NextToken"); - m_nextTokenHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsRequest.cpp index 209e3073bad..b23af266f9c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListExportsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_maxResultsHasBeenSet) { - payload.WithInteger("MaxResults", m_maxResults); - } - - if (m_nextTokenHasBeenSet) { - payload.WithString("NextToken", m_nextToken); - } - - return payload.View().WriteReadable(); -} +Aws::String ListExportsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListExportsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsResult.cpp index 42d23968d68..015bf2fc79a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListExportsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListExportsResult::ListExportsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListExportsResult& ListExportsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ExportSummaries")) { - Aws::Utils::Array exportSummariesJsonList = jsonValue.GetArray("ExportSummaries"); - for (unsigned exportSummariesIndex = 0; exportSummariesIndex < exportSummariesJsonList.GetLength(); ++exportSummariesIndex) { - m_exportSummaries.push_back(exportSummariesJsonList[exportSummariesIndex].AsObject()); - } - m_exportSummariesHasBeenSet = true; - } - if (jsonValue.ValueExists("NextToken")) { - m_nextToken = jsonValue.GetString("NextToken"); - m_nextTokenHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListExportsResult& ListExportsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesRequest.cpp index d0c8400c4e8..998d5253b8a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListGlobalTablesRequest::SerializePayload() const { - JsonValue payload; - - if (m_exclusiveStartGlobalTableNameHasBeenSet) { - payload.WithString("ExclusiveStartGlobalTableName", m_exclusiveStartGlobalTableName); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - return payload.View().WriteReadable(); -} +Aws::String ListGlobalTablesRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListGlobalTablesRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesResult.cpp index 97daae266b7..5faf4e419dc 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListGlobalTablesResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListGlobalTablesResult::ListGlobalTablesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListGlobalTablesResult& ListGlobalTablesResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("GlobalTables")) { - Aws::Utils::Array globalTablesJsonList = jsonValue.GetArray("GlobalTables"); - for (unsigned globalTablesIndex = 0; globalTablesIndex < globalTablesJsonList.GetLength(); ++globalTablesIndex) { - m_globalTables.push_back(globalTablesJsonList[globalTablesIndex].AsObject()); - } - m_globalTablesHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedGlobalTableName")) { - m_lastEvaluatedGlobalTableName = jsonValue.GetString("LastEvaluatedGlobalTableName"); - m_lastEvaluatedGlobalTableNameHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListGlobalTablesResult& ListGlobalTablesResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsRequest.cpp index f466686cb1b..131c9cda5b8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsRequest.cpp @@ -3,32 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListImportsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableArnHasBeenSet) { - payload.WithString("TableArn", m_tableArn); - } - - if (m_pageSizeHasBeenSet) { - payload.WithInteger("PageSize", m_pageSize); - } - - if (m_nextTokenHasBeenSet) { - payload.WithString("NextToken", m_nextToken); - } - - return payload.View().WriteReadable(); -} +Aws::String ListImportsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListImportsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsResult.cpp index 91b6c2836cc..3605f70eb3f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListImportsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListImportsResult::ListImportsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListImportsResult& ListImportsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ImportSummaryList")) { - Aws::Utils::Array importSummaryListJsonList = jsonValue.GetArray("ImportSummaryList"); - for (unsigned importSummaryListIndex = 0; importSummaryListIndex < importSummaryListJsonList.GetLength(); ++importSummaryListIndex) { - m_importSummaryList.push_back(importSummaryListJsonList[importSummaryListIndex].AsObject()); - } - m_importSummaryListHasBeenSet = true; - } - if (jsonValue.ValueExists("NextToken")) { - m_nextToken = jsonValue.GetString("NextToken"); - m_nextTokenHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListImportsResult& ListImportsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesRequest.cpp index 9c996b360e1..009aa6f1aaf 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesRequest.cpp @@ -3,28 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListTablesRequest::SerializePayload() const { - JsonValue payload; - - if (m_exclusiveStartTableNameHasBeenSet) { - payload.WithString("ExclusiveStartTableName", m_exclusiveStartTableName); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - return payload.View().WriteReadable(); -} +Aws::String ListTablesRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListTablesRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesResult.cpp index 15b206fe45a..cf764b64838 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTablesResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListTablesResult::ListTablesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListTablesResult& ListTablesResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableNames")) { - Aws::Utils::Array tableNamesJsonList = jsonValue.GetArray("TableNames"); - for (unsigned tableNamesIndex = 0; tableNamesIndex < tableNamesJsonList.GetLength(); ++tableNamesIndex) { - m_tableNames.push_back(tableNamesJsonList[tableNamesIndex].AsString()); - } - m_tableNamesHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedTableName")) { - m_lastEvaluatedTableName = jsonValue.GetString("LastEvaluatedTableName"); - m_lastEvaluatedTableNameHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListTablesResult& ListTablesResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceRequest.cpp index 9887cc27e3c..fb027f7e6db 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceRequest.cpp @@ -3,28 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ListTagsOfResourceRequest::SerializePayload() const { - JsonValue payload; - - if (m_resourceArnHasBeenSet) { - payload.WithString("ResourceArn", m_resourceArn); - } - - if (m_nextTokenHasBeenSet) { - payload.WithString("NextToken", m_nextToken); - } - - return payload.View().WriteReadable(); -} +Aws::String ListTagsOfResourceRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ListTagsOfResourceRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceResult.cpp index db668009700..0fbe2896a9e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ListTagsOfResourceResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; ListTagsOfResourceResult::ListTagsOfResourceResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ListTagsOfResourceResult& ListTagsOfResourceResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Tags")) { - Aws::Utils::Array tagsJsonList = jsonValue.GetArray("Tags"); - for (unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { - m_tags.push_back(tagsJsonList[tagsIndex].AsObject()); - } - m_tagsHasBeenSet = true; - } - if (jsonValue.ValueExists("NextToken")) { - m_nextToken = jsonValue.GetString("NextToken"); - m_nextTokenHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ListTagsOfResourceResult& ListTagsOfResourceResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndex.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndex.cpp index 298b1c7e6ef..3ea23e540dd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndex.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndex.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,44 +20,10 @@ namespace Model { LocalSecondaryIndex::LocalSecondaryIndex(JsonView jsonValue) { *this = jsonValue; } -LocalSecondaryIndex& LocalSecondaryIndex::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - return *this; -} +LocalSecondaryIndex& LocalSecondaryIndex::operator=(JsonView jsonValue) { return *this; } JsonValue LocalSecondaryIndex::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexDescription.cpp index 0c6ec85c8b0..1ee8535b828 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,68 +20,10 @@ namespace Model { LocalSecondaryIndexDescription::LocalSecondaryIndexDescription(JsonView jsonValue) { *this = jsonValue; } -LocalSecondaryIndexDescription& LocalSecondaryIndexDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexSizeBytes")) { - m_indexSizeBytes = jsonValue.GetInt64("IndexSizeBytes"); - m_indexSizeBytesHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCount")) { - m_itemCount = jsonValue.GetInt64("ItemCount"); - m_itemCountHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexArn")) { - m_indexArn = jsonValue.GetString("IndexArn"); - m_indexArnHasBeenSet = true; - } - return *this; -} +LocalSecondaryIndexDescription& LocalSecondaryIndexDescription::operator=(JsonView jsonValue) { return *this; } JsonValue LocalSecondaryIndexDescription::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - - if (m_indexSizeBytesHasBeenSet) { - payload.WithInt64("IndexSizeBytes", m_indexSizeBytes); - } - - if (m_itemCountHasBeenSet) { - payload.WithInt64("ItemCount", m_itemCount); - } - - if (m_indexArnHasBeenSet) { - payload.WithString("IndexArn", m_indexArn); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexInfo.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexInfo.cpp index 8dc0f0d9778..f927b33f176 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexInfo.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/LocalSecondaryIndexInfo.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,44 +20,10 @@ namespace Model { LocalSecondaryIndexInfo::LocalSecondaryIndexInfo(JsonView jsonValue) { *this = jsonValue; } -LocalSecondaryIndexInfo& LocalSecondaryIndexInfo::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("KeySchema")) { - Aws::Utils::Array keySchemaJsonList = jsonValue.GetArray("KeySchema"); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - m_keySchema.push_back(keySchemaJsonList[keySchemaIndex].AsObject()); - } - m_keySchemaHasBeenSet = true; - } - if (jsonValue.ValueExists("Projection")) { - m_projection = jsonValue.GetObject("Projection"); - m_projectionHasBeenSet = true; - } - return *this; -} +LocalSecondaryIndexInfo& LocalSecondaryIndexInfo::operator=(JsonView jsonValue) { return *this; } JsonValue LocalSecondaryIndexInfo::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_keySchemaHasBeenSet) { - Aws::Utils::Array keySchemaJsonList(m_keySchema.size()); - for (unsigned keySchemaIndex = 0; keySchemaIndex < keySchemaJsonList.GetLength(); ++keySchemaIndex) { - keySchemaJsonList[keySchemaIndex].AsObject(m_keySchema[keySchemaIndex].Jsonize()); - } - payload.WithArray("KeySchema", std::move(keySchemaJsonList)); - } - - if (m_projectionHasBeenSet) { - payload.WithObject("Projection", m_projection.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/MultiRegionConsistency.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/MultiRegionConsistency.cpp index 9f8601e2b9c..862a0f06ac7 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/MultiRegionConsistency.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/MultiRegionConsistency.cpp @@ -30,7 +30,6 @@ MultiRegionConsistency GetMultiRegionConsistencyForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return MultiRegionConsistency::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForMultiRegionConsistency(MultiRegionConsistency enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughput.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughput.cpp index e162fe94770..f9ebdbf609f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughput.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughput.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { OnDemandThroughput::OnDemandThroughput(JsonView jsonValue) { *this = jsonValue; } -OnDemandThroughput& OnDemandThroughput::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("MaxReadRequestUnits")) { - m_maxReadRequestUnits = jsonValue.GetInt64("MaxReadRequestUnits"); - m_maxReadRequestUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("MaxWriteRequestUnits")) { - m_maxWriteRequestUnits = jsonValue.GetInt64("MaxWriteRequestUnits"); - m_maxWriteRequestUnitsHasBeenSet = true; - } - return *this; -} +OnDemandThroughput& OnDemandThroughput::operator=(JsonView jsonValue) { return *this; } JsonValue OnDemandThroughput::Jsonize() const { JsonValue payload; - - if (m_maxReadRequestUnitsHasBeenSet) { - payload.WithInt64("MaxReadRequestUnits", m_maxReadRequestUnits); - } - - if (m_maxWriteRequestUnitsHasBeenSet) { - payload.WithInt64("MaxWriteRequestUnits", m_maxWriteRequestUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughputOverride.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughputOverride.cpp index 12d895894c8..2f6f179b7b4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughputOverride.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/OnDemandThroughputOverride.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { OnDemandThroughputOverride::OnDemandThroughputOverride(JsonView jsonValue) { *this = jsonValue; } -OnDemandThroughputOverride& OnDemandThroughputOverride::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("MaxReadRequestUnits")) { - m_maxReadRequestUnits = jsonValue.GetInt64("MaxReadRequestUnits"); - m_maxReadRequestUnitsHasBeenSet = true; - } - return *this; -} +OnDemandThroughputOverride& OnDemandThroughputOverride::operator=(JsonView jsonValue) { return *this; } JsonValue OnDemandThroughputOverride::Jsonize() const { JsonValue payload; - - if (m_maxReadRequestUnitsHasBeenSet) { - payload.WithInt64("MaxReadRequestUnits", m_maxReadRequestUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ParameterizedStatement.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ParameterizedStatement.cpp index af62c8d3d8f..4e1f88cf773 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ParameterizedStatement.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ParameterizedStatement.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,47 +20,10 @@ namespace Model { ParameterizedStatement::ParameterizedStatement(JsonView jsonValue) { *this = jsonValue; } -ParameterizedStatement& ParameterizedStatement::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Statement")) { - m_statement = jsonValue.GetString("Statement"); - m_statementHasBeenSet = true; - } - if (jsonValue.ValueExists("Parameters")) { - Aws::Utils::Array parametersJsonList = jsonValue.GetArray("Parameters"); - for (unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { - m_parameters.push_back(parametersJsonList[parametersIndex].AsObject()); - } - m_parametersHasBeenSet = true; - } - if (jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { - m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName( - jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); - m_returnValuesOnConditionCheckFailureHasBeenSet = true; - } - return *this; -} +ParameterizedStatement& ParameterizedStatement::operator=(JsonView jsonValue) { return *this; } JsonValue ParameterizedStatement::Jsonize() const { JsonValue payload; - - if (m_statementHasBeenSet) { - payload.WithString("Statement", m_statement); - } - - if (m_parametersHasBeenSet) { - Aws::Utils::Array parametersJsonList(m_parameters.size()); - for (unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { - parametersJsonList[parametersIndex].AsObject(m_parameters[parametersIndex].Jsonize()); - } - payload.WithArray("Parameters", std::move(parametersJsonList)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryDescription.cpp index 1a55651a0c9..e04f912d93a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,47 +20,10 @@ namespace Model { PointInTimeRecoveryDescription::PointInTimeRecoveryDescription(JsonView jsonValue) { *this = jsonValue; } -PointInTimeRecoveryDescription& PointInTimeRecoveryDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("PointInTimeRecoveryStatus")) { - m_pointInTimeRecoveryStatus = - PointInTimeRecoveryStatusMapper::GetPointInTimeRecoveryStatusForName(jsonValue.GetString("PointInTimeRecoveryStatus")); - m_pointInTimeRecoveryStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("RecoveryPeriodInDays")) { - m_recoveryPeriodInDays = jsonValue.GetInteger("RecoveryPeriodInDays"); - m_recoveryPeriodInDaysHasBeenSet = true; - } - if (jsonValue.ValueExists("EarliestRestorableDateTime")) { - m_earliestRestorableDateTime = jsonValue.GetDouble("EarliestRestorableDateTime"); - m_earliestRestorableDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("LatestRestorableDateTime")) { - m_latestRestorableDateTime = jsonValue.GetDouble("LatestRestorableDateTime"); - m_latestRestorableDateTimeHasBeenSet = true; - } - return *this; -} +PointInTimeRecoveryDescription& PointInTimeRecoveryDescription::operator=(JsonView jsonValue) { return *this; } JsonValue PointInTimeRecoveryDescription::Jsonize() const { JsonValue payload; - - if (m_pointInTimeRecoveryStatusHasBeenSet) { - payload.WithString("PointInTimeRecoveryStatus", - PointInTimeRecoveryStatusMapper::GetNameForPointInTimeRecoveryStatus(m_pointInTimeRecoveryStatus)); - } - - if (m_recoveryPeriodInDaysHasBeenSet) { - payload.WithInteger("RecoveryPeriodInDays", m_recoveryPeriodInDays); - } - - if (m_earliestRestorableDateTimeHasBeenSet) { - payload.WithDouble("EarliestRestorableDateTime", m_earliestRestorableDateTime.SecondsWithMSPrecision()); - } - - if (m_latestRestorableDateTimeHasBeenSet) { - payload.WithDouble("LatestRestorableDateTime", m_latestRestorableDateTime.SecondsWithMSPrecision()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoverySpecification.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoverySpecification.cpp index fa9ed36b4da..ff32e81fd5e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoverySpecification.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoverySpecification.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { PointInTimeRecoverySpecification::PointInTimeRecoverySpecification(JsonView jsonValue) { *this = jsonValue; } -PointInTimeRecoverySpecification& PointInTimeRecoverySpecification::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("PointInTimeRecoveryEnabled")) { - m_pointInTimeRecoveryEnabled = jsonValue.GetBool("PointInTimeRecoveryEnabled"); - m_pointInTimeRecoveryEnabledHasBeenSet = true; - } - if (jsonValue.ValueExists("RecoveryPeriodInDays")) { - m_recoveryPeriodInDays = jsonValue.GetInteger("RecoveryPeriodInDays"); - m_recoveryPeriodInDaysHasBeenSet = true; - } - return *this; -} +PointInTimeRecoverySpecification& PointInTimeRecoverySpecification::operator=(JsonView jsonValue) { return *this; } JsonValue PointInTimeRecoverySpecification::Jsonize() const { JsonValue payload; - - if (m_pointInTimeRecoveryEnabledHasBeenSet) { - payload.WithBool("PointInTimeRecoveryEnabled", m_pointInTimeRecoveryEnabled); - } - - if (m_recoveryPeriodInDaysHasBeenSet) { - payload.WithInteger("RecoveryPeriodInDays", m_recoveryPeriodInDays); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryStatus.cpp index c24f9cb97e1..ecc685aed07 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PointInTimeRecoveryStatus.cpp @@ -30,7 +30,6 @@ PointInTimeRecoveryStatus GetPointInTimeRecoveryStatusForName(const Aws::String& overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return PointInTimeRecoveryStatus::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForPointInTimeRecoveryStatus(PointInTimeRecoveryStatus enumVa if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Projection.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Projection.cpp index c1b4fe97ca2..a0e08435955 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Projection.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Projection.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { Projection::Projection(JsonView jsonValue) { *this = jsonValue; } -Projection& Projection::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ProjectionType")) { - m_projectionType = ProjectionTypeMapper::GetProjectionTypeForName(jsonValue.GetString("ProjectionType")); - m_projectionTypeHasBeenSet = true; - } - if (jsonValue.ValueExists("NonKeyAttributes")) { - Aws::Utils::Array nonKeyAttributesJsonList = jsonValue.GetArray("NonKeyAttributes"); - for (unsigned nonKeyAttributesIndex = 0; nonKeyAttributesIndex < nonKeyAttributesJsonList.GetLength(); ++nonKeyAttributesIndex) { - m_nonKeyAttributes.push_back(nonKeyAttributesJsonList[nonKeyAttributesIndex].AsString()); - } - m_nonKeyAttributesHasBeenSet = true; - } - return *this; -} +Projection& Projection::operator=(JsonView jsonValue) { return *this; } JsonValue Projection::Jsonize() const { JsonValue payload; - - if (m_projectionTypeHasBeenSet) { - payload.WithString("ProjectionType", ProjectionTypeMapper::GetNameForProjectionType(m_projectionType)); - } - - if (m_nonKeyAttributesHasBeenSet) { - Aws::Utils::Array nonKeyAttributesJsonList(m_nonKeyAttributes.size()); - for (unsigned nonKeyAttributesIndex = 0; nonKeyAttributesIndex < nonKeyAttributesJsonList.GetLength(); ++nonKeyAttributesIndex) { - nonKeyAttributesJsonList[nonKeyAttributesIndex].AsString(m_nonKeyAttributes[nonKeyAttributesIndex]); - } - payload.WithArray("NonKeyAttributes", std::move(nonKeyAttributesJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProjectionType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProjectionType.cpp index 0e3da8a562a..3f16ec76d5d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProjectionType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProjectionType.cpp @@ -33,7 +33,6 @@ ProjectionType GetProjectionTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ProjectionType::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForProjectionType(ProjectionType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughput.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughput.cpp index bb526b28c6d..9c08948c239 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughput.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughput.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { ProvisionedThroughput::ProvisionedThroughput(JsonView jsonValue) { *this = jsonValue; } -ProvisionedThroughput& ProvisionedThroughput::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ReadCapacityUnits")) { - m_readCapacityUnits = jsonValue.GetInt64("ReadCapacityUnits"); - m_readCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("WriteCapacityUnits")) { - m_writeCapacityUnits = jsonValue.GetInt64("WriteCapacityUnits"); - m_writeCapacityUnitsHasBeenSet = true; - } - return *this; -} +ProvisionedThroughput& ProvisionedThroughput::operator=(JsonView jsonValue) { return *this; } JsonValue ProvisionedThroughput::Jsonize() const { JsonValue payload; - - if (m_readCapacityUnitsHasBeenSet) { - payload.WithInt64("ReadCapacityUnits", m_readCapacityUnits); - } - - if (m_writeCapacityUnitsHasBeenSet) { - payload.WithInt64("WriteCapacityUnits", m_writeCapacityUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputDescription.cpp index 25994bc0e39..d01c1d559b8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,53 +20,10 @@ namespace Model { ProvisionedThroughputDescription::ProvisionedThroughputDescription(JsonView jsonValue) { *this = jsonValue; } -ProvisionedThroughputDescription& ProvisionedThroughputDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("LastIncreaseDateTime")) { - m_lastIncreaseDateTime = jsonValue.GetDouble("LastIncreaseDateTime"); - m_lastIncreaseDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("LastDecreaseDateTime")) { - m_lastDecreaseDateTime = jsonValue.GetDouble("LastDecreaseDateTime"); - m_lastDecreaseDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("NumberOfDecreasesToday")) { - m_numberOfDecreasesToday = jsonValue.GetInt64("NumberOfDecreasesToday"); - m_numberOfDecreasesTodayHasBeenSet = true; - } - if (jsonValue.ValueExists("ReadCapacityUnits")) { - m_readCapacityUnits = jsonValue.GetInt64("ReadCapacityUnits"); - m_readCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("WriteCapacityUnits")) { - m_writeCapacityUnits = jsonValue.GetInt64("WriteCapacityUnits"); - m_writeCapacityUnitsHasBeenSet = true; - } - return *this; -} +ProvisionedThroughputDescription& ProvisionedThroughputDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ProvisionedThroughputDescription::Jsonize() const { JsonValue payload; - - if (m_lastIncreaseDateTimeHasBeenSet) { - payload.WithDouble("LastIncreaseDateTime", m_lastIncreaseDateTime.SecondsWithMSPrecision()); - } - - if (m_lastDecreaseDateTimeHasBeenSet) { - payload.WithDouble("LastDecreaseDateTime", m_lastDecreaseDateTime.SecondsWithMSPrecision()); - } - - if (m_numberOfDecreasesTodayHasBeenSet) { - payload.WithInt64("NumberOfDecreasesToday", m_numberOfDecreasesToday); - } - - if (m_readCapacityUnitsHasBeenSet) { - payload.WithInt64("ReadCapacityUnits", m_readCapacityUnits); - } - - if (m_writeCapacityUnitsHasBeenSet) { - payload.WithInt64("WriteCapacityUnits", m_writeCapacityUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputExceededException.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputExceededException.cpp index 43e3eb4dda1..2862b4f0f50 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputExceededException.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputExceededException.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { ProvisionedThroughputExceededException::ProvisionedThroughputExceededException(JsonView jsonValue) { *this = jsonValue; } -ProvisionedThroughputExceededException& ProvisionedThroughputExceededException::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("message")) { - m_message = jsonValue.GetString("message"); - m_messageHasBeenSet = true; - } - if (jsonValue.ValueExists("ThrottlingReasons")) { - Aws::Utils::Array throttlingReasonsJsonList = jsonValue.GetArray("ThrottlingReasons"); - for (unsigned throttlingReasonsIndex = 0; throttlingReasonsIndex < throttlingReasonsJsonList.GetLength(); ++throttlingReasonsIndex) { - m_throttlingReasons.push_back(throttlingReasonsJsonList[throttlingReasonsIndex].AsObject()); - } - m_throttlingReasonsHasBeenSet = true; - } - return *this; -} +ProvisionedThroughputExceededException& ProvisionedThroughputExceededException::operator=(JsonView jsonValue) { return *this; } JsonValue ProvisionedThroughputExceededException::Jsonize() const { JsonValue payload; - - if (m_messageHasBeenSet) { - payload.WithString("message", m_message); - } - - if (m_throttlingReasonsHasBeenSet) { - Aws::Utils::Array throttlingReasonsJsonList(m_throttlingReasons.size()); - for (unsigned throttlingReasonsIndex = 0; throttlingReasonsIndex < throttlingReasonsJsonList.GetLength(); ++throttlingReasonsIndex) { - throttlingReasonsJsonList[throttlingReasonsIndex].AsObject(m_throttlingReasons[throttlingReasonsIndex].Jsonize()); - } - payload.WithArray("ThrottlingReasons", std::move(throttlingReasonsJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputOverride.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputOverride.cpp index 0b944cf04a2..35cd5f8bde5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputOverride.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ProvisionedThroughputOverride.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { ProvisionedThroughputOverride::ProvisionedThroughputOverride(JsonView jsonValue) { *this = jsonValue; } -ProvisionedThroughputOverride& ProvisionedThroughputOverride::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("ReadCapacityUnits")) { - m_readCapacityUnits = jsonValue.GetInt64("ReadCapacityUnits"); - m_readCapacityUnitsHasBeenSet = true; - } - return *this; -} +ProvisionedThroughputOverride& ProvisionedThroughputOverride::operator=(JsonView jsonValue) { return *this; } JsonValue ProvisionedThroughputOverride::Jsonize() const { JsonValue payload; - - if (m_readCapacityUnitsHasBeenSet) { - payload.WithInt64("ReadCapacityUnits", m_readCapacityUnits); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Put.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Put.cpp index df0267ad04d..82106c094cd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Put.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Put.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,85 +20,10 @@ namespace Model { Put::Put(JsonView jsonValue) { *this = jsonValue; } -Put& Put::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - if (jsonValue.ValueExists("TableName")) { - m_tableName = jsonValue.GetString("TableName"); - m_tableNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ConditionExpression")) { - m_conditionExpression = jsonValue.GetString("ConditionExpression"); - m_conditionExpressionHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeNames")) { - Aws::Map expressionAttributeNamesJsonMap = jsonValue.GetObject("ExpressionAttributeNames").GetAllObjects(); - for (auto& expressionAttributeNamesItem : expressionAttributeNamesJsonMap) { - m_expressionAttributeNames[expressionAttributeNamesItem.first] = expressionAttributeNamesItem.second.AsString(); - } - m_expressionAttributeNamesHasBeenSet = true; - } - if (jsonValue.ValueExists("ExpressionAttributeValues")) { - Aws::Map expressionAttributeValuesJsonMap = jsonValue.GetObject("ExpressionAttributeValues").GetAllObjects(); - for (auto& expressionAttributeValuesItem : expressionAttributeValuesJsonMap) { - m_expressionAttributeValues[expressionAttributeValuesItem.first] = expressionAttributeValuesItem.second.AsObject(); - } - m_expressionAttributeValuesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { - m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName( - jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); - m_returnValuesOnConditionCheckFailureHasBeenSet = true; - } - return *this; -} +Put& Put::operator=(JsonView jsonValue) { return *this; } JsonValue Put::Jsonize() const { JsonValue payload; - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_conditionExpressionHasBeenSet) { - payload.WithString("ConditionExpression", m_conditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemRequest.cpp index 86388afb909..c3dc46586fb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemRequest.cpp @@ -3,83 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String PutItemRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - - if (m_expectedHasBeenSet) { - JsonValue expectedJsonMap; - for (auto& expectedItem : m_expected) { - expectedJsonMap.WithObject(expectedItem.first, expectedItem.second.Jsonize()); - } - payload.WithObject("Expected", std::move(expectedJsonMap)); - } - - if (m_returnValuesHasBeenSet) { - payload.WithString("ReturnValues", ReturnValueMapper::GetNameForReturnValue(m_returnValues)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_returnItemCollectionMetricsHasBeenSet) { - payload.WithString("ReturnItemCollectionMetrics", - ReturnItemCollectionMetricsMapper::GetNameForReturnItemCollectionMetrics(m_returnItemCollectionMetrics)); - } - - if (m_conditionalOperatorHasBeenSet) { - payload.WithString("ConditionalOperator", ConditionalOperatorMapper::GetNameForConditionalOperator(m_conditionalOperator)); - } - - if (m_conditionExpressionHasBeenSet) { - payload.WithString("ConditionExpression", m_conditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_returnValuesOnConditionCheckFailureHasBeenSet) { - payload.WithString( - "ReturnValuesOnConditionCheckFailure", - ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); - } - - return payload.View().WriteReadable(); -} +Aws::String PutItemRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection PutItemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemResult.cpp index b393e8af7d0..7c511427dbd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutItemResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,31 +20,4 @@ using namespace Aws; PutItemResult::PutItemResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutItemResult& PutItemResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Attributes")) { - Aws::Map attributesJsonMap = jsonValue.GetObject("Attributes").GetAllObjects(); - for (auto& attributesItem : attributesJsonMap) { - m_attributes[attributesItem.first] = attributesItem.second.AsObject(); - } - m_attributesHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - if (jsonValue.ValueExists("ItemCollectionMetrics")) { - m_itemCollectionMetrics = jsonValue.GetObject("ItemCollectionMetrics"); - m_itemCollectionMetricsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutItemResult& PutItemResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutRequest.cpp index 00a27c219b5..c90a6f4586f 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutRequest.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,28 +20,10 @@ namespace Model { PutRequest::PutRequest(JsonView jsonValue) { *this = jsonValue; } -PutRequest& PutRequest::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - return *this; -} +PutRequest& PutRequest::operator=(JsonView jsonValue) { return *this; } JsonValue PutRequest::Jsonize() const { JsonValue payload; - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyRequest.cpp index 5b43d585cce..720711b5a62 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyRequest.cpp @@ -3,36 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String PutResourcePolicyRequest::SerializePayload() const { - JsonValue payload; - - if (m_resourceArnHasBeenSet) { - payload.WithString("ResourceArn", m_resourceArn); - } - - if (m_policyHasBeenSet) { - payload.WithString("Policy", m_policy); - } - - if (m_expectedRevisionIdHasBeenSet) { - payload.WithString("ExpectedRevisionId", m_expectedRevisionId); - } - - if (m_confirmRemoveSelfResourceAccessHasBeenSet) { - payload.WithBool("ConfirmRemoveSelfResourceAccess", m_confirmRemoveSelfResourceAccess); - } - - return payload.View().WriteReadable(); -} +Aws::String PutResourcePolicyRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection PutResourcePolicyRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyResult.cpp index 5d077da4353..f44e7ba7b3e 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/PutResourcePolicyResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,20 +20,4 @@ using namespace Aws; PutResourcePolicyResult::PutResourcePolicyResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -PutResourcePolicyResult& PutResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("RevisionId")) { - m_revisionId = jsonValue.GetString("RevisionId"); - m_revisionIdHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +PutResourcePolicyResult& PutResourcePolicyResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryRequest.cpp index 326bbeb5d52..4d08eb42684 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryRequest.cpp @@ -3,112 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String QueryRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_selectHasBeenSet) { - payload.WithString("Select", SelectMapper::GetNameForSelect(m_select)); - } - - if (m_attributesToGetHasBeenSet) { - Aws::Utils::Array attributesToGetJsonList(m_attributesToGet.size()); - for (unsigned attributesToGetIndex = 0; attributesToGetIndex < attributesToGetJsonList.GetLength(); ++attributesToGetIndex) { - attributesToGetJsonList[attributesToGetIndex].AsString(m_attributesToGet[attributesToGetIndex]); - } - payload.WithArray("AttributesToGet", std::move(attributesToGetJsonList)); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - if (m_keyConditionsHasBeenSet) { - JsonValue keyConditionsJsonMap; - for (auto& keyConditionsItem : m_keyConditions) { - keyConditionsJsonMap.WithObject(keyConditionsItem.first, keyConditionsItem.second.Jsonize()); - } - payload.WithObject("KeyConditions", std::move(keyConditionsJsonMap)); - } - - if (m_queryFilterHasBeenSet) { - JsonValue queryFilterJsonMap; - for (auto& queryFilterItem : m_queryFilter) { - queryFilterJsonMap.WithObject(queryFilterItem.first, queryFilterItem.second.Jsonize()); - } - payload.WithObject("QueryFilter", std::move(queryFilterJsonMap)); - } - - if (m_conditionalOperatorHasBeenSet) { - payload.WithString("ConditionalOperator", ConditionalOperatorMapper::GetNameForConditionalOperator(m_conditionalOperator)); - } - - if (m_scanIndexForwardHasBeenSet) { - payload.WithBool("ScanIndexForward", m_scanIndexForward); - } - - if (m_exclusiveStartKeyHasBeenSet) { - JsonValue exclusiveStartKeyJsonMap; - for (auto& exclusiveStartKeyItem : m_exclusiveStartKey) { - exclusiveStartKeyJsonMap.WithObject(exclusiveStartKeyItem.first, exclusiveStartKeyItem.second.Jsonize()); - } - payload.WithObject("ExclusiveStartKey", std::move(exclusiveStartKeyJsonMap)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_filterExpressionHasBeenSet) { - payload.WithString("FilterExpression", m_filterExpression); - } - - if (m_keyConditionExpressionHasBeenSet) { - payload.WithString("KeyConditionExpression", m_keyConditionExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - return payload.View().WriteReadable(); -} +Aws::String QueryRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection QueryRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryResult.cpp index debf5135056..27fac514068 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/QueryResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,47 +20,4 @@ using namespace Aws; QueryResult::QueryResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -QueryResult& QueryResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Items")) { - Aws::Utils::Array itemsJsonList = jsonValue.GetArray("Items"); - for (unsigned itemsIndex = 0; itemsIndex < itemsJsonList.GetLength(); ++itemsIndex) { - Aws::Map attributeMap2JsonMap = itemsJsonList[itemsIndex].GetAllObjects(); - Aws::Map attributeMap2Map; - for (auto& attributeMap2Item : attributeMap2JsonMap) { - attributeMap2Map[attributeMap2Item.first] = attributeMap2Item.second.AsObject(); - } - m_items.push_back(std::move(attributeMap2Map)); - } - m_itemsHasBeenSet = true; - } - if (jsonValue.ValueExists("Count")) { - m_count = jsonValue.GetInteger("Count"); - m_countHasBeenSet = true; - } - if (jsonValue.ValueExists("ScannedCount")) { - m_scannedCount = jsonValue.GetInteger("ScannedCount"); - m_scannedCountHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedKey")) { - Aws::Map lastEvaluatedKeyJsonMap = jsonValue.GetObject("LastEvaluatedKey").GetAllObjects(); - for (auto& lastEvaluatedKeyItem : lastEvaluatedKeyJsonMap) { - m_lastEvaluatedKey[lastEvaluatedKeyItem.first] = lastEvaluatedKeyItem.second.AsObject(); - } - m_lastEvaluatedKeyHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +QueryResult& QueryResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Replica.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Replica.cpp index e057e96efa9..4c973dd09d4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Replica.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Replica.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,21 +20,10 @@ namespace Model { Replica::Replica(JsonView jsonValue) { *this = jsonValue; } -Replica& Replica::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - return *this; -} +Replica& Replica::operator=(JsonView jsonValue) { return *this; } JsonValue Replica::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingDescription.cpp index 5645f8670d8..e34805a446a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,63 +20,10 @@ namespace Model { ReplicaAutoScalingDescription::ReplicaAutoScalingDescription(JsonView jsonValue) { *this = jsonValue; } -ReplicaAutoScalingDescription& ReplicaAutoScalingDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalSecondaryIndexes")) { - Aws::Utils::Array globalSecondaryIndexesJsonList = jsonValue.GetArray("GlobalSecondaryIndexes"); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - m_globalSecondaryIndexes.push_back(globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject()); - } - m_globalSecondaryIndexesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityAutoScalingSettings")) { - m_replicaProvisionedReadCapacityAutoScalingSettings = jsonValue.GetObject("ReplicaProvisionedReadCapacityAutoScalingSettings"); - m_replicaProvisionedReadCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedWriteCapacityAutoScalingSettings")) { - m_replicaProvisionedWriteCapacityAutoScalingSettings = jsonValue.GetObject("ReplicaProvisionedWriteCapacityAutoScalingSettings"); - m_replicaProvisionedWriteCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaStatus")) { - m_replicaStatus = ReplicaStatusMapper::GetReplicaStatusForName(jsonValue.GetString("ReplicaStatus")); - m_replicaStatusHasBeenSet = true; - } - return *this; -} +ReplicaAutoScalingDescription& ReplicaAutoScalingDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaAutoScalingDescription::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_globalSecondaryIndexesHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexesJsonList(m_globalSecondaryIndexes.size()); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject(m_globalSecondaryIndexes[globalSecondaryIndexesIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexes", std::move(globalSecondaryIndexesJsonList)); - } - - if (m_replicaProvisionedReadCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ReplicaProvisionedReadCapacityAutoScalingSettings", m_replicaProvisionedReadCapacityAutoScalingSettings.Jsonize()); - } - - if (m_replicaProvisionedWriteCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ReplicaProvisionedWriteCapacityAutoScalingSettings", - m_replicaProvisionedWriteCapacityAutoScalingSettings.Jsonize()); - } - - if (m_replicaStatusHasBeenSet) { - payload.WithString("ReplicaStatus", ReplicaStatusMapper::GetNameForReplicaStatus(m_replicaStatus)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingUpdate.cpp index 59e2149899b..c1e412a37b3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaAutoScalingUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,50 +20,10 @@ namespace Model { ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicaAutoScalingUpdate& ReplicaAutoScalingUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaGlobalSecondaryIndexUpdates")) { - Aws::Utils::Array replicaGlobalSecondaryIndexUpdatesJsonList = jsonValue.GetArray("ReplicaGlobalSecondaryIndexUpdates"); - for (unsigned replicaGlobalSecondaryIndexUpdatesIndex = 0; - replicaGlobalSecondaryIndexUpdatesIndex < replicaGlobalSecondaryIndexUpdatesJsonList.GetLength(); - ++replicaGlobalSecondaryIndexUpdatesIndex) { - m_replicaGlobalSecondaryIndexUpdates.push_back( - replicaGlobalSecondaryIndexUpdatesJsonList[replicaGlobalSecondaryIndexUpdatesIndex].AsObject()); - } - m_replicaGlobalSecondaryIndexUpdatesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityAutoScalingUpdate")) { - m_replicaProvisionedReadCapacityAutoScalingUpdate = jsonValue.GetObject("ReplicaProvisionedReadCapacityAutoScalingUpdate"); - m_replicaProvisionedReadCapacityAutoScalingUpdateHasBeenSet = true; - } - return *this; -} +ReplicaAutoScalingUpdate& ReplicaAutoScalingUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaAutoScalingUpdate::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_replicaGlobalSecondaryIndexUpdatesHasBeenSet) { - Aws::Utils::Array replicaGlobalSecondaryIndexUpdatesJsonList(m_replicaGlobalSecondaryIndexUpdates.size()); - for (unsigned replicaGlobalSecondaryIndexUpdatesIndex = 0; - replicaGlobalSecondaryIndexUpdatesIndex < replicaGlobalSecondaryIndexUpdatesJsonList.GetLength(); - ++replicaGlobalSecondaryIndexUpdatesIndex) { - replicaGlobalSecondaryIndexUpdatesJsonList[replicaGlobalSecondaryIndexUpdatesIndex].AsObject( - m_replicaGlobalSecondaryIndexUpdates[replicaGlobalSecondaryIndexUpdatesIndex].Jsonize()); - } - payload.WithArray("ReplicaGlobalSecondaryIndexUpdates", std::move(replicaGlobalSecondaryIndexUpdatesJsonList)); - } - - if (m_replicaProvisionedReadCapacityAutoScalingUpdateHasBeenSet) { - payload.WithObject("ReplicaProvisionedReadCapacityAutoScalingUpdate", m_replicaProvisionedReadCapacityAutoScalingUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaDescription.cpp index 481ef6f2fb0..77993c3f939 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,129 +20,10 @@ namespace Model { ReplicaDescription::ReplicaDescription(JsonView jsonValue) { *this = jsonValue; } -ReplicaDescription& ReplicaDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaStatus")) { - m_replicaStatus = ReplicaStatusMapper::GetReplicaStatusForName(jsonValue.GetString("ReplicaStatus")); - m_replicaStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaArn")) { - m_replicaArn = jsonValue.GetString("ReplicaArn"); - m_replicaArnHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaStatusDescription")) { - m_replicaStatusDescription = jsonValue.GetString("ReplicaStatusDescription"); - m_replicaStatusDescriptionHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaStatusPercentProgress")) { - m_replicaStatusPercentProgress = jsonValue.GetString("ReplicaStatusPercentProgress"); - m_replicaStatusPercentProgressHasBeenSet = true; - } - if (jsonValue.ValueExists("KMSMasterKeyId")) { - m_kMSMasterKeyId = jsonValue.GetString("KMSMasterKeyId"); - m_kMSMasterKeyIdHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughputOverride")) { - m_provisionedThroughputOverride = jsonValue.GetObject("ProvisionedThroughputOverride"); - m_provisionedThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughputOverride")) { - m_onDemandThroughputOverride = jsonValue.GetObject("OnDemandThroughputOverride"); - m_onDemandThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("WarmThroughput")) { - m_warmThroughput = jsonValue.GetObject("WarmThroughput"); - m_warmThroughputHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalSecondaryIndexes")) { - Aws::Utils::Array globalSecondaryIndexesJsonList = jsonValue.GetArray("GlobalSecondaryIndexes"); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - m_globalSecondaryIndexes.push_back(globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject()); - } - m_globalSecondaryIndexesHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaInaccessibleDateTime")) { - m_replicaInaccessibleDateTime = jsonValue.GetDouble("ReplicaInaccessibleDateTime"); - m_replicaInaccessibleDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaTableClassSummary")) { - m_replicaTableClassSummary = jsonValue.GetObject("ReplicaTableClassSummary"); - m_replicaTableClassSummaryHasBeenSet = true; - } - if (jsonValue.ValueExists("GlobalTableSettingsReplicationMode")) { - m_globalTableSettingsReplicationMode = GlobalTableSettingsReplicationModeMapper::GetGlobalTableSettingsReplicationModeForName( - jsonValue.GetString("GlobalTableSettingsReplicationMode")); - m_globalTableSettingsReplicationModeHasBeenSet = true; - } - return *this; -} +ReplicaDescription& ReplicaDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaDescription::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_replicaStatusHasBeenSet) { - payload.WithString("ReplicaStatus", ReplicaStatusMapper::GetNameForReplicaStatus(m_replicaStatus)); - } - - if (m_replicaArnHasBeenSet) { - payload.WithString("ReplicaArn", m_replicaArn); - } - - if (m_replicaStatusDescriptionHasBeenSet) { - payload.WithString("ReplicaStatusDescription", m_replicaStatusDescription); - } - - if (m_replicaStatusPercentProgressHasBeenSet) { - payload.WithString("ReplicaStatusPercentProgress", m_replicaStatusPercentProgress); - } - - if (m_kMSMasterKeyIdHasBeenSet) { - payload.WithString("KMSMasterKeyId", m_kMSMasterKeyId); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - - if (m_globalSecondaryIndexesHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexesJsonList(m_globalSecondaryIndexes.size()); - for (unsigned globalSecondaryIndexesIndex = 0; globalSecondaryIndexesIndex < globalSecondaryIndexesJsonList.GetLength(); - ++globalSecondaryIndexesIndex) { - globalSecondaryIndexesJsonList[globalSecondaryIndexesIndex].AsObject(m_globalSecondaryIndexes[globalSecondaryIndexesIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexes", std::move(globalSecondaryIndexesJsonList)); - } - - if (m_replicaInaccessibleDateTimeHasBeenSet) { - payload.WithDouble("ReplicaInaccessibleDateTime", m_replicaInaccessibleDateTime.SecondsWithMSPrecision()); - } - - if (m_replicaTableClassSummaryHasBeenSet) { - payload.WithObject("ReplicaTableClassSummary", m_replicaTableClassSummary.Jsonize()); - } - - if (m_globalTableSettingsReplicationModeHasBeenSet) { - payload.WithString( - "GlobalTableSettingsReplicationMode", - GlobalTableSettingsReplicationModeMapper::GetNameForGlobalTableSettingsReplicationMode(m_globalTableSettingsReplicationMode)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndex.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndex.cpp index f147d6b8467..1a55cfd8117 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndex.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndex.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex(JsonView jsonValue) { *this = jsonValue; } -ReplicaGlobalSecondaryIndex& ReplicaGlobalSecondaryIndex::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughputOverride")) { - m_provisionedThroughputOverride = jsonValue.GetObject("ProvisionedThroughputOverride"); - m_provisionedThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughputOverride")) { - m_onDemandThroughputOverride = jsonValue.GetObject("OnDemandThroughputOverride"); - m_onDemandThroughputOverrideHasBeenSet = true; - } - return *this; -} +ReplicaGlobalSecondaryIndex& ReplicaGlobalSecondaryIndex::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaGlobalSecondaryIndex::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingDescription.cpp index 2890cd77b16..ef56aa9fcf8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -20,44 +23,11 @@ ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAu } ReplicaGlobalSecondaryIndexAutoScalingDescription& ReplicaGlobalSecondaryIndexAutoScalingDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexStatus")) { - m_indexStatus = IndexStatusMapper::GetIndexStatusForName(jsonValue.GetString("IndexStatus")); - m_indexStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityAutoScalingSettings")) { - m_provisionedReadCapacityAutoScalingSettings = jsonValue.GetObject("ProvisionedReadCapacityAutoScalingSettings"); - m_provisionedReadCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityAutoScalingSettings")) { - m_provisionedWriteCapacityAutoScalingSettings = jsonValue.GetObject("ProvisionedWriteCapacityAutoScalingSettings"); - m_provisionedWriteCapacityAutoScalingSettingsHasBeenSet = true; - } return *this; } JsonValue ReplicaGlobalSecondaryIndexAutoScalingDescription::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_indexStatusHasBeenSet) { - payload.WithString("IndexStatus", IndexStatusMapper::GetNameForIndexStatus(m_indexStatus)); - } - - if (m_provisionedReadCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ProvisionedReadCapacityAutoScalingSettings", m_provisionedReadCapacityAutoScalingSettings.Jsonize()); - } - - if (m_provisionedWriteCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ProvisionedWriteCapacityAutoScalingSettings", m_provisionedWriteCapacityAutoScalingSettings.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingUpdate.cpp index fd7bd6d0c82..ebd4e6a723d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexAutoScalingUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicaGlobalSecondaryIndexAutoScalingUpdate& ReplicaGlobalSecondaryIndexAutoScalingUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityAutoScalingUpdate")) { - m_provisionedReadCapacityAutoScalingUpdate = jsonValue.GetObject("ProvisionedReadCapacityAutoScalingUpdate"); - m_provisionedReadCapacityAutoScalingUpdateHasBeenSet = true; - } - return *this; -} +ReplicaGlobalSecondaryIndexAutoScalingUpdate& ReplicaGlobalSecondaryIndexAutoScalingUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaGlobalSecondaryIndexAutoScalingUpdate::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedReadCapacityAutoScalingUpdateHasBeenSet) { - payload.WithObject("ProvisionedReadCapacityAutoScalingUpdate", m_provisionedReadCapacityAutoScalingUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexDescription.cpp index 2ed2063cbae..11d40f5e318 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,45 +20,10 @@ namespace Model { ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription(JsonView jsonValue) { *this = jsonValue; } -ReplicaGlobalSecondaryIndexDescription& ReplicaGlobalSecondaryIndexDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedThroughputOverride")) { - m_provisionedThroughputOverride = jsonValue.GetObject("ProvisionedThroughputOverride"); - m_provisionedThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("OnDemandThroughputOverride")) { - m_onDemandThroughputOverride = jsonValue.GetObject("OnDemandThroughputOverride"); - m_onDemandThroughputOverrideHasBeenSet = true; - } - if (jsonValue.ValueExists("WarmThroughput")) { - m_warmThroughput = jsonValue.GetObject("WarmThroughput"); - m_warmThroughputHasBeenSet = true; - } - return *this; -} +ReplicaGlobalSecondaryIndexDescription& ReplicaGlobalSecondaryIndexDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaGlobalSecondaryIndexDescription::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - - if (m_warmThroughputHasBeenSet) { - payload.WithObject("WarmThroughput", m_warmThroughput.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsDescription.cpp index ef58c7b38ec..5f884c9bce6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -18,60 +21,11 @@ namespace Model { ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription(JsonView jsonValue) { *this = jsonValue; } ReplicaGlobalSecondaryIndexSettingsDescription& ReplicaGlobalSecondaryIndexSettingsDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("IndexStatus")) { - m_indexStatus = IndexStatusMapper::GetIndexStatusForName(jsonValue.GetString("IndexStatus")); - m_indexStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityUnits")) { - m_provisionedReadCapacityUnits = jsonValue.GetInt64("ProvisionedReadCapacityUnits"); - m_provisionedReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityAutoScalingSettings")) { - m_provisionedReadCapacityAutoScalingSettings = jsonValue.GetObject("ProvisionedReadCapacityAutoScalingSettings"); - m_provisionedReadCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityUnits")) { - m_provisionedWriteCapacityUnits = jsonValue.GetInt64("ProvisionedWriteCapacityUnits"); - m_provisionedWriteCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedWriteCapacityAutoScalingSettings")) { - m_provisionedWriteCapacityAutoScalingSettings = jsonValue.GetObject("ProvisionedWriteCapacityAutoScalingSettings"); - m_provisionedWriteCapacityAutoScalingSettingsHasBeenSet = true; - } return *this; } JsonValue ReplicaGlobalSecondaryIndexSettingsDescription::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_indexStatusHasBeenSet) { - payload.WithString("IndexStatus", IndexStatusMapper::GetNameForIndexStatus(m_indexStatus)); - } - - if (m_provisionedReadCapacityUnitsHasBeenSet) { - payload.WithInt64("ProvisionedReadCapacityUnits", m_provisionedReadCapacityUnits); - } - - if (m_provisionedReadCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ProvisionedReadCapacityAutoScalingSettings", m_provisionedReadCapacityAutoScalingSettings.Jsonize()); - } - - if (m_provisionedWriteCapacityUnitsHasBeenSet) { - payload.WithInt64("ProvisionedWriteCapacityUnits", m_provisionedWriteCapacityUnits); - } - - if (m_provisionedWriteCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ProvisionedWriteCapacityAutoScalingSettings", m_provisionedWriteCapacityAutoScalingSettings.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsUpdate.cpp index e6612b87812..25ddaf784f3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaGlobalSecondaryIndexSettingsUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicaGlobalSecondaryIndexSettingsUpdate& ReplicaGlobalSecondaryIndexSettingsUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("IndexName")) { - m_indexName = jsonValue.GetString("IndexName"); - m_indexNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityUnits")) { - m_provisionedReadCapacityUnits = jsonValue.GetInt64("ProvisionedReadCapacityUnits"); - m_provisionedReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ProvisionedReadCapacityAutoScalingSettingsUpdate")) { - m_provisionedReadCapacityAutoScalingSettingsUpdate = jsonValue.GetObject("ProvisionedReadCapacityAutoScalingSettingsUpdate"); - m_provisionedReadCapacityAutoScalingSettingsUpdateHasBeenSet = true; - } - return *this; -} +ReplicaGlobalSecondaryIndexSettingsUpdate& ReplicaGlobalSecondaryIndexSettingsUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaGlobalSecondaryIndexSettingsUpdate::Jsonize() const { JsonValue payload; - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_provisionedReadCapacityUnitsHasBeenSet) { - payload.WithInt64("ProvisionedReadCapacityUnits", m_provisionedReadCapacityUnits); - } - - if (m_provisionedReadCapacityAutoScalingSettingsUpdateHasBeenSet) { - payload.WithObject("ProvisionedReadCapacityAutoScalingSettingsUpdate", m_provisionedReadCapacityAutoScalingSettingsUpdate.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsDescription.cpp index 4744e3b6ba2..2f1d61da5d1 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,99 +20,10 @@ namespace Model { ReplicaSettingsDescription::ReplicaSettingsDescription(JsonView jsonValue) { *this = jsonValue; } -ReplicaSettingsDescription& ReplicaSettingsDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaStatus")) { - m_replicaStatus = ReplicaStatusMapper::GetReplicaStatusForName(jsonValue.GetString("ReplicaStatus")); - m_replicaStatusHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaBillingModeSummary")) { - m_replicaBillingModeSummary = jsonValue.GetObject("ReplicaBillingModeSummary"); - m_replicaBillingModeSummaryHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityUnits")) { - m_replicaProvisionedReadCapacityUnits = jsonValue.GetInt64("ReplicaProvisionedReadCapacityUnits"); - m_replicaProvisionedReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityAutoScalingSettings")) { - m_replicaProvisionedReadCapacityAutoScalingSettings = jsonValue.GetObject("ReplicaProvisionedReadCapacityAutoScalingSettings"); - m_replicaProvisionedReadCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedWriteCapacityUnits")) { - m_replicaProvisionedWriteCapacityUnits = jsonValue.GetInt64("ReplicaProvisionedWriteCapacityUnits"); - m_replicaProvisionedWriteCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedWriteCapacityAutoScalingSettings")) { - m_replicaProvisionedWriteCapacityAutoScalingSettings = jsonValue.GetObject("ReplicaProvisionedWriteCapacityAutoScalingSettings"); - m_replicaProvisionedWriteCapacityAutoScalingSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaGlobalSecondaryIndexSettings")) { - Aws::Utils::Array replicaGlobalSecondaryIndexSettingsJsonList = jsonValue.GetArray("ReplicaGlobalSecondaryIndexSettings"); - for (unsigned replicaGlobalSecondaryIndexSettingsIndex = 0; - replicaGlobalSecondaryIndexSettingsIndex < replicaGlobalSecondaryIndexSettingsJsonList.GetLength(); - ++replicaGlobalSecondaryIndexSettingsIndex) { - m_replicaGlobalSecondaryIndexSettings.push_back( - replicaGlobalSecondaryIndexSettingsJsonList[replicaGlobalSecondaryIndexSettingsIndex].AsObject()); - } - m_replicaGlobalSecondaryIndexSettingsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaTableClassSummary")) { - m_replicaTableClassSummary = jsonValue.GetObject("ReplicaTableClassSummary"); - m_replicaTableClassSummaryHasBeenSet = true; - } - return *this; -} +ReplicaSettingsDescription& ReplicaSettingsDescription::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaSettingsDescription::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_replicaStatusHasBeenSet) { - payload.WithString("ReplicaStatus", ReplicaStatusMapper::GetNameForReplicaStatus(m_replicaStatus)); - } - - if (m_replicaBillingModeSummaryHasBeenSet) { - payload.WithObject("ReplicaBillingModeSummary", m_replicaBillingModeSummary.Jsonize()); - } - - if (m_replicaProvisionedReadCapacityUnitsHasBeenSet) { - payload.WithInt64("ReplicaProvisionedReadCapacityUnits", m_replicaProvisionedReadCapacityUnits); - } - - if (m_replicaProvisionedReadCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ReplicaProvisionedReadCapacityAutoScalingSettings", m_replicaProvisionedReadCapacityAutoScalingSettings.Jsonize()); - } - - if (m_replicaProvisionedWriteCapacityUnitsHasBeenSet) { - payload.WithInt64("ReplicaProvisionedWriteCapacityUnits", m_replicaProvisionedWriteCapacityUnits); - } - - if (m_replicaProvisionedWriteCapacityAutoScalingSettingsHasBeenSet) { - payload.WithObject("ReplicaProvisionedWriteCapacityAutoScalingSettings", - m_replicaProvisionedWriteCapacityAutoScalingSettings.Jsonize()); - } - - if (m_replicaGlobalSecondaryIndexSettingsHasBeenSet) { - Aws::Utils::Array replicaGlobalSecondaryIndexSettingsJsonList(m_replicaGlobalSecondaryIndexSettings.size()); - for (unsigned replicaGlobalSecondaryIndexSettingsIndex = 0; - replicaGlobalSecondaryIndexSettingsIndex < replicaGlobalSecondaryIndexSettingsJsonList.GetLength(); - ++replicaGlobalSecondaryIndexSettingsIndex) { - replicaGlobalSecondaryIndexSettingsJsonList[replicaGlobalSecondaryIndexSettingsIndex].AsObject( - m_replicaGlobalSecondaryIndexSettings[replicaGlobalSecondaryIndexSettingsIndex].Jsonize()); - } - payload.WithArray("ReplicaGlobalSecondaryIndexSettings", std::move(replicaGlobalSecondaryIndexSettingsJsonList)); - } - - if (m_replicaTableClassSummaryHasBeenSet) { - payload.WithObject("ReplicaTableClassSummary", m_replicaTableClassSummary.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsUpdate.cpp index a7aada537d3..c5d0346f078 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaSettingsUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,69 +20,10 @@ namespace Model { ReplicaSettingsUpdate::ReplicaSettingsUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicaSettingsUpdate& ReplicaSettingsUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("RegionName")) { - m_regionName = jsonValue.GetString("RegionName"); - m_regionNameHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityUnits")) { - m_replicaProvisionedReadCapacityUnits = jsonValue.GetInt64("ReplicaProvisionedReadCapacityUnits"); - m_replicaProvisionedReadCapacityUnitsHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate")) { - m_replicaProvisionedReadCapacityAutoScalingSettingsUpdate = - jsonValue.GetObject("ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate"); - m_replicaProvisionedReadCapacityAutoScalingSettingsUpdateHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaGlobalSecondaryIndexSettingsUpdate")) { - Aws::Utils::Array replicaGlobalSecondaryIndexSettingsUpdateJsonList = - jsonValue.GetArray("ReplicaGlobalSecondaryIndexSettingsUpdate"); - for (unsigned replicaGlobalSecondaryIndexSettingsUpdateIndex = 0; - replicaGlobalSecondaryIndexSettingsUpdateIndex < replicaGlobalSecondaryIndexSettingsUpdateJsonList.GetLength(); - ++replicaGlobalSecondaryIndexSettingsUpdateIndex) { - m_replicaGlobalSecondaryIndexSettingsUpdate.push_back( - replicaGlobalSecondaryIndexSettingsUpdateJsonList[replicaGlobalSecondaryIndexSettingsUpdateIndex].AsObject()); - } - m_replicaGlobalSecondaryIndexSettingsUpdateHasBeenSet = true; - } - if (jsonValue.ValueExists("ReplicaTableClass")) { - m_replicaTableClass = TableClassMapper::GetTableClassForName(jsonValue.GetString("ReplicaTableClass")); - m_replicaTableClassHasBeenSet = true; - } - return *this; -} +ReplicaSettingsUpdate& ReplicaSettingsUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaSettingsUpdate::Jsonize() const { JsonValue payload; - - if (m_regionNameHasBeenSet) { - payload.WithString("RegionName", m_regionName); - } - - if (m_replicaProvisionedReadCapacityUnitsHasBeenSet) { - payload.WithInt64("ReplicaProvisionedReadCapacityUnits", m_replicaProvisionedReadCapacityUnits); - } - - if (m_replicaProvisionedReadCapacityAutoScalingSettingsUpdateHasBeenSet) { - payload.WithObject("ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate", - m_replicaProvisionedReadCapacityAutoScalingSettingsUpdate.Jsonize()); - } - - if (m_replicaGlobalSecondaryIndexSettingsUpdateHasBeenSet) { - Aws::Utils::Array replicaGlobalSecondaryIndexSettingsUpdateJsonList(m_replicaGlobalSecondaryIndexSettingsUpdate.size()); - for (unsigned replicaGlobalSecondaryIndexSettingsUpdateIndex = 0; - replicaGlobalSecondaryIndexSettingsUpdateIndex < replicaGlobalSecondaryIndexSettingsUpdateJsonList.GetLength(); - ++replicaGlobalSecondaryIndexSettingsUpdateIndex) { - replicaGlobalSecondaryIndexSettingsUpdateJsonList[replicaGlobalSecondaryIndexSettingsUpdateIndex].AsObject( - m_replicaGlobalSecondaryIndexSettingsUpdate[replicaGlobalSecondaryIndexSettingsUpdateIndex].Jsonize()); - } - payload.WithArray("ReplicaGlobalSecondaryIndexSettingsUpdate", std::move(replicaGlobalSecondaryIndexSettingsUpdateJsonList)); - } - - if (m_replicaTableClassHasBeenSet) { - payload.WithString("ReplicaTableClass", TableClassMapper::GetNameForTableClass(m_replicaTableClass)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaStatus.cpp index 5d4073299a8..4339da0142d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaStatus.cpp @@ -54,7 +54,6 @@ ReplicaStatus GetReplicaStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReplicaStatus::NOT_SET; } @@ -87,7 +86,6 @@ Aws::String GetNameForReplicaStatus(ReplicaStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaUpdate.cpp index 2a5e69b8547..f464863b347 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicaUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,29 +20,10 @@ namespace Model { ReplicaUpdate::ReplicaUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicaUpdate& ReplicaUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Create")) { - m_create = jsonValue.GetObject("Create"); - m_createHasBeenSet = true; - } - if (jsonValue.ValueExists("Delete")) { - m_delete = jsonValue.GetObject("Delete"); - m_deleteHasBeenSet = true; - } - return *this; -} +ReplicaUpdate& ReplicaUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicaUpdate::Jsonize() const { JsonValue payload; - - if (m_createHasBeenSet) { - payload.WithObject("Create", m_create.Jsonize()); - } - - if (m_deleteHasBeenSet) { - payload.WithObject("Delete", m_delete.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicationGroupUpdate.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicationGroupUpdate.cpp index 917681d8433..0b8320019b5 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicationGroupUpdate.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReplicationGroupUpdate.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { ReplicationGroupUpdate::ReplicationGroupUpdate(JsonView jsonValue) { *this = jsonValue; } -ReplicationGroupUpdate& ReplicationGroupUpdate::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Create")) { - m_create = jsonValue.GetObject("Create"); - m_createHasBeenSet = true; - } - if (jsonValue.ValueExists("Update")) { - m_update = jsonValue.GetObject("Update"); - m_updateHasBeenSet = true; - } - if (jsonValue.ValueExists("Delete")) { - m_delete = jsonValue.GetObject("Delete"); - m_deleteHasBeenSet = true; - } - return *this; -} +ReplicationGroupUpdate& ReplicationGroupUpdate::operator=(JsonView jsonValue) { return *this; } JsonValue ReplicationGroupUpdate::Jsonize() const { JsonValue payload; - - if (m_createHasBeenSet) { - payload.WithObject("Create", m_create.Jsonize()); - } - - if (m_updateHasBeenSet) { - payload.WithObject("Update", m_update.Jsonize()); - } - - if (m_deleteHasBeenSet) { - payload.WithObject("Delete", m_delete.Jsonize()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RequestLimitExceeded.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RequestLimitExceeded.cpp index 3a5c7741fda..8094074b611 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RequestLimitExceeded.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RequestLimitExceeded.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { RequestLimitExceeded::RequestLimitExceeded(JsonView jsonValue) { *this = jsonValue; } -RequestLimitExceeded& RequestLimitExceeded::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("message")) { - m_message = jsonValue.GetString("message"); - m_messageHasBeenSet = true; - } - if (jsonValue.ValueExists("ThrottlingReasons")) { - Aws::Utils::Array throttlingReasonsJsonList = jsonValue.GetArray("ThrottlingReasons"); - for (unsigned throttlingReasonsIndex = 0; throttlingReasonsIndex < throttlingReasonsJsonList.GetLength(); ++throttlingReasonsIndex) { - m_throttlingReasons.push_back(throttlingReasonsJsonList[throttlingReasonsIndex].AsObject()); - } - m_throttlingReasonsHasBeenSet = true; - } - return *this; -} +RequestLimitExceeded& RequestLimitExceeded::operator=(JsonView jsonValue) { return *this; } JsonValue RequestLimitExceeded::Jsonize() const { JsonValue payload; - - if (m_messageHasBeenSet) { - payload.WithString("message", m_message); - } - - if (m_throttlingReasonsHasBeenSet) { - Aws::Utils::Array throttlingReasonsJsonList(m_throttlingReasons.size()); - for (unsigned throttlingReasonsIndex = 0; throttlingReasonsIndex < throttlingReasonsJsonList.GetLength(); ++throttlingReasonsIndex) { - throttlingReasonsJsonList[throttlingReasonsIndex].AsObject(m_throttlingReasons[throttlingReasonsIndex].Jsonize()); - } - payload.WithArray("ThrottlingReasons", std::move(throttlingReasonsJsonList)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreSummary.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreSummary.cpp index 5ca2f155380..50b6c5d6ab4 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreSummary.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreSummary.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,45 +20,10 @@ namespace Model { RestoreSummary::RestoreSummary(JsonView jsonValue) { *this = jsonValue; } -RestoreSummary& RestoreSummary::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("SourceBackupArn")) { - m_sourceBackupArn = jsonValue.GetString("SourceBackupArn"); - m_sourceBackupArnHasBeenSet = true; - } - if (jsonValue.ValueExists("SourceTableArn")) { - m_sourceTableArn = jsonValue.GetString("SourceTableArn"); - m_sourceTableArnHasBeenSet = true; - } - if (jsonValue.ValueExists("RestoreDateTime")) { - m_restoreDateTime = jsonValue.GetDouble("RestoreDateTime"); - m_restoreDateTimeHasBeenSet = true; - } - if (jsonValue.ValueExists("RestoreInProgress")) { - m_restoreInProgress = jsonValue.GetBool("RestoreInProgress"); - m_restoreInProgressHasBeenSet = true; - } - return *this; -} +RestoreSummary& RestoreSummary::operator=(JsonView jsonValue) { return *this; } JsonValue RestoreSummary::Jsonize() const { JsonValue payload; - - if (m_sourceBackupArnHasBeenSet) { - payload.WithString("SourceBackupArn", m_sourceBackupArn); - } - - if (m_sourceTableArnHasBeenSet) { - payload.WithString("SourceTableArn", m_sourceTableArn); - } - - if (m_restoreDateTimeHasBeenSet) { - payload.WithDouble("RestoreDateTime", m_restoreDateTime.SecondsWithMSPrecision()); - } - - if (m_restoreInProgressHasBeenSet) { - payload.WithBool("RestoreInProgress", m_restoreInProgress); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupRequest.cpp index b73e1abe11b..1c453562128 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupRequest.cpp @@ -3,73 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String RestoreTableFromBackupRequest::SerializePayload() const { - JsonValue payload; - - if (m_targetTableNameHasBeenSet) { - payload.WithString("TargetTableName", m_targetTableName); - } - - if (m_backupArnHasBeenSet) { - payload.WithString("BackupArn", m_backupArn); - } - - if (m_billingModeOverrideHasBeenSet) { - payload.WithString("BillingModeOverride", BillingModeMapper::GetNameForBillingMode(m_billingModeOverride)); - } - - if (m_globalSecondaryIndexOverrideHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexOverrideJsonList(m_globalSecondaryIndexOverride.size()); - for (unsigned globalSecondaryIndexOverrideIndex = 0; - globalSecondaryIndexOverrideIndex < globalSecondaryIndexOverrideJsonList.GetLength(); ++globalSecondaryIndexOverrideIndex) { - globalSecondaryIndexOverrideJsonList[globalSecondaryIndexOverrideIndex].AsObject( - m_globalSecondaryIndexOverride[globalSecondaryIndexOverrideIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexOverride", std::move(globalSecondaryIndexOverrideJsonList)); - } - - if (m_localSecondaryIndexOverrideHasBeenSet) { - Aws::Utils::Array localSecondaryIndexOverrideJsonList(m_localSecondaryIndexOverride.size()); - for (unsigned localSecondaryIndexOverrideIndex = 0; localSecondaryIndexOverrideIndex < localSecondaryIndexOverrideJsonList.GetLength(); - ++localSecondaryIndexOverrideIndex) { - localSecondaryIndexOverrideJsonList[localSecondaryIndexOverrideIndex].AsObject( - m_localSecondaryIndexOverride[localSecondaryIndexOverrideIndex].Jsonize()); - } - payload.WithArray("LocalSecondaryIndexOverride", std::move(localSecondaryIndexOverrideJsonList)); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - - if (m_sSESpecificationOverrideHasBeenSet) { - payload.WithObject("SSESpecificationOverride", m_sSESpecificationOverride.Jsonize()); - } - - if (m_vectorIndexOverrideHasBeenSet) { - Aws::Utils::Array vectorIndexOverrideJsonList(m_vectorIndexOverride.size()); - for (unsigned vectorIndexOverrideIndex = 0; vectorIndexOverrideIndex < vectorIndexOverrideJsonList.GetLength(); - ++vectorIndexOverrideIndex) { - vectorIndexOverrideJsonList[vectorIndexOverrideIndex].AsObject(m_vectorIndexOverride[vectorIndexOverrideIndex].Jsonize()); - } - payload.WithArray("VectorIndexOverride", std::move(vectorIndexOverrideJsonList)); - } - - return payload.View().WriteReadable(); -} +Aws::String RestoreTableFromBackupRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection RestoreTableFromBackupRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupResult.cpp index fcf5e0a2c9f..f1bcc5d8f05 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableFromBackupResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -20,19 +21,5 @@ using namespace Aws; RestoreTableFromBackupResult::RestoreTableFromBackupResult(const Aws::AmazonWebServiceResult& result) { *this = result; } RestoreTableFromBackupResult& RestoreTableFromBackupResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableDescription")) { - m_tableDescription = jsonValue.GetObject("TableDescription"); - m_tableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeRequest.cpp index 9d6773e327d..34a7959c173 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeRequest.cpp @@ -3,85 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String RestoreTableToPointInTimeRequest::SerializePayload() const { - JsonValue payload; - - if (m_sourceTableArnHasBeenSet) { - payload.WithString("SourceTableArn", m_sourceTableArn); - } - - if (m_sourceTableNameHasBeenSet) { - payload.WithString("SourceTableName", m_sourceTableName); - } - - if (m_targetTableNameHasBeenSet) { - payload.WithString("TargetTableName", m_targetTableName); - } - - if (m_useLatestRestorableTimeHasBeenSet) { - payload.WithBool("UseLatestRestorableTime", m_useLatestRestorableTime); - } - - if (m_restoreDateTimeHasBeenSet) { - payload.WithDouble("RestoreDateTime", m_restoreDateTime.SecondsWithMSPrecision()); - } - - if (m_billingModeOverrideHasBeenSet) { - payload.WithString("BillingModeOverride", BillingModeMapper::GetNameForBillingMode(m_billingModeOverride)); - } - - if (m_globalSecondaryIndexOverrideHasBeenSet) { - Aws::Utils::Array globalSecondaryIndexOverrideJsonList(m_globalSecondaryIndexOverride.size()); - for (unsigned globalSecondaryIndexOverrideIndex = 0; - globalSecondaryIndexOverrideIndex < globalSecondaryIndexOverrideJsonList.GetLength(); ++globalSecondaryIndexOverrideIndex) { - globalSecondaryIndexOverrideJsonList[globalSecondaryIndexOverrideIndex].AsObject( - m_globalSecondaryIndexOverride[globalSecondaryIndexOverrideIndex].Jsonize()); - } - payload.WithArray("GlobalSecondaryIndexOverride", std::move(globalSecondaryIndexOverrideJsonList)); - } - - if (m_localSecondaryIndexOverrideHasBeenSet) { - Aws::Utils::Array localSecondaryIndexOverrideJsonList(m_localSecondaryIndexOverride.size()); - for (unsigned localSecondaryIndexOverrideIndex = 0; localSecondaryIndexOverrideIndex < localSecondaryIndexOverrideJsonList.GetLength(); - ++localSecondaryIndexOverrideIndex) { - localSecondaryIndexOverrideJsonList[localSecondaryIndexOverrideIndex].AsObject( - m_localSecondaryIndexOverride[localSecondaryIndexOverrideIndex].Jsonize()); - } - payload.WithArray("LocalSecondaryIndexOverride", std::move(localSecondaryIndexOverrideJsonList)); - } - - if (m_provisionedThroughputOverrideHasBeenSet) { - payload.WithObject("ProvisionedThroughputOverride", m_provisionedThroughputOverride.Jsonize()); - } - - if (m_onDemandThroughputOverrideHasBeenSet) { - payload.WithObject("OnDemandThroughputOverride", m_onDemandThroughputOverride.Jsonize()); - } - - if (m_sSESpecificationOverrideHasBeenSet) { - payload.WithObject("SSESpecificationOverride", m_sSESpecificationOverride.Jsonize()); - } - - if (m_vectorIndexOverrideHasBeenSet) { - Aws::Utils::Array vectorIndexOverrideJsonList(m_vectorIndexOverride.size()); - for (unsigned vectorIndexOverrideIndex = 0; vectorIndexOverrideIndex < vectorIndexOverrideJsonList.GetLength(); - ++vectorIndexOverrideIndex) { - vectorIndexOverrideJsonList[vectorIndexOverrideIndex].AsObject(m_vectorIndexOverride[vectorIndexOverrideIndex].Jsonize()); - } - payload.WithArray("VectorIndexOverride", std::move(vectorIndexOverrideJsonList)); - } - - return payload.View().WriteReadable(); -} +Aws::String RestoreTableToPointInTimeRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection RestoreTableToPointInTimeRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeResult.cpp index e321dd58833..8c113602bfb 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/RestoreTableToPointInTimeResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -20,19 +21,5 @@ using namespace Aws; RestoreTableToPointInTimeResult::RestoreTableToPointInTimeResult(const Aws::AmazonWebServiceResult& result) { *this = result; } RestoreTableToPointInTimeResult& RestoreTableToPointInTimeResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("TableDescription")) { - m_tableDescription = jsonValue.GetObject("TableDescription"); - m_tableDescriptionHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnConsumedCapacity.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnConsumedCapacity.cpp index 4a15c7648f5..5913d04405c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnConsumedCapacity.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnConsumedCapacity.cpp @@ -33,7 +33,6 @@ ReturnConsumedCapacity GetReturnConsumedCapacityForName(const Aws::String& name) overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReturnConsumedCapacity::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForReturnConsumedCapacity(ReturnConsumedCapacity enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnItemCollectionMetrics.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnItemCollectionMetrics.cpp index 3ae982f5fc7..8bd42089201 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnItemCollectionMetrics.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnItemCollectionMetrics.cpp @@ -30,7 +30,6 @@ ReturnItemCollectionMetrics GetReturnItemCollectionMetricsForName(const Aws::Str overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReturnItemCollectionMetrics::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForReturnItemCollectionMetrics(ReturnItemCollectionMetrics en if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValue.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValue.cpp index f7e7444f882..e343265219c 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValue.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValue.cpp @@ -39,7 +39,6 @@ ReturnValue GetReturnValueForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReturnValue::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForReturnValue(ReturnValue enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValuesOnConditionCheckFailure.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValuesOnConditionCheckFailure.cpp index 1184fea281e..a2f1f346342 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValuesOnConditionCheckFailure.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ReturnValuesOnConditionCheckFailure.cpp @@ -30,7 +30,6 @@ ReturnValuesOnConditionCheckFailure GetReturnValuesOnConditionCheckFailureForNam overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ReturnValuesOnConditionCheckFailure::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForReturnValuesOnConditionCheckFailure(ReturnValuesOnConditio if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/S3BucketSource.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/S3BucketSource.cpp index d78e69f5d43..43234329b20 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/S3BucketSource.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/S3BucketSource.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { S3BucketSource::S3BucketSource(JsonView jsonValue) { *this = jsonValue; } -S3BucketSource& S3BucketSource::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("S3BucketOwner")) { - m_s3BucketOwner = jsonValue.GetString("S3BucketOwner"); - m_s3BucketOwnerHasBeenSet = true; - } - if (jsonValue.ValueExists("S3Bucket")) { - m_s3Bucket = jsonValue.GetString("S3Bucket"); - m_s3BucketHasBeenSet = true; - } - if (jsonValue.ValueExists("S3KeyPrefix")) { - m_s3KeyPrefix = jsonValue.GetString("S3KeyPrefix"); - m_s3KeyPrefixHasBeenSet = true; - } - return *this; -} +S3BucketSource& S3BucketSource::operator=(JsonView jsonValue) { return *this; } JsonValue S3BucketSource::Jsonize() const { JsonValue payload; - - if (m_s3BucketOwnerHasBeenSet) { - payload.WithString("S3BucketOwner", m_s3BucketOwner); - } - - if (m_s3BucketHasBeenSet) { - payload.WithString("S3Bucket", m_s3Bucket); - } - - if (m_s3KeyPrefixHasBeenSet) { - payload.WithString("S3KeyPrefix", m_s3KeyPrefix); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/S3SseAlgorithm.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/S3SseAlgorithm.cpp index 5c3276f789b..3812a6fc2d8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/S3SseAlgorithm.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/S3SseAlgorithm.cpp @@ -30,7 +30,6 @@ S3SseAlgorithm GetS3SseAlgorithmForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return S3SseAlgorithm::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForS3SseAlgorithm(S3SseAlgorithm enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEDescription.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEDescription.cpp index fe663a444ec..6ee4f63d515 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEDescription.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEDescription.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,45 +20,10 @@ namespace Model { SSEDescription::SSEDescription(JsonView jsonValue) { *this = jsonValue; } -SSEDescription& SSEDescription::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Status")) { - m_status = SSEStatusMapper::GetSSEStatusForName(jsonValue.GetString("Status")); - m_statusHasBeenSet = true; - } - if (jsonValue.ValueExists("SSEType")) { - m_sSEType = SSETypeMapper::GetSSETypeForName(jsonValue.GetString("SSEType")); - m_sSETypeHasBeenSet = true; - } - if (jsonValue.ValueExists("KMSMasterKeyArn")) { - m_kMSMasterKeyArn = jsonValue.GetString("KMSMasterKeyArn"); - m_kMSMasterKeyArnHasBeenSet = true; - } - if (jsonValue.ValueExists("InaccessibleEncryptionDateTime")) { - m_inaccessibleEncryptionDateTime = jsonValue.GetDouble("InaccessibleEncryptionDateTime"); - m_inaccessibleEncryptionDateTimeHasBeenSet = true; - } - return *this; -} +SSEDescription& SSEDescription::operator=(JsonView jsonValue) { return *this; } JsonValue SSEDescription::Jsonize() const { JsonValue payload; - - if (m_statusHasBeenSet) { - payload.WithString("Status", SSEStatusMapper::GetNameForSSEStatus(m_status)); - } - - if (m_sSETypeHasBeenSet) { - payload.WithString("SSEType", SSETypeMapper::GetNameForSSEType(m_sSEType)); - } - - if (m_kMSMasterKeyArnHasBeenSet) { - payload.WithString("KMSMasterKeyArn", m_kMSMasterKeyArn); - } - - if (m_inaccessibleEncryptionDateTimeHasBeenSet) { - payload.WithDouble("InaccessibleEncryptionDateTime", m_inaccessibleEncryptionDateTime.SecondsWithMSPrecision()); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSESpecification.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSESpecification.cpp index f982d3459f5..54c16d904b8 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSESpecification.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSESpecification.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,37 +20,10 @@ namespace Model { SSESpecification::SSESpecification(JsonView jsonValue) { *this = jsonValue; } -SSESpecification& SSESpecification::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Enabled")) { - m_enabled = jsonValue.GetBool("Enabled"); - m_enabledHasBeenSet = true; - } - if (jsonValue.ValueExists("SSEType")) { - m_sSEType = SSETypeMapper::GetSSETypeForName(jsonValue.GetString("SSEType")); - m_sSETypeHasBeenSet = true; - } - if (jsonValue.ValueExists("KMSMasterKeyId")) { - m_kMSMasterKeyId = jsonValue.GetString("KMSMasterKeyId"); - m_kMSMasterKeyIdHasBeenSet = true; - } - return *this; -} +SSESpecification& SSESpecification::operator=(JsonView jsonValue) { return *this; } JsonValue SSESpecification::Jsonize() const { JsonValue payload; - - if (m_enabledHasBeenSet) { - payload.WithBool("Enabled", m_enabled); - } - - if (m_sSETypeHasBeenSet) { - payload.WithString("SSEType", SSETypeMapper::GetNameForSSEType(m_sSEType)); - } - - if (m_kMSMasterKeyIdHasBeenSet) { - payload.WithString("KMSMasterKeyId", m_kMSMasterKeyId); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEStatus.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEStatus.cpp index 66fa19ef226..e6876f5d739 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEStatus.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEStatus.cpp @@ -39,7 +39,6 @@ SSEStatus GetSSEStatusForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return SSEStatus::NOT_SET; } @@ -62,7 +61,6 @@ Aws::String GetNameForSSEStatus(SSEStatus enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEType.cpp index 900718f9ef1..c1d29e8b02a 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SSEType.cpp @@ -30,7 +30,6 @@ SSEType GetSSETypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return SSEType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForSSEType(SSEType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScalarAttributeType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScalarAttributeType.cpp index dd4de1e4d5c..1a8efca2bf1 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScalarAttributeType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScalarAttributeType.cpp @@ -33,7 +33,6 @@ ScalarAttributeType GetScalarAttributeTypeForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return ScalarAttributeType::NOT_SET; } @@ -52,7 +51,6 @@ Aws::String GetNameForScalarAttributeType(ScalarAttributeType enumValue) { if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanRequest.cpp index 44c3c5534eb..1548ec1dbb3 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanRequest.cpp @@ -3,104 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String ScanRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_attributesToGetHasBeenSet) { - Aws::Utils::Array attributesToGetJsonList(m_attributesToGet.size()); - for (unsigned attributesToGetIndex = 0; attributesToGetIndex < attributesToGetJsonList.GetLength(); ++attributesToGetIndex) { - attributesToGetJsonList[attributesToGetIndex].AsString(m_attributesToGet[attributesToGetIndex]); - } - payload.WithArray("AttributesToGet", std::move(attributesToGetJsonList)); - } - - if (m_limitHasBeenSet) { - payload.WithInteger("Limit", m_limit); - } - - if (m_selectHasBeenSet) { - payload.WithString("Select", SelectMapper::GetNameForSelect(m_select)); - } - - if (m_scanFilterHasBeenSet) { - JsonValue scanFilterJsonMap; - for (auto& scanFilterItem : m_scanFilter) { - scanFilterJsonMap.WithObject(scanFilterItem.first, scanFilterItem.second.Jsonize()); - } - payload.WithObject("ScanFilter", std::move(scanFilterJsonMap)); - } - - if (m_conditionalOperatorHasBeenSet) { - payload.WithString("ConditionalOperator", ConditionalOperatorMapper::GetNameForConditionalOperator(m_conditionalOperator)); - } - - if (m_exclusiveStartKeyHasBeenSet) { - JsonValue exclusiveStartKeyJsonMap; - for (auto& exclusiveStartKeyItem : m_exclusiveStartKey) { - exclusiveStartKeyJsonMap.WithObject(exclusiveStartKeyItem.first, exclusiveStartKeyItem.second.Jsonize()); - } - payload.WithObject("ExclusiveStartKey", std::move(exclusiveStartKeyJsonMap)); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_totalSegmentsHasBeenSet) { - payload.WithInteger("TotalSegments", m_totalSegments); - } - - if (m_segmentHasBeenSet) { - payload.WithInteger("Segment", m_segment); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_filterExpressionHasBeenSet) { - payload.WithString("FilterExpression", m_filterExpression); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_consistentReadHasBeenSet) { - payload.WithBool("ConsistentRead", m_consistentRead); - } - - return payload.View().WriteReadable(); -} +Aws::String ScanRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection ScanRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanResult.cpp index 619ee1ef257..464ad2a67aa 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/ScanResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,47 +20,4 @@ using namespace Aws; ScanResult::ScanResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -ScanResult& ScanResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("Items")) { - Aws::Utils::Array itemsJsonList = jsonValue.GetArray("Items"); - for (unsigned itemsIndex = 0; itemsIndex < itemsJsonList.GetLength(); ++itemsIndex) { - Aws::Map attributeMap2JsonMap = itemsJsonList[itemsIndex].GetAllObjects(); - Aws::Map attributeMap2Map; - for (auto& attributeMap2Item : attributeMap2JsonMap) { - attributeMap2Map[attributeMap2Item.first] = attributeMap2Item.second.AsObject(); - } - m_items.push_back(std::move(attributeMap2Map)); - } - m_itemsHasBeenSet = true; - } - if (jsonValue.ValueExists("Count")) { - m_count = jsonValue.GetInteger("Count"); - m_countHasBeenSet = true; - } - if (jsonValue.ValueExists("ScannedCount")) { - m_scannedCount = jsonValue.GetInteger("ScannedCount"); - m_scannedCountHasBeenSet = true; - } - if (jsonValue.ValueExists("LastEvaluatedKey")) { - Aws::Map lastEvaluatedKeyJsonMap = jsonValue.GetObject("LastEvaluatedKey").GetAllObjects(); - for (auto& lastEvaluatedKeyItem : lastEvaluatedKeyJsonMap) { - m_lastEvaluatedKey[lastEvaluatedKeyItem.first] = lastEvaluatedKeyItem.second.AsObject(); - } - m_lastEvaluatedKeyHasBeenSet = true; - } - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +ScanResult& ScanResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchResultItem.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchResultItem.cpp index aad3b793965..2b66bb3d960 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchResultItem.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchResultItem.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,36 +20,10 @@ namespace Model { SearchResultItem::SearchResultItem(JsonView jsonValue) { *this = jsonValue; } -SearchResultItem& SearchResultItem::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("Item")) { - Aws::Map itemJsonMap = jsonValue.GetObject("Item").GetAllObjects(); - for (auto& itemItem : itemJsonMap) { - m_item[itemItem.first] = itemItem.second.AsObject(); - } - m_itemHasBeenSet = true; - } - if (jsonValue.ValueExists("Score")) { - m_score = jsonValue.GetDouble("Score"); - m_scoreHasBeenSet = true; - } - return *this; -} +SearchResultItem& SearchResultItem::operator=(JsonView jsonValue) { return *this; } JsonValue SearchResultItem::Jsonize() const { JsonValue payload; - - if (m_itemHasBeenSet) { - JsonValue itemJsonMap; - for (auto& itemItem : m_item) { - itemJsonMap.WithObject(itemItem.first, itemItem.second.Jsonize()); - } - payload.WithObject("Item", std::move(itemJsonMap)); - } - - if (m_scoreHasBeenSet) { - payload.WithDouble("Score", m_score); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElement.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElement.cpp index 3dde48531b3..3d0b06fa602 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElement.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElement.cpp @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include #include +#include #include #include @@ -17,31 +20,10 @@ namespace Model { SearchSchemaElement::SearchSchemaElement(JsonView jsonValue) { *this = jsonValue; } -SearchSchemaElement& SearchSchemaElement::operator=(JsonView jsonValue) { - if (jsonValue.ValueExists("AttributeName")) { - m_attributeName = jsonValue.GetString("AttributeName"); - m_attributeNameHasBeenSet = true; - } - if (jsonValue.ValueExists("SearchSchemaElementType")) { - m_searchSchemaElementType = - SearchSchemaElementTypeMapper::GetSearchSchemaElementTypeForName(jsonValue.GetString("SearchSchemaElementType")); - m_searchSchemaElementTypeHasBeenSet = true; - } - return *this; -} +SearchSchemaElement& SearchSchemaElement::operator=(JsonView jsonValue) { return *this; } JsonValue SearchSchemaElement::Jsonize() const { JsonValue payload; - - if (m_attributeNameHasBeenSet) { - payload.WithString("AttributeName", m_attributeName); - } - - if (m_searchSchemaElementTypeHasBeenSet) { - payload.WithString("SearchSchemaElementType", - SearchSchemaElementTypeMapper::GetNameForSearchSchemaElementType(m_searchSchemaElementType)); - } - return payload; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElementType.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElementType.cpp index 4f4f61a6b30..8ebb39dfd90 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElementType.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchSchemaElementType.cpp @@ -30,7 +30,6 @@ SearchSchemaElementType GetSearchSchemaElementTypeForName(const Aws::String& nam overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } - return SearchSchemaElementType::NOT_SET; } @@ -47,7 +46,6 @@ Aws::String GetNameForSearchSchemaElementType(SearchSchemaElementType enumValue) if (overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } - return {}; } } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsRequest.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsRequest.cpp index 1720d53bf85..f6a36a4b0bd 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsRequest.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsRequest.cpp @@ -3,68 +3,22 @@ * SPDX-License-Identifier: Apache-2.0. */ +#include +#include +#include +#include #include +#include #include +#include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; -Aws::String SearchVectorsRequest::SerializePayload() const { - JsonValue payload; - - if (m_tableNameHasBeenSet) { - payload.WithString("TableName", m_tableName); - } - - if (m_indexNameHasBeenSet) { - payload.WithString("IndexName", m_indexName); - } - - if (m_returnConsumedCapacityHasBeenSet) { - payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); - } - - if (m_expressionAttributeNamesHasBeenSet) { - JsonValue expressionAttributeNamesJsonMap; - for (auto& expressionAttributeNamesItem : m_expressionAttributeNames) { - expressionAttributeNamesJsonMap.WithString(expressionAttributeNamesItem.first, expressionAttributeNamesItem.second); - } - payload.WithObject("ExpressionAttributeNames", std::move(expressionAttributeNamesJsonMap)); - } - - if (m_expressionAttributeValuesHasBeenSet) { - JsonValue expressionAttributeValuesJsonMap; - for (auto& expressionAttributeValuesItem : m_expressionAttributeValues) { - expressionAttributeValuesJsonMap.WithObject(expressionAttributeValuesItem.first, expressionAttributeValuesItem.second.Jsonize()); - } - payload.WithObject("ExpressionAttributeValues", std::move(expressionAttributeValuesJsonMap)); - } - - if (m_projectionExpressionHasBeenSet) { - payload.WithString("ProjectionExpression", m_projectionExpression); - } - - if (m_searchVectorHasBeenSet) { - Aws::Utils::Array searchVectorJsonList(m_searchVector.size()); - for (unsigned searchVectorIndex = 0; searchVectorIndex < searchVectorJsonList.GetLength(); ++searchVectorIndex) { - searchVectorJsonList[searchVectorIndex].AsObject(m_searchVector[searchVectorIndex].Jsonize()); - } - payload.WithArray("SearchVector", std::move(searchVectorJsonList)); - } - - if (m_searchConditionExpressionHasBeenSet) { - payload.WithString("SearchConditionExpression", m_searchConditionExpression); - } - - if (m_topKHasBeenSet) { - payload.WithInteger("TopK", m_topK); - } - - return payload.View().WriteReadable(); -} +Aws::String SearchVectorsRequest::SerializePayload() const { return "{}"; } Aws::Http::HeaderValueCollection SearchVectorsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsResult.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsResult.cpp index 73721c124d4..a951b8c9a0d 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsResult.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/SearchVectorsResult.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -19,27 +20,4 @@ using namespace Aws; SearchVectorsResult::SearchVectorsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } -SearchVectorsResult& SearchVectorsResult::operator=(const Aws::AmazonWebServiceResult& result) { - m_HttpResponseCode = result.GetResponseCode(); - JsonView jsonValue = result.GetPayload().View(); - if (jsonValue.ValueExists("ConsumedCapacity")) { - m_consumedCapacity = jsonValue.GetObject("ConsumedCapacity"); - m_consumedCapacityHasBeenSet = true; - } - if (jsonValue.ValueExists("SearchResults")) { - Aws::Utils::Array searchResultsJsonList = jsonValue.GetArray("SearchResults"); - for (unsigned searchResultsIndex = 0; searchResultsIndex < searchResultsJsonList.GetLength(); ++searchResultsIndex) { - m_searchResults.push_back(searchResultsJsonList[searchResultsIndex].AsObject()); - } - m_searchResultsHasBeenSet = true; - } - - const auto& headers = result.GetHeaderValueCollection(); - const auto& requestIdIter = headers.find("x-amzn-requestid"); - if (requestIdIter != headers.end()) { - m_requestId = requestIdIter->second; - m_requestIdHasBeenSet = true; - } - - return *this; -} +SearchVectorsResult& SearchVectorsResult::operator=(const Aws::AmazonWebServiceResult& result) { return *this; } diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/model/Select.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/model/Select.cpp index 7fb6752614f..73507337b38 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/model/Select.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/model/Select.cpp @@ -36,7 +36,6 @@ Select GetSelectForName(const Aws::String& name) { overflowContainer->StoreOverflow(hashCode, name); return static_cast