com.ksyun.api.sdk.kec.transform.RemoveImagesRequestMarshaller Maven / Gradle / Ivy
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.RemoveImagesRequest;
public class RemoveImagesRequestMarshaller
implements Marshaller, RemoveImagesRequest>{
@Override
public Request marshall(RemoveImagesRequest removeImagesRequest){
if (removeImagesRequest == null) {
throw new KscClientException(
"Invalid argument passed to marshall(...)");
}
Request request = new DefaultRequest(
removeImagesRequest, "kec");
request.addParameter("Action", "RemoveImages");
String version=removeImagesRequest.getVersion();
if(StringUtils.isNullOrEmpty(version)){
version="2016-03-04";
}
request.addParameter("Version", version);
request.setHttpMethod(HttpMethodName.GET);
if(removeImagesRequest.getImageId() != null){
request.addParameter("ImageId",
StringUtils.fromString(removeImagesRequest.getImageId()));
}
return request;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy