All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.transform.RequestLaunchTemplateDataStaxUnmarshaller Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2018-2023 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.*;

/**
 * RequestLaunchTemplateData StAX Unmarshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RequestLaunchTemplateDataStaxUnmarshaller implements Unmarshaller {

    public RequestLaunchTemplateData unmarshall(StaxUnmarshallerContext context) throws Exception {
        RequestLaunchTemplateData requestLaunchTemplateData = new RequestLaunchTemplateData();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument())
            targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument())
                return requestLaunchTemplateData;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

                if (context.testExpression("KernelId", targetDepth)) {
                    requestLaunchTemplateData.setKernelId(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("EbsOptimized", targetDepth)) {
                    requestLaunchTemplateData.setEbsOptimized(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("IamInstanceProfile", targetDepth)) {
                    requestLaunchTemplateData.setIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequestStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("BlockDeviceMapping", targetDepth)) {
                    requestLaunchTemplateData.withBlockDeviceMappings(new ArrayList());
                    continue;
                }

                if (context.testExpression("BlockDeviceMapping/BlockDeviceMapping", targetDepth)) {
                    requestLaunchTemplateData
                            .withBlockDeviceMappings(LaunchTemplateBlockDeviceMappingRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("NetworkInterface", targetDepth)) {
                    requestLaunchTemplateData.withNetworkInterfaces(new ArrayList());
                    continue;
                }

                if (context.testExpression("NetworkInterface/InstanceNetworkInterfaceSpecification", targetDepth)) {
                    requestLaunchTemplateData.withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequestStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("ImageId", targetDepth)) {
                    requestLaunchTemplateData.setImageId(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("InstanceType", targetDepth)) {
                    requestLaunchTemplateData.setInstanceType(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("KeyName", targetDepth)) {
                    requestLaunchTemplateData.setKeyName(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("Monitoring", targetDepth)) {
                    requestLaunchTemplateData.setMonitoring(LaunchTemplatesMonitoringRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("Placement", targetDepth)) {
                    requestLaunchTemplateData.setPlacement(LaunchTemplatePlacementRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("RamDiskId", targetDepth)) {
                    requestLaunchTemplateData.setRamDiskId(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("DisableApiTermination", targetDepth)) {
                    requestLaunchTemplateData.setDisableApiTermination(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("InstanceInitiatedShutdownBehavior", targetDepth)) {
                    requestLaunchTemplateData.setInstanceInitiatedShutdownBehavior(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("UserData", targetDepth)) {
                    requestLaunchTemplateData.setUserData(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("TagSpecification", targetDepth)) {
                    requestLaunchTemplateData.withTagSpecifications(new ArrayList());
                    continue;
                }

                if (context.testExpression("TagSpecification/LaunchTemplateTagSpecificationRequest", targetDepth)) {
                    requestLaunchTemplateData.withTagSpecifications(LaunchTemplateTagSpecificationRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("ElasticGpuSpecification", targetDepth)) {
                    requestLaunchTemplateData.withElasticGpuSpecifications(new ArrayList());
                    continue;
                }

                if (context.testExpression("ElasticGpuSpecification/ElasticGpuSpecification", targetDepth)) {
                    requestLaunchTemplateData.withElasticGpuSpecifications(ElasticGpuSpecificationStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("ElasticInferenceAccelerator", targetDepth)) {
                    requestLaunchTemplateData.withElasticInferenceAccelerators(new ArrayList());
                    continue;
                }

                if (context.testExpression("ElasticInferenceAccelerator/item", targetDepth)) {
                    requestLaunchTemplateData.withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAcceleratorStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("SecurityGroupId", targetDepth)) {
                    requestLaunchTemplateData.withSecurityGroupIds(new ArrayList());
                    continue;
                }

                if (context.testExpression("SecurityGroupId/SecurityGroupId", targetDepth)) {
                    requestLaunchTemplateData.withSecurityGroupIds(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("SecurityGroup", targetDepth)) {
                    requestLaunchTemplateData.withSecurityGroups(new ArrayList());
                    continue;
                }

                if (context.testExpression("SecurityGroup/SecurityGroup", targetDepth)) {
                    requestLaunchTemplateData.withSecurityGroups(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("InstanceMarketOptions", targetDepth)) {
                    requestLaunchTemplateData.setInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequestStaxUnmarshaller.getInstance().unmarshall(
                            context));
                    continue;
                }

                if (context.testExpression("CreditSpecification", targetDepth)) {
                    requestLaunchTemplateData.setCreditSpecification(CreditSpecificationRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("CpuOptions", targetDepth)) {
                    requestLaunchTemplateData.setCpuOptions(LaunchTemplateCpuOptionsRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("CapacityReservationSpecification", targetDepth)) {
                    requestLaunchTemplateData.setCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequestStaxUnmarshaller
                            .getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("LicenseSpecification", targetDepth)) {
                    requestLaunchTemplateData.withLicenseSpecifications(new ArrayList());
                    continue;
                }

                if (context.testExpression("LicenseSpecification/item", targetDepth)) {
                    requestLaunchTemplateData.withLicenseSpecifications(LaunchTemplateLicenseConfigurationRequestStaxUnmarshaller.getInstance().unmarshall(
                            context));
                    continue;
                }

                if (context.testExpression("HibernationOptions", targetDepth)) {
                    requestLaunchTemplateData.setHibernationOptions(LaunchTemplateHibernationOptionsRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("MetadataOptions", targetDepth)) {
                    requestLaunchTemplateData
                            .setMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("EnclaveOptions", targetDepth)) {
                    requestLaunchTemplateData.setEnclaveOptions(LaunchTemplateEnclaveOptionsRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("InstanceRequirements", targetDepth)) {
                    requestLaunchTemplateData.setInstanceRequirements(InstanceRequirementsRequestStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("PrivateDnsNameOptions", targetDepth)) {
                    requestLaunchTemplateData.setPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequestStaxUnmarshaller.getInstance().unmarshall(
                            context));
                    continue;
                }

                if (context.testExpression("MaintenanceOptions", targetDepth)) {
                    requestLaunchTemplateData.setMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequestStaxUnmarshaller.getInstance().unmarshall(
                            context));
                    continue;
                }

                if (context.testExpression("DisableApiStop", targetDepth)) {
                    requestLaunchTemplateData.setDisableApiStop(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }
            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return requestLaunchTemplateData;
                }
            }
        }
    }

    private static RequestLaunchTemplateDataStaxUnmarshaller instance;

    public static RequestLaunchTemplateDataStaxUnmarshaller getInstance() {
        if (instance == null)
            instance = new RequestLaunchTemplateDataStaxUnmarshaller();
        return instance;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy