private static void UnmarshallResult(XmlUnmarshallerContext context, ListStreamingDistributionsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("StreamingDistributionList", targetDepth)) { response.StreamingDistributionList = StreamingDistributionListUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonCloudFrontConfig config = new AmazonCloudFrontConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonCloudFrontClient client = new AmazonCloudFrontClient(creds, config); ListStreamingDistributionsResponse resp = new ListStreamingDistributionsResponse(); do { ListStreamingDistributionsRequest req = new ListStreamingDistributionsRequest { Marker = resp.StreamingDistributionListNextMarker , MaxItems = maxItems }; resp = client.ListStreamingDistributions(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.StreamingDistributionListItems) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.StreamingDistributionListNextMarker)); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListStreamingDistributionsResponse response = new ListStreamingDistributionsResponse(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListStreamingDistributionsResponse response = new ListStreamingDistributionsResponse(); response.ListStreamingDistributionsResult = ListStreamingDistributionsResultUnmarshaller.GetInstance().Unmarshall(context); return(response); }