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); ListCloudFrontOriginAccessIdentitiesResponse resp = new ListCloudFrontOriginAccessIdentitiesResponse(); do { ListCloudFrontOriginAccessIdentitiesRequest req = new ListCloudFrontOriginAccessIdentitiesRequest { Marker = resp.CloudFrontOriginAccessIdentityList.NextMarker , MaxItems = maxItems.ToString() }; resp = client.ListCloudFrontOriginAccessIdentities(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.CloudFrontOriginAccessIdentityList.Items) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.CloudFrontOriginAccessIdentityList.NextMarker)); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListCloudFrontOriginAccessIdentitiesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("CloudFrontOriginAccessIdentityList", targetDepth)) { response.CloudFrontOriginAccessIdentityList = CloudFrontOriginAccessIdentityListUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListCloudFrontOriginAccessIdentitiesResponse response = new ListCloudFrontOriginAccessIdentitiesResponse(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListCloudFrontOriginAccessIdentitiesResponse response = new ListCloudFrontOriginAccessIdentitiesResponse(); response.ListCloudFrontOriginAccessIdentitiesResult = ListCloudFrontOriginAccessIdentitiesResultUnmarshaller.GetInstance().Unmarshall(context); return(response); }