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

com.ksyun.api.sdk.kec.transform.DescribeInstanceVncRequestMarshaller Maven / Gradle / Ivy

There is a newer version: 2.1.8
Show newest version
package com.ksyun.api.sdk.kec.transform;

import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;
import com.ksyun.api.sdk.kec.model.DescribeInstanceVncRequest;

public class DescribeInstanceVncRequestMarshaller 
       implements Marshaller, DescribeInstanceVncRequest>{
	
	@Override
	public Request marshall(DescribeInstanceVncRequest describeInstanceVncRequest){
		 if (describeInstanceVncRequest == null) {
	            throw new KscClientException(
	                    "Invalid argument passed to marshall(...)");
	        }

	        Request request = new DefaultRequest(
	        		describeInstanceVncRequest, "kec");
	        request.addParameter("Action", "DescribeInstanceVnc");
	        String version=describeInstanceVncRequest.getVersion();
	        if(StringUtils.isNullOrEmpty(version)){
	        	version="2016-03-04";
	        }
	        request.addParameter("Version", version);
	        request.setHttpMethod(HttpMethodName.GET);

	        if(describeInstanceVncRequest.getInstanceId() != null){
	        	request.addParameter("InstanceId", 
	        			StringUtils.fromString(describeInstanceVncRequest.getInstanceId()));
	        }
	        
	        return request;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy