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

com.ksc.network.slb.model.transform.DeleteLoadBalancerRequestMarshaller Maven / Gradle / Ivy

There is a newer version: 2.1.8
Show newest version
package com.ksc.network.slb.model.transform;

import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.network.slb.model.DeleteLoadBalancerRequest;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;

/**
 * DeleteLoadBalancerRequest Marshaller
 */

public class DeleteLoadBalancerRequestMarshaller implements
        Marshaller, DeleteLoadBalancerRequest> {

    public Request marshall(
    		DeleteLoadBalancerRequest deleteLoadBalancerRequest) {

        if (deleteLoadBalancerRequest == null) {
            throw new KscClientException(
                    "Invalid argument passed to marshall(...)");
        }

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

        if (!StringUtils.isNullOrEmpty(((DeleteLoadBalancerRequest) deleteLoadBalancerRequest).getLoadBalancerId())) {
            request.addParameter("LoadBalancerId", ((DeleteLoadBalancerRequest) deleteLoadBalancerRequest).getLoadBalancerId());
        }

        return request;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy