/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the elasticache-2015-02-02.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.ElastiCache.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.ElastiCache.Model.Internal.MarshallTransformations
{
///
/// Response Unmarshaller for ReplicationGroup Object
///
public class ReplicationGroupUnmarshaller : IUnmarshaller, IUnmarshaller
{
///
/// Unmarshaller the response from the service to the response class.
///
///
///
public ReplicationGroup Unmarshall(XmlUnmarshallerContext context)
{
ReplicationGroup unmarshalledObject = new ReplicationGroup();
int originalDepth = context.CurrentDepth;
int targetDepth = originalDepth + 1;
if (context.IsStartOfDocument)
targetDepth += 2;
while (context.ReadAtDepth(originalDepth))
{
if (context.IsStartElement || context.IsAttribute)
{
if (context.TestExpression("ARN", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ARN = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AtRestEncryptionEnabled", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.AtRestEncryptionEnabled = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AuthTokenEnabled", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.AuthTokenEnabled = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AuthTokenLastModifiedDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.AuthTokenLastModifiedDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AutomaticFailover", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AutomaticFailover = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AutoMinorVersionUpgrade", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.AutoMinorVersionUpgrade = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CacheNodeType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CacheNodeType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ClusterEnabled", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.ClusterEnabled = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ClusterMode", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ClusterMode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ConfigurationEndpoint", targetDepth))
{
var unmarshaller = EndpointUnmarshaller.Instance;
unmarshalledObject.ConfigurationEndpoint = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DataTiering", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DataTiering = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Description", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Description = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("GlobalReplicationGroupInfo", targetDepth))
{
var unmarshaller = GlobalReplicationGroupInfoUnmarshaller.Instance;
unmarshalledObject.GlobalReplicationGroupInfo = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IpDiscovery", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.IpDiscovery = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("KmsKeyId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.KmsKeyId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("LogDeliveryConfigurations/LogDeliveryConfiguration", targetDepth))
{
var unmarshaller = LogDeliveryConfigurationUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.LogDeliveryConfigurations.Add(item);
continue;
}
if (context.TestExpression("MemberClusters/ClusterId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.MemberClusters.Add(item);
continue;
}
if (context.TestExpression("MemberClustersOutpostArns/ReplicationGroupOutpostArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.MemberClustersOutpostArns.Add(item);
continue;
}
if (context.TestExpression("MultiAZ", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.MultiAZ = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("NetworkType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.NetworkType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("NodeGroups/NodeGroup", targetDepth))
{
var unmarshaller = NodeGroupUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.NodeGroups.Add(item);
continue;
}
if (context.TestExpression("PendingModifiedValues", targetDepth))
{
var unmarshaller = ReplicationGroupPendingModifiedValuesUnmarshaller.Instance;
unmarshalledObject.PendingModifiedValues = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReplicationGroupCreateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.ReplicationGroupCreateTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReplicationGroupId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReplicationGroupId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SnapshotRetentionLimit", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.SnapshotRetentionLimit = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SnapshottingClusterId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.SnapshottingClusterId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SnapshotWindow", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.SnapshotWindow = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("TransitEncryptionEnabled", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.TransitEncryptionEnabled = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("TransitEncryptionMode", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TransitEncryptionMode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("UserGroupIds/member", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.UserGroupIds.Add(item);
continue;
}
}
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
{
return unmarshalledObject;
}
}
return unmarshalledObject;
}
///
/// Unmarshaller error response to exception.
///
///
///
public ReplicationGroup Unmarshall(JsonUnmarshallerContext context)
{
return null;
}
private static ReplicationGroupUnmarshaller _instance = new ReplicationGroupUnmarshaller();
///
/// Gets the singleton.
///
public static ReplicationGroupUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}