public static DescribeExperimentResponse Unmarshall(UnmarshallerContext _ctx) { DescribeExperimentResponse describeExperimentResponse = new DescribeExperimentResponse(); describeExperimentResponse.HttpResponse = _ctx.HttpResponse; describeExperimentResponse.RequestId = _ctx.StringValue("DescribeExperiment.requestId"); DescribeExperimentResponse.DescribeExperiment_Result result = new DescribeExperimentResponse.DescribeExperiment_Result(); result.ExperimentId = _ctx.StringValue("DescribeExperiment.Result.experimentId"); result.Name = _ctx.StringValue("DescribeExperiment.Result.name"); result.Description = _ctx.StringValue("DescribeExperiment.Result.description"); result.Status = _ctx.StringValue("DescribeExperiment.Result.status"); result._Base = _ctx.BooleanValue("DescribeExperiment.Result.base"); result.OnlineTime = _ctx.StringValue("DescribeExperiment.Result.onlineTime"); result.OfflineTime = _ctx.StringValue("DescribeExperiment.Result.offlineTime"); List<string> result_buckets = new List<string>(); for (int i = 0; i < _ctx.Length("DescribeExperiment.Result.Buckets.Length"); i++) { result_buckets.Add(_ctx.StringValue("DescribeExperiment.Result.Buckets["+ i +"]")); } result.Buckets = result_buckets; List<DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm> result_algorithms = new List<DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm>(); for (int i = 0; i < _ctx.Length("DescribeExperiment.Result.Algorithms.Length"); i++) { DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm algorithm = new DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm(); algorithm.Key = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].key"); algorithm.Name = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].name"); algorithm.Category = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].category"); algorithm.Type = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].type"); algorithm.DefaultValue = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].defaultValue"); algorithm.ExperimentValue = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].experimentValue"); algorithm.HasConfig = _ctx.BooleanValue("DescribeExperiment.Result.Algorithms["+ i +"].hasConfig"); List<DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm.DescribeExperiment_ConfigItem> algorithm_config = new List<DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm.DescribeExperiment_ConfigItem>(); for (int j = 0; j < _ctx.Length("DescribeExperiment.Result.Algorithms["+ i +"].Config.Length"); j++) { DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm.DescribeExperiment_ConfigItem configItem = new DescribeExperimentResponse.DescribeExperiment_Result.DescribeExperiment_Algorithm.DescribeExperiment_ConfigItem(); configItem.Key = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].Config["+ j +"].key"); configItem.Name = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].Config["+ j +"].name"); configItem.DefaultValue = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].Config["+ j +"].defaultValue"); configItem.ExperimentValue = _ctx.StringValue("DescribeExperiment.Result.Algorithms["+ i +"].Config["+ j +"].experimentValue"); algorithm_config.Add(configItem); } algorithm.Config = algorithm_config; result_algorithms.Add(algorithm); } result.Algorithms = result_algorithms; describeExperimentResponse.Result = result; return describeExperimentResponse; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeExperimentResponse response = new DescribeExperimentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = UserContextUnmarshaller.Instance; response.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DisplayName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DisplayName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExperimentArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ExperimentArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExperimentName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ExperimentName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastModifiedBy", targetDepth)) { var unmarshaller = UserContextUnmarshaller.Instance; response.LastModifiedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastModifiedTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastModifiedTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Source", targetDepth)) { var unmarshaller = ExperimentSourceUnmarshaller.Instance; response.Source = unmarshaller.Unmarshall(context); continue; } } return(response); }