public static DescribeServiceResponse Unmarshall(UnmarshallerContext _ctx) { DescribeServiceResponse describeServiceResponse = new DescribeServiceResponse(); describeServiceResponse.HttpResponse = _ctx.HttpResponse; describeServiceResponse.RequestId = _ctx.StringValue("DescribeService.RequestId"); List <DescribeServiceResponse.DescribeService_ProtectionLevel> describeServiceResponse_protectionLevels = new List <DescribeServiceResponse.DescribeService_ProtectionLevel>(); for (int i = 0; i < _ctx.Length("DescribeService.ProtectionLevels.Length"); i++) { DescribeServiceResponse.DescribeService_ProtectionLevel protectionLevel = new DescribeServiceResponse.DescribeService_ProtectionLevel(); protectionLevel.Type = _ctx.StringValue("DescribeService.ProtectionLevels[" + i + "].Type"); describeServiceResponse_protectionLevels.Add(protectionLevel); } describeServiceResponse.ProtectionLevels = describeServiceResponse_protectionLevels; List <DescribeServiceResponse.DescribeService_KeySpec> describeServiceResponse_keySpecs = new List <DescribeServiceResponse.DescribeService_KeySpec>(); for (int i = 0; i < _ctx.Length("DescribeService.KeySpecs.Length"); i++) { DescribeServiceResponse.DescribeService_KeySpec keySpec = new DescribeServiceResponse.DescribeService_KeySpec(); keySpec.Name = _ctx.StringValue("DescribeService.KeySpecs[" + i + "].Name"); List <string> keySpec_supportedProtectionLevels = new List <string>(); for (int j = 0; j < _ctx.Length("DescribeService.KeySpecs[" + i + "].SupportedProtectionLevels.Length"); j++) { keySpec_supportedProtectionLevels.Add(_ctx.StringValue("DescribeService.KeySpecs[" + i + "].SupportedProtectionLevels[" + j + "]")); } keySpec.SupportedProtectionLevels = keySpec_supportedProtectionLevels; List <string> keySpec_usages = new List <string>(); for (int j = 0; j < _ctx.Length("DescribeService.KeySpecs[" + i + "].Usages.Length"); j++) { keySpec_usages.Add(_ctx.StringValue("DescribeService.KeySpecs[" + i + "].Usages[" + j + "]")); } keySpec.Usages = keySpec_usages; describeServiceResponse_keySpecs.Add(keySpec); } describeServiceResponse.KeySpecs = describeServiceResponse_keySpecs; return(describeServiceResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeServiceResponse response = new DescribeServiceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Service", targetDepth)) { var unmarshaller = ServiceUnmarshaller.Instance; response.Service = unmarshaller.Unmarshall(context); continue; } } return(response); }
public static DescribeServiceResponse Unmarshall(UnmarshallerContext context) { DescribeServiceResponse describeServiceResponse = new DescribeServiceResponse(); describeServiceResponse.HttpResponse = context.HttpResponse; describeServiceResponse.RequestId = context.StringValue("DescribeService.RequestId"); List <DescribeServiceResponse.DescribeService_ProtectionLevel> describeServiceResponse_protectionLevels = new List <DescribeServiceResponse.DescribeService_ProtectionLevel>(); for (int i = 0; i < context.Length("DescribeService.ProtectionLevels.Length"); i++) { DescribeServiceResponse.DescribeService_ProtectionLevel protectionLevel = new DescribeServiceResponse.DescribeService_ProtectionLevel(); protectionLevel.Type = context.StringValue("DescribeService.ProtectionLevels[" + i + "].Type"); describeServiceResponse_protectionLevels.Add(protectionLevel); } describeServiceResponse.ProtectionLevels = describeServiceResponse_protectionLevels; return(describeServiceResponse); }