com.aliyuncs.vpc.transform.v20160428.DescribeNatGatewaysResponseUnmarshaller Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.aliyuncs.vpc.transform.v20160428;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.vpc.model.v20160428.DescribeNatGatewaysResponse;
import com.aliyuncs.vpc.model.v20160428.DescribeNatGatewaysResponse.NatGateway;
import com.aliyuncs.vpc.model.v20160428.DescribeNatGatewaysResponse.NatGateway.IpList;
import com.aliyuncs.transform.UnmarshallerContext;
public class DescribeNatGatewaysResponseUnmarshaller {
public static DescribeNatGatewaysResponse unmarshall(DescribeNatGatewaysResponse describeNatGatewaysResponse, UnmarshallerContext context) {
describeNatGatewaysResponse.setRequestId(context.stringValue("DescribeNatGatewaysResponse.RequestId"));
describeNatGatewaysResponse.setTotalCount(context.integerValue("DescribeNatGatewaysResponse.TotalCount"));
describeNatGatewaysResponse.setPageNumber(context.integerValue("DescribeNatGatewaysResponse.PageNumber"));
describeNatGatewaysResponse.setPageSize(context.integerValue("DescribeNatGatewaysResponse.PageSize"));
List natGateways = new ArrayList();
for (int i = 0; i < context.lengthValue("DescribeNatGatewaysResponse.NatGateways.Length"); i++) {
NatGateway natGateway = new NatGateway();
natGateway.setNatGatewayId(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].NatGatewayId"));
natGateway.setRegionId(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].RegionId"));
natGateway.setName(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].Name"));
natGateway.setDescription(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].Description"));
natGateway.setVpcId(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].VpcId"));
natGateway.setSpec(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].Spec"));
natGateway.setInstanceChargeType(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].InstanceChargeType"));
natGateway.setBusinessStatus(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].BusinessStatus"));
natGateway.setCreationTime(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].CreationTime"));
natGateway.setStatus(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].Status"));
List forwardTableIds = new ArrayList();
for (int j = 0; j < context.lengthValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].ForwardTableIds.Length"); j++) {
forwardTableIds.add(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].ForwardTableIds["+ j +"]"));
}
natGateway.setForwardTableIds(forwardTableIds);
List snatTableIds = new ArrayList();
for (int j = 0; j < context.lengthValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].SnatTableIds.Length"); j++) {
snatTableIds.add(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].SnatTableIds["+ j +"]"));
}
natGateway.setSnatTableIds(snatTableIds);
List bandwidthPackageIds = new ArrayList();
for (int j = 0; j < context.lengthValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].BandwidthPackageIds.Length"); j++) {
bandwidthPackageIds.add(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].BandwidthPackageIds["+ j +"]"));
}
natGateway.setBandwidthPackageIds(bandwidthPackageIds);
List ipLists = new ArrayList();
for (int j = 0; j < context.lengthValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].IpLists.Length"); j++) {
IpList ipList = new IpList();
ipList.setAllocationId(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].IpLists["+ j +"].AllocationId"));
ipList.setIpAddress(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].IpLists["+ j +"].IpAddress"));
ipList.setUsingStatus(context.stringValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].IpLists["+ j +"].UsingStatus"));
ipList.setApAccessEnabled(context.booleanValue("DescribeNatGatewaysResponse.NatGateways["+ i +"].IpLists["+ j +"].ApAccessEnabled"));
ipLists.add(ipList);
}
natGateway.setIpLists(ipLists);
natGateways.add(natGateway);
}
describeNatGatewaysResponse.setNatGateways(natGateways);
return describeNatGatewaysResponse;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy