com.ksc.network.eip.model.transform.DisassociateAddressRequestMarshaller Maven / Gradle / Ivy
package com.ksc.network.eip.model.transform;
import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.network.eip.model.DisassociateAddressRequest;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;
/**
* DisassociateAddressRequest Marshaller
*/
public class DisassociateAddressRequestMarshaller implements
Marshaller, DisassociateAddressRequest> {
public Request marshall(
DisassociateAddressRequest disassociateAddressRequest) {
if (disassociateAddressRequest == null) {
throw new KscClientException(
"Invalid argument passed to marshall(...)");
}
Request request = new DefaultRequest(
disassociateAddressRequest, "eip");
request.addParameter("Action", "DisassociateAddress");
String version = disassociateAddressRequest.getVersion();
if (StringUtils.isNullOrEmpty(version)) {
version = "2016-03-04";
}
request.addParameter("Version", version);
request.setHttpMethod(HttpMethodName.GET);
if (!StringUtils.isNullOrEmpty(disassociateAddressRequest.getAllocationId())) {
request.addParameter("AllocationId", disassociateAddressRequest.getAllocationId());
}
return request;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy