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

com.ksc.network.vpc.transform.Nat.DisassociateNatRequestMarshaller Maven / Gradle / Ivy

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

import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.network.vpc.model.Nat.DisassociateNatRequest;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;

/**
 * DisassociateNatRequest Marshaller
 */

public class DisassociateNatRequestMarshaller implements
        Marshaller, DisassociateNatRequest> {

    public Request marshall(
            DisassociateNatRequest disassociateNatRequest) {

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

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

        if (!StringUtils.isNullOrEmpty(((DisassociateNatRequest) disassociateNatRequest).getNatId())) {
            request.addParameter("NatId", ((DisassociateNatRequest) disassociateNatRequest).getNatId());
        }
        if (!StringUtils.isNullOrEmpty(((DisassociateNatRequest) disassociateNatRequest).getSubnetId())) {
            request.addParameter("SubnetId", ((DisassociateNatRequest) disassociateNatRequest).getSubnetId());
        }

        return request;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy