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

software.amazon.awssdk.services.protocolrestjson.transform.MembersInQueryParamsRequestModelMarshaller Maven / Gradle / Ivy

There is a newer version: 2.0.6
Show newest version
/*
 * Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.protocolrestjson.transform;

import java.time.Instant;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingInfo;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.services.protocolrestjson.model.MembersInQueryParamsRequest;
import software.amazon.awssdk.utils.Validate;

/**
 * {@link MembersInQueryParamsRequest} Marshaller
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public class MembersInQueryParamsRequestModelMarshaller {
    private static final MarshallingInfo STRINGQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("String").isBinary(false).build();

    private static final MarshallingInfo BOOLEANQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Boolean").isBinary(false).build();

    private static final MarshallingInfo INTEGERQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Integer").isBinary(false).build();

    private static final MarshallingInfo LONGQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Long").isBinary(false).build();

    private static final MarshallingInfo FLOATQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.FLOAT)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Float").isBinary(false).build();

    private static final MarshallingInfo DOUBLEQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Double").isBinary(false).build();

    private static final MarshallingInfo TIMESTAMPQUERYPARAM_BINDING = MarshallingInfo.builder(MarshallingType.INSTANT)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("Timestamp").isBinary(false).build();

    private static final MarshallingInfo LISTOFSTRINGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("item").isBinary(false).build();

    private static final MarshallingInfo MAPOFSTRINGTOSTRING_BINDING = MarshallingInfo.builder(MarshallingType.MAP)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("MapOfStringToString").isBinary(false).build();

    private static final MembersInQueryParamsRequestModelMarshaller INSTANCE = new MembersInQueryParamsRequestModelMarshaller();

    private MembersInQueryParamsRequestModelMarshaller() {
    }

    public static MembersInQueryParamsRequestModelMarshaller getInstance() {
        return INSTANCE;
    }

    /**
     * Marshall the given parameter object
     */
    public void marshall(MembersInQueryParamsRequest membersInQueryParamsRequest, ProtocolMarshaller protocolMarshaller) {
        Validate.paramNotNull(membersInQueryParamsRequest, "membersInQueryParamsRequest");
        Validate.paramNotNull(protocolMarshaller, "protocolMarshaller");
        try {
            protocolMarshaller.marshall(membersInQueryParamsRequest.stringQueryParam(), STRINGQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.booleanQueryParam(), BOOLEANQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.integerQueryParam(), INTEGERQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.longQueryParam(), LONGQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.floatQueryParam(), FLOATQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.doubleQueryParam(), DOUBLEQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.timestampQueryParam(), TIMESTAMPQUERYPARAM_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.listOfStrings(), LISTOFSTRINGS_BINDING);
            protocolMarshaller.marshall(membersInQueryParamsRequest.mapOfStringToString(), MAPOFSTRINGTOSTRING_BINDING);
        } catch (Exception e) {
            throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy