/*
* 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 ecs-2014-11-13.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.ECS.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.ECS.Model.Internal.MarshallTransformations
{
///
/// Response Unmarshaller for Task Object
///
public class TaskUnmarshaller : IUnmarshaller, IUnmarshaller
{
///
/// Unmarshaller the response from the service to the response class.
///
///
///
Task IUnmarshaller.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
///
/// Unmarshaller the response from the service to the response class.
///
///
///
public Task Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
Task unmarshalledObject = new Task();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("attachments", targetDepth))
{
var unmarshaller = new ListUnmarshaller(AttachmentUnmarshaller.Instance);
unmarshalledObject.Attachments = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("attributes", targetDepth))
{
var unmarshaller = new ListUnmarshaller(AttributeUnmarshaller.Instance);
unmarshalledObject.Attributes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("availabilityZone", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AvailabilityZone = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("capacityProviderName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CapacityProviderName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("clusterArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ClusterArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("connectivity", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Connectivity = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("connectivityAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.ConnectivityAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("containerInstanceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ContainerInstanceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("containers", targetDepth))
{
var unmarshaller = new ListUnmarshaller(ContainerUnmarshaller.Instance);
unmarshalledObject.Containers = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("cpu", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Cpu = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("createdAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreatedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("desiredStatus", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DesiredStatus = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("enableExecuteCommand", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.EnableExecuteCommand = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ephemeralStorage", targetDepth))
{
var unmarshaller = EphemeralStorageUnmarshaller.Instance;
unmarshalledObject.EphemeralStorage = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("executionStoppedAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.ExecutionStoppedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("group", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Group = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("healthStatus", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.HealthStatus = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("inferenceAccelerators", targetDepth))
{
var unmarshaller = new ListUnmarshaller(InferenceAcceleratorUnmarshaller.Instance);
unmarshalledObject.InferenceAccelerators = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("lastStatus", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.LastStatus = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("launchType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.LaunchType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("memory", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Memory = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("overrides", targetDepth))
{
var unmarshaller = TaskOverrideUnmarshaller.Instance;
unmarshalledObject.Overrides = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("platformFamily", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PlatformFamily = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("platformVersion", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PlatformVersion = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("pullStartedAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.PullStartedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("pullStoppedAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.PullStoppedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("startedAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.StartedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("startedBy", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StartedBy = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stopCode", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StopCode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stoppedAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.StoppedAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stoppedReason", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StoppedReason = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stoppingAt", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.StoppingAt = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("tags", targetDepth))
{
var unmarshaller = new ListUnmarshaller(TagUnmarshaller.Instance);
unmarshalledObject.Tags = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("taskArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TaskArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("taskDefinitionArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.TaskDefinitionArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("version", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
unmarshalledObject.Version = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static TaskUnmarshaller _instance = new TaskUnmarshaller();
///
/// Gets the singleton.
///
public static TaskUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}