public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListVaultsResponse response = new ListVaultsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("VaultList", targetDepth)) { var unmarshaller = new ListUnmarshaller <DescribeVaultOutput, DescribeVaultOutputUnmarshaller>( DescribeVaultOutputUnmarshaller.GetInstance()); response.VaultList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(response); }
private static void UnmarshallResult(JsonUnmarshallerContext context, ListVaultsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("VaultList", targetDepth)) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { response.VaultList = null; continue; } response.VaultList = new List <DescribeVaultOutput>(); DescribeVaultOutputUnmarshaller unmarshaller = DescribeVaultOutputUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.VaultList.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("Marker", targetDepth)) { context.Read(); response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }
public ListVaultsResult Unmarshall(JsonUnmarshallerContext context) { ListVaultsResult listVaultsResult = new ListVaultsResult(); listVaultsResult.VaultList = null; int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("VaultList", targetDepth)) { listVaultsResult.VaultList = new List <DescribeVaultOutput>(); DescribeVaultOutputUnmarshaller unmarshaller = DescribeVaultOutputUnmarshaller.GetInstance(); while (context.Read()) { if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth)) { listVaultsResult.VaultList.Add(unmarshaller.Unmarshall(context)); } else if (context.IsEndArray) { break; } } continue; } if (context.TestExpression("Marker", targetDepth)) { listVaultsResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(listVaultsResult); } } return(listVaultsResult); }