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