com.amazonaws.services.dax.model.transform.ClusterMarshaller Maven / Gradle / Ivy
/*
* 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 com.amazonaws.services.dax.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.dax.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ClusterMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ClusterMarshaller {
private static final MarshallingInfo CLUSTERNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ClusterName").build();
private static final MarshallingInfo DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build();
private static final MarshallingInfo CLUSTERARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ClusterArn").build();
private static final MarshallingInfo TOTALNODES_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TotalNodes").build();
private static final MarshallingInfo ACTIVENODES_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ActiveNodes").build();
private static final MarshallingInfo NODETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("NodeType").build();
private static final MarshallingInfo STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Status").build();
private static final MarshallingInfo CLUSTERDISCOVERYENDPOINT_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ClusterDiscoveryEndpoint").build();
private static final MarshallingInfo NODEIDSTOREMOVE_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NodeIdsToRemove").build();
private static final MarshallingInfo NODES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Nodes").build();
private static final MarshallingInfo PREFERREDMAINTENANCEWINDOW_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PreferredMaintenanceWindow").build();
private static final MarshallingInfo NOTIFICATIONCONFIGURATION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NotificationConfiguration").build();
private static final MarshallingInfo SUBNETGROUP_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SubnetGroup").build();
private static final MarshallingInfo SECURITYGROUPS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SecurityGroups").build();
private static final MarshallingInfo IAMROLEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("IamRoleArn").build();
private static final MarshallingInfo PARAMETERGROUP_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ParameterGroup").build();
private static final MarshallingInfo SSEDESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("SSEDescription").build();
private static final ClusterMarshaller instance = new ClusterMarshaller();
public static ClusterMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(Cluster cluster, ProtocolMarshaller protocolMarshaller) {
if (cluster == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(cluster.getClusterName(), CLUSTERNAME_BINDING);
protocolMarshaller.marshall(cluster.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(cluster.getClusterArn(), CLUSTERARN_BINDING);
protocolMarshaller.marshall(cluster.getTotalNodes(), TOTALNODES_BINDING);
protocolMarshaller.marshall(cluster.getActiveNodes(), ACTIVENODES_BINDING);
protocolMarshaller.marshall(cluster.getNodeType(), NODETYPE_BINDING);
protocolMarshaller.marshall(cluster.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(cluster.getClusterDiscoveryEndpoint(), CLUSTERDISCOVERYENDPOINT_BINDING);
protocolMarshaller.marshall(cluster.getNodeIdsToRemove(), NODEIDSTOREMOVE_BINDING);
protocolMarshaller.marshall(cluster.getNodes(), NODES_BINDING);
protocolMarshaller.marshall(cluster.getPreferredMaintenanceWindow(), PREFERREDMAINTENANCEWINDOW_BINDING);
protocolMarshaller.marshall(cluster.getNotificationConfiguration(), NOTIFICATIONCONFIGURATION_BINDING);
protocolMarshaller.marshall(cluster.getSubnetGroup(), SUBNETGROUP_BINDING);
protocolMarshaller.marshall(cluster.getSecurityGroups(), SECURITYGROUPS_BINDING);
protocolMarshaller.marshall(cluster.getIamRoleArn(), IAMROLEARN_BINDING);
protocolMarshaller.marshall(cluster.getParameterGroup(), PARAMETERGROUP_BINDING);
protocolMarshaller.marshall(cluster.getSSEDescription(), SSEDESCRIPTION_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}