public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListServerCertificatesResponse response = new ListServerCertificatesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("ListServerCertificatesResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonIdentityManagementServiceConfig config = new AmazonIdentityManagementServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonIdentityManagementServiceClient client = new AmazonIdentityManagementServiceClient(creds, config); ListServerCertificatesResponse resp = new ListServerCertificatesResponse(); do { ListServerCertificatesRequest req = new ListServerCertificatesRequest { Marker = resp.Marker , MaxItems = maxItems }; resp = client.ListServerCertificates(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ServerCertificateMetadataList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.Marker)); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListServerCertificatesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ServerCertificateMetadataList/member", targetDepth)) { response.ServerCertificateMetadataList.Add(ServerCertificateMetadataUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { response.IsTruncated = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListServerCertificatesResponse response = new ListServerCertificatesResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ListServerCertificatesResult", 2)) { response.ListServerCertificatesResult = ListServerCertificatesResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }