Closed
Description
Describe the bug
When calling describeInternetGateways
and iterating over the attachments, the method stateAsString
returns available
while the corresponding state()
method returns UNKNOWN_TO_SDK
(should presumably return a specific enum value AVAILABLE).
These values are defined in AttachmentStatus
class
Expected Behavior
return an enum value AVAILABLE
.
Current Behavior
returns enum UNKNOWN_TO_SDK
Reproduction Steps
try (var client = Ec2Client.builder().build()) {
var igResp = client.describeInternetGateways(DescribeInternetGatewaysRequest.builder().build());
for (var igw : igResp.internetGateways()) {
for (var att : igw.attachments()) {
if (att.stateAsString().equalsIgnoreCase("available")) {
System.out.println("string=" + att.stateAsString());
System.out.println("enum=" + att.state());
}
}
}
}
prints
string=available
enum=null
Possible Solution
In services/ec2/src/main/resources/codegen-resources/service-2.json:8940
add another value available
.
Additional Information/Context
The API XML DescribeInternetGatewaysResponse
looks like the following (note the "available" value)
<item>
<internetGatewayId>igw-0ad14a26af5152f82</internetGatewayId>
<ownerId>036476006320</ownerId>
<attachmentSet>
<item>
<vpcId>vpc-04f987fff6675ec10</vpcId>
<state>available</state>
</item>
</attachmentSet>
AWS Java SDK version used
2.26.18
JDK version used
openjdk version "17.0.9" 2023-10-17
Operating System and version
Linux 5.10.219-208.866.amzn2.x86_64 #1 SMP Tue Jun 18 14:00:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux