![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.ec2.model.transform.CapacityReservationStaxUnmarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-ec2 Show documentation
Show all versions of aws-java-sdk-ec2 Show documentation
The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model.transform;
import java.util.ArrayList;
import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;
/**
* CapacityReservation StAX Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CapacityReservationStaxUnmarshaller implements Unmarshaller {
public CapacityReservation unmarshall(StaxUnmarshallerContext context) throws Exception {
CapacityReservation capacityReservation = new CapacityReservation();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
if (context.isStartOfDocument())
targetDepth += 1;
while (true) {
XMLEvent xmlEvent = context.nextEvent();
if (xmlEvent.isEndDocument())
return capacityReservation;
if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
if (context.testExpression("capacityReservationId", targetDepth)) {
capacityReservation.setCapacityReservationId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("ownerId", targetDepth)) {
capacityReservation.setOwnerId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("capacityReservationArn", targetDepth)) {
capacityReservation.setCapacityReservationArn(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("availabilityZoneId", targetDepth)) {
capacityReservation.setAvailabilityZoneId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("instanceType", targetDepth)) {
capacityReservation.setInstanceType(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("instancePlatform", targetDepth)) {
capacityReservation.setInstancePlatform(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("availabilityZone", targetDepth)) {
capacityReservation.setAvailabilityZone(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("tenancy", targetDepth)) {
capacityReservation.setTenancy(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("totalInstanceCount", targetDepth)) {
capacityReservation.setTotalInstanceCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("availableInstanceCount", targetDepth)) {
capacityReservation.setAvailableInstanceCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("ebsOptimized", targetDepth)) {
capacityReservation.setEbsOptimized(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("ephemeralStorage", targetDepth)) {
capacityReservation.setEphemeralStorage(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("state", targetDepth)) {
capacityReservation.setState(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("startDate", targetDepth)) {
capacityReservation.setStartDate(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));
continue;
}
if (context.testExpression("endDate", targetDepth)) {
capacityReservation.setEndDate(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));
continue;
}
if (context.testExpression("endDateType", targetDepth)) {
capacityReservation.setEndDateType(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("instanceMatchCriteria", targetDepth)) {
capacityReservation.setInstanceMatchCriteria(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("createDate", targetDepth)) {
capacityReservation.setCreateDate(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));
continue;
}
if (context.testExpression("tagSet", targetDepth)) {
capacityReservation.withTags(new ArrayList());
continue;
}
if (context.testExpression("tagSet/item", targetDepth)) {
capacityReservation.withTags(TagStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("outpostArn", targetDepth)) {
capacityReservation.setOutpostArn(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("capacityReservationFleetId", targetDepth)) {
capacityReservation.setCapacityReservationFleetId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("placementGroupArn", targetDepth)) {
capacityReservation.setPlacementGroupArn(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("capacityAllocationSet", targetDepth)) {
capacityReservation.withCapacityAllocations(new ArrayList());
continue;
}
if (context.testExpression("capacityAllocationSet/item", targetDepth)) {
capacityReservation.withCapacityAllocations(CapacityAllocationStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("reservationType", targetDepth)) {
capacityReservation.setReservationType(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
} else if (xmlEvent.isEndElement()) {
if (context.getCurrentDepth() < originalDepth) {
return capacityReservation;
}
}
}
}
private static CapacityReservationStaxUnmarshaller instance;
public static CapacityReservationStaxUnmarshaller getInstance() {
if (instance == null)
instance = new CapacityReservationStaxUnmarshaller();
return instance;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy