private static void UnmarshallResult(XmlUnmarshallerContext context, ListChangeSetsResponse response) { 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("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Summaries/member", targetDepth)) { var unmarshaller = ChangeSetSummaryUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.Summaries.Add(item); continue; } } } 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) { ListChangeSetsResponse response = new ListChangeSetsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("ListChangeSetsResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListChangeSetsResponse response = new ListChangeSetsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ChangeSetSummaryList", targetDepth)) { var unmarshaller = new ListUnmarshaller <ChangeSetSummaryListItem, ChangeSetSummaryListItemUnmarshaller>(ChangeSetSummaryListItemUnmarshaller.Instance); response.ChangeSetSummaryList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }
public static ListChangeSetsResponse Unmarshall(UnmarshallerContext context) { ListChangeSetsResponse listChangeSetsResponse = new ListChangeSetsResponse(); listChangeSetsResponse.HttpResponse = context.HttpResponse; listChangeSetsResponse.PageNumber = context.IntegerValue("ListChangeSets.PageNumber"); listChangeSetsResponse.PageSize = context.IntegerValue("ListChangeSets.PageSize"); listChangeSetsResponse.RequestId = context.StringValue("ListChangeSets.RequestId"); listChangeSetsResponse.TotalCount = context.IntegerValue("ListChangeSets.TotalCount"); List <ListChangeSetsResponse.ListChangeSets_ChangeSet> listChangeSetsResponse_changeSets = new List <ListChangeSetsResponse.ListChangeSets_ChangeSet>(); for (int i = 0; i < context.Length("ListChangeSets.ChangeSets.Length"); i++) { ListChangeSetsResponse.ListChangeSets_ChangeSet changeSet = new ListChangeSetsResponse.ListChangeSets_ChangeSet(); changeSet.ChangeSetId = context.StringValue("ListChangeSets.ChangeSets[" + i + "].ChangeSetId"); changeSet.ChangeSetName = context.StringValue("ListChangeSets.ChangeSets[" + i + "].ChangeSetName"); changeSet.ChangeSetType = context.StringValue("ListChangeSets.ChangeSets[" + i + "].ChangeSetType"); changeSet.CreateTime = context.StringValue("ListChangeSets.ChangeSets[" + i + "].CreateTime"); changeSet.Description = context.StringValue("ListChangeSets.ChangeSets[" + i + "].Description"); changeSet.ExecutionStatus = context.StringValue("ListChangeSets.ChangeSets[" + i + "].ExecutionStatus"); changeSet.RegionId = context.StringValue("ListChangeSets.ChangeSets[" + i + "].RegionId"); changeSet.StackId = context.StringValue("ListChangeSets.ChangeSets[" + i + "].StackId"); changeSet.StackName = context.StringValue("ListChangeSets.ChangeSets[" + i + "].StackName"); changeSet.Status = context.StringValue("ListChangeSets.ChangeSets[" + i + "].Status"); listChangeSetsResponse_changeSets.Add(changeSet); } listChangeSetsResponse.ChangeSets = listChangeSetsResponse_changeSets; return(listChangeSetsResponse); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonCloudFormationConfig config = new AmazonCloudFormationConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonCloudFormationClient client = new AmazonCloudFormationClient(creds, config); ListChangeSetsResponse resp = new ListChangeSetsResponse(); do { ListChangeSetsRequest req = new ListChangeSetsRequest { NextToken = resp.NextToken }; resp = client.ListChangeSets(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Summaries) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }