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

com.ksyun.api.sdk.kec.transform.ModifyImageAttributeRequestMarshaller 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.ModifyImageAttributeRequest;

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

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

	        if(modifyImageAttributeRequest.getImageId() != null){
	        	request.addParameter("ImageId", 
	        			StringUtils.fromString(modifyImageAttributeRequest.getImageId()));
	        }
	        
	        if(modifyImageAttributeRequest.getName() != null){
	        	request.addParameter("Name", 
                        StringUtils.fromString(modifyImageAttributeRequest.getName()));
	        }

	        return request;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy