Skip to content

Commit

Permalink
Merge branch 'master' into zoewang/reenableCodingConventionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
zoewangg authored Dec 12, 2024
2 parents e7f154d + 89e0e75 commit 37e015b
Show file tree
Hide file tree
Showing 561 changed files with 5,593 additions and 4,306 deletions.
60 changes: 60 additions & 0 deletions .changes/2.29.32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"version": "2.29.32",
"date": "2024-12-11",
"entries": [
{
"type": "feature",
"category": "AWS Artifact",
"contributor": "",
"description": "Add support for listing active customer agreements for the calling AWS Account."
},
{
"type": "feature",
"category": "AWS CloudTrail",
"contributor": "",
"description": "Doc-only updates for CloudTrail."
},
{
"type": "feature",
"category": "AWS Control Catalog",
"contributor": "",
"description": "Minor documentation updates to the content of ImplementationDetails object part of the Control Catalog GetControl API"
},
{
"type": "feature",
"category": "AWS Migration Hub",
"contributor": "",
"description": "API and documentation updates for AWS MigrationHub related to adding support for listing migration task updates and associating, disassociating and listing source resources"
},
{
"type": "feature",
"category": "Amazon Cognito Identity Provider",
"contributor": "",
"description": "Updated descriptions for some API operations and parameters, corrected some errors in Cognito user pools"
},
{
"type": "feature",
"category": "Amazon Simple Email Service",
"contributor": "",
"description": "Introduces support for multi-region endpoint."
},
{
"type": "feature",
"category": "EMR Serverless",
"contributor": "",
"description": "This release adds support for accessing system profile logs in Lake Formation-enabled jobs."
},
{
"type": "feature",
"category": "Timestream InfluxDB",
"contributor": "",
"description": "Adds networkType parameter to CreateDbInstance API which allows IPv6 support to the InfluxDB endpoint"
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Updated endpoint and partition metadata."
}
]
}
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
#### 👋 _Looking for changelogs for older versions? You can find them in the [changelogs](./changelogs) directory._
# __2.29.32__ __2024-12-11__
## __AWS Artifact__
- ### Features
- Add support for listing active customer agreements for the calling AWS Account.

## __AWS CloudTrail__
- ### Features
- Doc-only updates for CloudTrail.

## __AWS Control Catalog__
- ### Features
- Minor documentation updates to the content of ImplementationDetails object part of the Control Catalog GetControl API

## __AWS Migration Hub__
- ### Features
- API and documentation updates for AWS MigrationHub related to adding support for listing migration task updates and associating, disassociating and listing source resources

## __AWS SDK for Java v2__
- ### Features
- Updated endpoint and partition metadata.

## __Amazon Cognito Identity Provider__
- ### Features
- Updated descriptions for some API operations and parameters, corrected some errors in Cognito user pools

## __Amazon Simple Email Service__
- ### Features
- Introduces support for multi-region endpoint.

## __EMR Serverless__
- ### Features
- This release adds support for accessing system profile logs in Lake Formation-enabled jobs.

## __Timestream InfluxDB__
- ### Features
- Adds networkType parameter to CreateDbInstance API which allows IPv6 support to the InfluxDB endpoint

# __2.29.31__ __2024-12-10__
## __AWS Billing and Cost Management Pricing Calculator__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.29.31</version>
<version>2.29.32</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -85,12 +85,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.29.31</version>
<version>2.29.32</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.29.31</version>
<version>2.29.32</version>
</dependency>
```

Expand All @@ -102,7 +102,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.29.31</version>
<version>2.29.32</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-app-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle-logging-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<artifactId>bundle-logging-bridge</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bundle-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<artifactId>bundle-sdk</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.29.32-SNAPSHOT</version>
<version>2.29.33-SNAPSHOT</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public TypeSpec poetSpec() {
.addMethod(addModifier(sdkFieldNameToFieldMethod(), FINAL))
.addTypes(nestedModelClassTypes());

shapeModelSpec.additionalMethods().forEach(specBuilder::addMethod);

if (shapeModel.isUnion()) {
specBuilder.addField(unionTypeField());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.WildcardTypeName;
import java.util.ArrayList;
Expand Down Expand Up @@ -128,7 +129,7 @@ public Iterable<FieldSpec> staticFields(Modifier... modifiers) {
sdkFieldType),
"SDK_NAME_TO_FIELD",
Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL)
.initializer(memberNameToFieldInitializer(nameToField))
.initializer(memberNameToFieldInitializer())
.build());
return fields;
}
Expand All @@ -150,6 +151,22 @@ private CodeBlock sdkFieldInitializer(MemberModel m) {
.build();
}

public List<MethodSpec> additionalMethods() {
return Collections.singletonList(memberNameToFieldInitializerMethod(nameToField()));
}

public Map<String, String> nameToField() {
Map<String, String> nameToField = new LinkedHashMap<>();
shapeModel.getNonStreamingMembers().stream()
.filter(m -> m.getShape() == null || m.getShape().getShapeType() != ShapeType.Exception)
.filter(m -> !m.isSynthetic())
.forEach(m -> {
String name = m.getHttp().getMarshallLocationName();
nameToField.put(name, namingStrategy.getSdkFieldFieldName(m));
});
return nameToField;
}

private CodeBlock containerSdkFieldInitializer(MemberModel m) {
ClassName sdkFieldType = ClassName.get(SdkField.class);
return CodeBlock.builder()
Expand Down Expand Up @@ -392,18 +409,29 @@ private CodeBlock sdkFieldsInitializer(List<FieldSpec> fields) {
return builder.build();
}

private CodeBlock memberNameToFieldInitializer(Map<String, String> nameToField) {
CodeBlock.Builder builder = CodeBlock.builder();
private CodeBlock memberNameToFieldInitializer() {
return CodeBlock.builder()
.add("memberNameToFieldInitializer()")
.build();
}

private MethodSpec memberNameToFieldInitializerMethod(Map<String, String> nameToField) {
ParameterizedTypeName sdkFieldT = ParameterizedTypeName.get(ClassName.get(SdkField.class),
WildcardTypeName.subtypeOf(Object.class));
ParameterizedTypeName mapT = ParameterizedTypeName.get(ClassName.get(Map.class), ClassName.get(String.class),
sdkFieldT);
MethodSpec.Builder builder = MethodSpec.methodBuilder("memberNameToFieldInitializer")
.addModifiers(Modifier.PRIVATE, Modifier.STATIC)
.returns(mapT);

if (nameToField.isEmpty()) {
builder.add("$T.emptyMap()", Collections.class);
return builder.build();
builder.addStatement("return $T.emptyMap()", Collections.class);
} else {
builder.addStatement("$T map = new $T<>()", mapT, HashMap.class);
nameToField.forEach((name, field) -> builder.addStatement("map.put($S, $L)", name, field));
builder.addStatement("return $T.unmodifiableMap(map)", Collections.class);
}
builder.add("$T.unmodifiableMap(", Collections.class);
builder.add("new $T<$T, $T<?>>() {{\n", HashMap.class, String.class, SdkField.class);
nameToField.forEach((name, field) -> builder.add("put($S, $L);\n", name, field));
builder.add("}}");
builder.add(")");

return builder.build();
}

}
Loading

0 comments on commit 37e015b

Please sign in to comment.