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

com.aliyuncs.clouddesktop.transform.v20170301.DescribeImagesResponseUnmarshaller 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.clouddesktop.transform.v20170301;

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

import com.aliyuncs.clouddesktop.model.v20170301.DescribeImagesResponse;
import com.aliyuncs.clouddesktop.model.v20170301.DescribeImagesResponse.ImageAttributes;
import com.aliyuncs.transform.UnmarshallerContext;


public class DescribeImagesResponseUnmarshaller {

	public static DescribeImagesResponse unmarshall(DescribeImagesResponse describeImagesResponse, UnmarshallerContext context) {
		
		describeImagesResponse.setRequestId(context.stringValue("DescribeImagesResponse.RequestId"));
		describeImagesResponse.setSuccess(context.booleanValue("DescribeImagesResponse.Success"));
		describeImagesResponse.setMessage(context.stringValue("DescribeImagesResponse.Message"));
		describeImagesResponse.setErrorCode(context.stringValue("DescribeImagesResponse.ErrorCode"));
		describeImagesResponse.setTotal(context.integerValue("DescribeImagesResponse.Total"));
		describeImagesResponse.setPageSize(context.integerValue("DescribeImagesResponse.PageSize"));
		describeImagesResponse.setPageCount(context.integerValue("DescribeImagesResponse.PageCount"));
		describeImagesResponse.setPage(context.integerValue("DescribeImagesResponse.Page"));

		List images = new ArrayList();
		for (int i = 0; i < context.lengthValue("DescribeImagesResponse.Images.Length"); i++) {
			ImageAttributes imageAttributes = new ImageAttributes();
			imageAttributes.setImageId(context.stringValue("DescribeImagesResponse.Images["+ i +"].ImageId"));
			imageAttributes.setImageName(context.stringValue("DescribeImagesResponse.Images["+ i +"].ImageName"));
			imageAttributes.setImageDescription(context.stringValue("DescribeImagesResponse.Images["+ i +"].ImageDescription"));
			imageAttributes.setPlatform(context.stringValue("DescribeImagesResponse.Images["+ i +"].Platform"));
			imageAttributes.setArchitecture(context.stringValue("DescribeImagesResponse.Images["+ i +"].Architecture"));
			imageAttributes.setCreationTime(context.stringValue("DescribeImagesResponse.Images["+ i +"].CreationTime"));
			imageAttributes.setStatus(context.stringValue("DescribeImagesResponse.Images["+ i +"].Status"));
			imageAttributes.setProcess(context.stringValue("DescribeImagesResponse.Images["+ i +"].Process"));
			imageAttributes.setInstanceType(context.stringValue("DescribeImagesResponse.Images["+ i +"].InstanceType"));

			images.add(imageAttributes);
		}
		describeImagesResponse.setImages(images);
	 
	 	return describeImagesResponse;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy