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

com.ksc.network.vpc.transform.SecurityGroups.ModifySecurityGroupRequestMarshaller Maven / Gradle / Ivy

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

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

/**
 * ModifySecurityGroupRequest Marshaller
 */

public class ModifySecurityGroupRequestMarshaller implements
        Marshaller, ModifySecurityGroupRequest> {

    public Request marshall(
    		ModifySecurityGroupRequest modifySecurityGroupRequest) {

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

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

        if (!StringUtils.isNullOrEmpty(modifySecurityGroupRequest.getSecurityGroupId())) {
            request.addParameter("SecurityGroupId", modifySecurityGroupRequest.getSecurityGroupId());
        }

        if (!StringUtils.isNullOrEmpty(modifySecurityGroupRequest.getSecurityGroupName())) {
            request.addParameter("SecurityGroupName", modifySecurityGroupRequest.getSecurityGroupName());
        }

        return request;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy