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

com.aliyuncs.ens.transform.v20171110.DescribeAvailableResourceInfoResponseUnmarshaller Maven / Gradle / Ivy

Go to download

Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

The newest version!
/*
 * 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.ens.transform.v20171110;

import java.util.ArrayList;
import java.util.List;

import com.aliyuncs.ens.model.v20171110.DescribeAvailableResourceInfoResponse;
import com.aliyuncs.ens.model.v20171110.DescribeAvailableResourceInfoResponse.Image;
import com.aliyuncs.ens.model.v20171110.DescribeAvailableResourceInfoResponse.SupportResource;
import com.aliyuncs.ens.model.v20171110.DescribeAvailableResourceInfoResponse.SupportResource.EnsRegionId;
import com.aliyuncs.transform.UnmarshallerContext;


public class DescribeAvailableResourceInfoResponseUnmarshaller {

	public static DescribeAvailableResourceInfoResponse unmarshall(DescribeAvailableResourceInfoResponse describeAvailableResourceInfoResponse, UnmarshallerContext _ctx) {
		
		describeAvailableResourceInfoResponse.setRequestId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.RequestId"));

		List images = new ArrayList();
		for (int i = 0; i < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.Images.Length"); i++) {
			Image image = new Image();
			image.setImageSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.Images["+ i +"].ImageSize"));
			image.setImageName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.Images["+ i +"].ImageName"));
			image.setImageId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.Images["+ i +"].ImageId"));

			images.add(image);
		}
		describeAvailableResourceInfoResponse.setImages(images);

		List supportResources = new ArrayList();
		for (int i = 0; i < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources.Length"); i++) {
			SupportResource supportResource = new SupportResource();
			supportResource.setDataDiskMaxSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].DataDiskMaxSize"));
			supportResource.setSystemDiskMinSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].SystemDiskMinSize"));
			supportResource.setSystemDiskMaxSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].SystemDiskMaxSize"));
			supportResource.setDataDiskMinSize(_ctx.integerValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].DataDiskMinSize"));

			List bandwidthTypes = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].BandwidthTypes.Length"); j++) {
				bandwidthTypes.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].BandwidthTypes["+ j +"]"));
			}
			supportResource.setBandwidthTypes(bandwidthTypes);

			List ensRegionIds = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIds.Length"); j++) {
				ensRegionIds.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIds["+ j +"]"));
			}
			supportResource.setEnsRegionIds(ensRegionIds);

			List instanceSpeces = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].InstanceSpeces.Length"); j++) {
				instanceSpeces.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].InstanceSpeces["+ j +"]"));
			}
			supportResource.setInstanceSpeces(instanceSpeces);

			List isp = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].Isp.Length"); j++) {
				isp.add(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].Isp["+ j +"]"));
			}
			supportResource.setIsp(isp);

			List ensRegionIdsExtends = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends.Length"); j++) {
				EnsRegionId ensRegionId = new EnsRegionId();
				ensRegionId.setEnsRegionId(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].EnsRegionId"));
				ensRegionId.setEnName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].EnName"));
				ensRegionId.setArea(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].Area"));
				ensRegionId.setName(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].Name"));
				ensRegionId.setProvince(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].Province"));
				ensRegionId.setIsp(_ctx.stringValue("DescribeAvailableResourceInfoResponse.SupportResources["+ i +"].EnsRegionIdsExtends["+ j +"].Isp"));

				ensRegionIdsExtends.add(ensRegionId);
			}
			supportResource.setEnsRegionIdsExtends(ensRegionIdsExtends);

			supportResources.add(supportResource);
		}
		describeAvailableResourceInfoResponse.setSupportResources(supportResources);
	 
	 	return describeAvailableResourceInfoResponse;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy