/*
* 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 docdb-2014-10-31.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.DocDB.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.DocDB.Model.Internal.MarshallTransformations
{
///
/// Response Unmarshaller for DBInstance Object
///
public class DBInstanceUnmarshaller : IUnmarshaller, IUnmarshaller
{
///
/// Unmarshaller the response from the service to the response class.
///
///
///
public DBInstance Unmarshall(XmlUnmarshallerContext context)
{
DBInstance unmarshalledObject = new DBInstance();
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("AutoMinorVersionUpgrade", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.AutoMinorVersionUpgrade = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("AvailabilityZone", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AvailabilityZone = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupRetentionPeriod", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.BackupRetentionPeriod = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CACertificateIdentifier", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CACertificateIdentifier = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CopyTagsToSnapshot", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.CopyTagsToSnapshot = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBClusterIdentifier", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DBClusterIdentifier = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBInstanceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DBInstanceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBInstanceClass", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DBInstanceClass = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBInstanceIdentifier", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DBInstanceIdentifier = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBInstanceStatus", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DBInstanceStatus = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DbiResourceId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DbiResourceId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DBSubnetGroup", targetDepth))
{
var unmarshaller = DBSubnetGroupUnmarshaller.Instance;
unmarshalledObject.DBSubnetGroup = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("EnabledCloudwatchLogsExports/member", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.EnabledCloudwatchLogsExports.Add(item);
continue;
}
if (context.TestExpression("Endpoint", targetDepth))
{
var unmarshaller = EndpointUnmarshaller.Instance;
unmarshalledObject.Endpoint = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Engine", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Engine = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("EngineVersion", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.EngineVersion = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("InstanceCreateTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.InstanceCreateTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("KmsKeyId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.KmsKeyId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("LatestRestorableTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LatestRestorableTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PendingModifiedValues", targetDepth))
{
var unmarshaller = PendingModifiedValuesUnmarshaller.Instance;
unmarshalledObject.PendingModifiedValues = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PreferredBackupWindow", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PreferredBackupWindow = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PreferredMaintenanceWindow", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PreferredMaintenanceWindow = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PromotionTier", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.PromotionTier = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PubliclyAccessible", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.PubliclyAccessible = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("StatusInfos/DBInstanceStatusInfo", targetDepth))
{
var unmarshaller = DBInstanceStatusInfoUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.StatusInfos.Add(item);
continue;
}
if (context.TestExpression("StorageEncrypted", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.StorageEncrypted = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("VpcSecurityGroups/VpcSecurityGroupMembership", targetDepth))
{
var unmarshaller = VpcSecurityGroupMembershipUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
unmarshalledObject.VpcSecurityGroups.Add(item);
continue;
}
}
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
{
return unmarshalledObject;
}
}
return unmarshalledObject;
}
///
/// Unmarshaller error response to exception.
///
///
///
public DBInstance Unmarshall(JsonUnmarshallerContext context)
{
return null;
}
private static DBInstanceUnmarshaller _instance = new DBInstanceUnmarshaller();
///
/// Gets the singleton.
///
public static DBInstanceUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}