/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DescribeFleetHistoryResponse response = new DescribeFleetHistoryResponse(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth = 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("fleetId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FleetId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("historyRecordSet/item", targetDepth)) { var unmarshaller = HistoryRecordEntryUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.HistoryRecords.Add(item); continue; } if (context.TestExpression("lastEvaluatedTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastEvaluatedTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("startTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.StartTime = unmarshaller.Unmarshall(context); continue; } } } return(response); }
public static DescribeFleetHistoryResponse Unmarshall(UnmarshallerContext context) { DescribeFleetHistoryResponse describeFleetHistoryResponse = new DescribeFleetHistoryResponse(); describeFleetHistoryResponse.HttpResponse = context.HttpResponse; describeFleetHistoryResponse.RequestId = context.StringValue("DescribeFleetHistory.RequestId"); describeFleetHistoryResponse.TotalCount = context.IntegerValue("DescribeFleetHistory.TotalCount"); describeFleetHistoryResponse.PageNumber = context.IntegerValue("DescribeFleetHistory.PageNumber"); describeFleetHistoryResponse.PageSize = context.IntegerValue("DescribeFleetHistory.PageSize"); List <DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory> describeFleetHistoryResponse_fleetHistorys = new List <DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory>(); for (int i = 0; i < context.Length("DescribeFleetHistory.FleetHistorys.Length"); i++) { DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory fleetHistory = new DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory(); fleetHistory.TaskId = context.StringValue("DescribeFleetHistory.FleetHistorys[" + i + "].TaskId"); fleetHistory.Status = context.StringValue("DescribeFleetHistory.FleetHistorys[" + i + "].Status"); fleetHistory.LastEventTime = context.StringValue("DescribeFleetHistory.FleetHistorys[" + i + "].LastEventTime"); fleetHistory.StartTime = context.StringValue("DescribeFleetHistory.FleetHistorys[" + i + "].StartTime"); List <DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory.DescribeFleetHistory_ActivityDetail> fleetHistory_activityDetails = new List <DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory.DescribeFleetHistory_ActivityDetail>(); for (int j = 0; j < context.Length("DescribeFleetHistory.FleetHistorys[" + i + "].ActivityDetails.Length"); j++) { DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory.DescribeFleetHistory_ActivityDetail activityDetail = new DescribeFleetHistoryResponse.DescribeFleetHistory_FleetHistory.DescribeFleetHistory_ActivityDetail(); activityDetail.Detail = context.StringValue("DescribeFleetHistory.FleetHistorys[" + i + "].ActivityDetails[" + j + "].Detail"); activityDetail.Status = context.FloatValue("DescribeFleetHistory.FleetHistorys[" + i + "].ActivityDetails[" + j + "].Status"); fleetHistory_activityDetails.Add(activityDetail); } fleetHistory.ActivityDetails = fleetHistory_activityDetails; describeFleetHistoryResponse_fleetHistorys.Add(fleetHistory); } describeFleetHistoryResponse.FleetHistorys = describeFleetHistoryResponse_fleetHistorys; return(describeFleetHistoryResponse); }