/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { CreateNatGatewayResponse response = new CreateNatGatewayResponse(); 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("clientToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ClientToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("natGateway", targetDepth)) { var unmarshaller = NatGatewayUnmarshaller.Instance; response.NatGateway = unmarshaller.Unmarshall(context); continue; } } } return(response); }
public static CreateNatGatewayResponse Unmarshall(UnmarshallerContext _ctx) { CreateNatGatewayResponse createNatGatewayResponse = new CreateNatGatewayResponse(); createNatGatewayResponse.HttpResponse = _ctx.HttpResponse; createNatGatewayResponse.RequestId = _ctx.StringValue("CreateNatGateway.RequestId"); createNatGatewayResponse.NatGatewayId = _ctx.StringValue("CreateNatGateway.NatGatewayId"); List <string> createNatGatewayResponse_forwardTableIds = new List <string>(); for (int i = 0; i < _ctx.Length("CreateNatGateway.ForwardTableIds.Length"); i++) { createNatGatewayResponse_forwardTableIds.Add(_ctx.StringValue("CreateNatGateway.ForwardTableIds[" + i + "]")); } createNatGatewayResponse.ForwardTableIds = createNatGatewayResponse_forwardTableIds; List <string> createNatGatewayResponse_snatTableIds = new List <string>(); for (int i = 0; i < _ctx.Length("CreateNatGateway.SnatTableIds.Length"); i++) { createNatGatewayResponse_snatTableIds.Add(_ctx.StringValue("CreateNatGateway.SnatTableIds[" + i + "]")); } createNatGatewayResponse.SnatTableIds = createNatGatewayResponse_snatTableIds; List <string> createNatGatewayResponse_bandwidthPackageIds = new List <string>(); for (int i = 0; i < _ctx.Length("CreateNatGateway.BandwidthPackageIds.Length"); i++) { createNatGatewayResponse_bandwidthPackageIds.Add(_ctx.StringValue("CreateNatGateway.BandwidthPackageIds[" + i + "]")); } createNatGatewayResponse.BandwidthPackageIds = createNatGatewayResponse_bandwidthPackageIds; return(createNatGatewayResponse); }