Exemple #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            UpdateSecurityProfileResponse response = new UpdateSecurityProfileResponse();


            return(response);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            UpdateSecurityProfileResponse response = new UpdateSecurityProfileResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("additionalMetricsToRetain", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <string, StringUnmarshaller>(StringUnmarshaller.Instance);
                    response.AdditionalMetricsToRetain = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("additionalMetricsToRetainV2", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <MetricToRetain, MetricToRetainUnmarshaller>(MetricToRetainUnmarshaller.Instance);
                    response.AdditionalMetricsToRetainV2 = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("alertTargets", targetDepth))
                {
                    var unmarshaller = new DictionaryUnmarshaller <string, AlertTarget, StringUnmarshaller, AlertTargetUnmarshaller>(StringUnmarshaller.Instance, AlertTargetUnmarshaller.Instance);
                    response.AlertTargets = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("behaviors", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Behavior, BehaviorUnmarshaller>(BehaviorUnmarshaller.Instance);
                    response.Behaviors = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("creationDate", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreationDate = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("lastModifiedDate", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastModifiedDate = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("securityProfileArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SecurityProfileArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("securityProfileDescription", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SecurityProfileDescription = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("securityProfileName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SecurityProfileName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("version", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    response.Version = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }