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

com.ksc.kvs.model.transform.GetPresetDetailRequestMarshaller Maven / Gradle / Ivy

package com.ksc.kvs.model.transform;

import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.kvs.model.GetPresetDetailRequest;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;

public class GetPresetDetailRequestMarshaller implements
Marshaller, GetPresetDetailRequest>{
	
	public Request marshall(GetPresetDetailRequest getPresetDetailRequest) {
		if (getPresetDetailRequest == null) {
            throw new KscClientException(
                    "Invalid argument passed to marshall(...)");
        }
		Request request = new DefaultRequest(
				getPresetDetailRequest, "kvs");
		
        request.addParameter("Action","GetPresetDetail");
        String version=getPresetDetailRequest.getVersion();
        if(org.apache.commons.lang.StringUtils.isBlank(version)){
        	version="2017-01-01";
        }
        request.addParameter("Version", version);
        request.setHttpMethod(HttpMethodName.GET);
        if(!getPresetDetailRequest.getPreset().isEmpty()){
        	request.addParameter("Preset",
                    StringUtils.fromString(getPresetDetailRequest.getPreset()));
        }
        
		return request;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy