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

com.amazonaws.services.xray.model.transform.SamplingRuleUpdateMarshaller Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS X-Ray module holds the client classes that are used for communicating with AWS X-Ray Service

The newest version!
/*
 * Copyright 2019-2024 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 com.amazonaws.services.xray.model.transform;

import java.util.Map;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.xray.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * SamplingRuleUpdateMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class SamplingRuleUpdateMarshaller {

    private static final MarshallingInfo RULENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("RuleName").build();
    private static final MarshallingInfo RULEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("RuleARN").build();
    private static final MarshallingInfo RESOURCEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ResourceARN").build();
    private static final MarshallingInfo PRIORITY_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Priority").build();
    private static final MarshallingInfo FIXEDRATE_BINDING = MarshallingInfo.builder(MarshallingType.DOUBLE).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("FixedRate").build();
    private static final MarshallingInfo RESERVOIRSIZE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ReservoirSize").build();
    private static final MarshallingInfo HOST_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Host").build();
    private static final MarshallingInfo SERVICENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ServiceName").build();
    private static final MarshallingInfo SERVICETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ServiceType").build();
    private static final MarshallingInfo HTTPMETHOD_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("HTTPMethod").build();
    private static final MarshallingInfo URLPATH_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("URLPath").build();
    private static final MarshallingInfo ATTRIBUTES_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Attributes").build();

    private static final SamplingRuleUpdateMarshaller instance = new SamplingRuleUpdateMarshaller();

    public static SamplingRuleUpdateMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(SamplingRuleUpdate samplingRuleUpdate, ProtocolMarshaller protocolMarshaller) {

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

        try {
            protocolMarshaller.marshall(samplingRuleUpdate.getRuleName(), RULENAME_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getRuleARN(), RULEARN_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getResourceARN(), RESOURCEARN_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getPriority(), PRIORITY_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getFixedRate(), FIXEDRATE_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getReservoirSize(), RESERVOIRSIZE_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getHost(), HOST_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getServiceName(), SERVICENAME_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getServiceType(), SERVICETYPE_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getHTTPMethod(), HTTPMETHOD_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getURLPath(), URLPATH_BINDING);
            protocolMarshaller.marshall(samplingRuleUpdate.getAttributes(), ATTRIBUTES_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy