/* * 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 savingsplans-2019-06-28.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.SavingsPlans.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.SavingsPlans.Model.Internal.MarshallTransformations { /// /// Response Unmarshaller for SavingsPlan Object /// public class SavingsPlanUnmarshaller : IUnmarshaller, IUnmarshaller { /// /// Unmarshaller the response from the service to the response class. /// /// /// SavingsPlan IUnmarshaller.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// /// Unmarshaller the response from the service to the response class. /// /// /// public SavingsPlan Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; SavingsPlan unmarshalledObject = new SavingsPlan(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("commitment", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Commitment = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("currency", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Currency = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ec2InstanceFamily", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Ec2InstanceFamily = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("end", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.End = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("offeringId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.OfferingId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("paymentOption", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.PaymentOption = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("productTypes", targetDepth)) { var unmarshaller = new ListUnmarshaller(StringUnmarshaller.Instance); unmarshalledObject.ProductTypes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("recurringPaymentAmount", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RecurringPaymentAmount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("region", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Region = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("savingsPlanArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.SavingsPlanArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("savingsPlanId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.SavingsPlanId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("savingsPlanType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.SavingsPlanType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("start", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Start = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("state", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.State = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller(StringUnmarshaller.Instance, StringUnmarshaller.Instance); unmarshalledObject.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("termDurationInSeconds", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; unmarshalledObject.TermDurationInSeconds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("upfrontPaymentAmount", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.UpfrontPaymentAmount = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static SavingsPlanUnmarshaller _instance = new SavingsPlanUnmarshaller(); /// /// Gets the singleton. /// public static SavingsPlanUnmarshaller Instance { get { return _instance; } } } }