/* * 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 fms-2018-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.FMS.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.FMS.Model.Internal.MarshallTransformations { /// /// Policy Marshaller /// public class PolicyMarshaller : IRequestMarshaller { /// /// Unmarshaller the response from the service to the response class. /// /// /// /// public void Marshall(Policy requestObject, JsonMarshallerContext context) { if(requestObject.IsSetDeleteUnusedFMManagedResources()) { context.Writer.WritePropertyName("DeleteUnusedFMManagedResources"); context.Writer.Write(requestObject.DeleteUnusedFMManagedResources); } if(requestObject.IsSetExcludeMap()) { context.Writer.WritePropertyName("ExcludeMap"); context.Writer.WriteObjectStart(); foreach (var requestObjectExcludeMapKvp in requestObject.ExcludeMap) { context.Writer.WritePropertyName(requestObjectExcludeMapKvp.Key); var requestObjectExcludeMapValue = requestObjectExcludeMapKvp.Value; context.Writer.WriteArrayStart(); foreach(var requestObjectExcludeMapValueListValue in requestObjectExcludeMapValue) { context.Writer.Write(requestObjectExcludeMapValueListValue); } context.Writer.WriteArrayEnd(); } context.Writer.WriteObjectEnd(); } if(requestObject.IsSetExcludeResourceTags()) { context.Writer.WritePropertyName("ExcludeResourceTags"); context.Writer.Write(requestObject.ExcludeResourceTags); } if(requestObject.IsSetIncludeMap()) { context.Writer.WritePropertyName("IncludeMap"); context.Writer.WriteObjectStart(); foreach (var requestObjectIncludeMapKvp in requestObject.IncludeMap) { context.Writer.WritePropertyName(requestObjectIncludeMapKvp.Key); var requestObjectIncludeMapValue = requestObjectIncludeMapKvp.Value; context.Writer.WriteArrayStart(); foreach(var requestObjectIncludeMapValueListValue in requestObjectIncludeMapValue) { context.Writer.Write(requestObjectIncludeMapValueListValue); } context.Writer.WriteArrayEnd(); } context.Writer.WriteObjectEnd(); } if(requestObject.IsSetPolicyDescription()) { context.Writer.WritePropertyName("PolicyDescription"); context.Writer.Write(requestObject.PolicyDescription); } if(requestObject.IsSetPolicyId()) { context.Writer.WritePropertyName("PolicyId"); context.Writer.Write(requestObject.PolicyId); } if(requestObject.IsSetPolicyName()) { context.Writer.WritePropertyName("PolicyName"); context.Writer.Write(requestObject.PolicyName); } if(requestObject.IsSetPolicyStatus()) { context.Writer.WritePropertyName("PolicyStatus"); context.Writer.Write(requestObject.PolicyStatus); } if(requestObject.IsSetPolicyUpdateToken()) { context.Writer.WritePropertyName("PolicyUpdateToken"); context.Writer.Write(requestObject.PolicyUpdateToken); } if(requestObject.IsSetRemediationEnabled()) { context.Writer.WritePropertyName("RemediationEnabled"); context.Writer.Write(requestObject.RemediationEnabled); } if(requestObject.IsSetResourceSetIds()) { context.Writer.WritePropertyName("ResourceSetIds"); context.Writer.WriteArrayStart(); foreach(var requestObjectResourceSetIdsListValue in requestObject.ResourceSetIds) { context.Writer.Write(requestObjectResourceSetIdsListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetResourceTags()) { context.Writer.WritePropertyName("ResourceTags"); context.Writer.WriteArrayStart(); foreach(var requestObjectResourceTagsListValue in requestObject.ResourceTags) { context.Writer.WriteObjectStart(); var marshaller = ResourceTagMarshaller.Instance; marshaller.Marshall(requestObjectResourceTagsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetResourceType()) { context.Writer.WritePropertyName("ResourceType"); context.Writer.Write(requestObject.ResourceType); } if(requestObject.IsSetResourceTypeList()) { context.Writer.WritePropertyName("ResourceTypeList"); context.Writer.WriteArrayStart(); foreach(var requestObjectResourceTypeListListValue in requestObject.ResourceTypeList) { context.Writer.Write(requestObjectResourceTypeListListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetSecurityServicePolicyData()) { context.Writer.WritePropertyName("SecurityServicePolicyData"); context.Writer.WriteObjectStart(); var marshaller = SecurityServicePolicyDataMarshaller.Instance; marshaller.Marshall(requestObject.SecurityServicePolicyData, context); context.Writer.WriteObjectEnd(); } } /// /// Singleton Marshaller. /// public readonly static PolicyMarshaller Instance = new PolicyMarshaller(); } }