private static void UnmarshallResult(XmlUnmarshallerContext context, ListStacksResponse 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("StackSummaries/member", targetDepth)) { var unmarshaller = StackSummaryUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.StackSummaries.Add(item); continue; } } } return; }
public static ListStacksResponse Unmarshall(UnmarshallerContext context) { ListStacksResponse listStacksResponse = new ListStacksResponse(); listStacksResponse.HttpResponse = context.HttpResponse; listStacksResponse.PageNumber = context.IntegerValue("ListStacks.PageNumber"); listStacksResponse.PageSize = context.IntegerValue("ListStacks.PageSize"); listStacksResponse.RequestId = context.StringValue("ListStacks.RequestId"); listStacksResponse.TotalCount = context.IntegerValue("ListStacks.TotalCount"); List <ListStacksResponse.ListStacks_Stack> listStacksResponse_stacks = new List <ListStacksResponse.ListStacks_Stack>(); for (int i = 0; i < context.Length("ListStacks.Stacks.Length"); i++) { ListStacksResponse.ListStacks_Stack stack = new ListStacksResponse.ListStacks_Stack(); stack.CreateTime = context.StringValue("ListStacks.Stacks[" + i + "].CreateTime"); stack.DisableRollback = context.BooleanValue("ListStacks.Stacks[" + i + "].DisableRollback"); stack.RegionId = context.StringValue("ListStacks.Stacks[" + i + "].RegionId"); stack.StackId = context.StringValue("ListStacks.Stacks[" + i + "].StackId"); stack.StackName = context.StringValue("ListStacks.Stacks[" + i + "].StackName"); stack.Status = context.StringValue("ListStacks.Stacks[" + i + "].Status"); stack.StatusReason = context.StringValue("ListStacks.Stacks[" + i + "].StatusReason"); stack.TimeoutInMinutes = context.IntegerValue("ListStacks.Stacks[" + i + "].TimeoutInMinutes"); stack.ParentStackId = context.StringValue("ListStacks.Stacks[" + i + "].ParentStackId"); stack.UpdateTime = context.StringValue("ListStacks.Stacks[" + i + "].UpdateTime"); stack.StackDriftStatus = context.StringValue("ListStacks.Stacks[" + i + "].StackDriftStatus"); stack.DriftDetectionTime = context.StringValue("ListStacks.Stacks[" + i + "].DriftDetectionTime"); listStacksResponse_stacks.Add(stack); } listStacksResponse.Stacks = listStacksResponse_stacks; return(listStacksResponse); }
/// <summary> /// <para> Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary information for stacks that /// have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks /// is returned (including existing stacks and stacks that have been deleted). </para> /// </summary> /// /// <param name="listStacksRequest">Container for the necessary parameters to execute the ListStacks service method on /// AmazonCloudFormation.</param> /// /// <returns>The response from the ListStacks service method, as returned by AmazonCloudFormation.</returns> /// public ListStacksResponse ListStacks(ListStacksRequest listStacksRequest) { IRequest <ListStacksRequest> request = new ListStacksRequestMarshaller().Marshall(listStacksRequest); ListStacksResponse response = Invoke <ListStacksRequest, ListStacksResponse> (request, this.signer, ListStacksResponseUnmarshaller.GetInstance()); return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListStacksResponse response = new ListStacksResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("ListStacksResult", 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) { AmazonCloudFormationConfig config = new AmazonCloudFormationConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonCloudFormationClient client = new AmazonCloudFormationClient(creds, config); ListStacksResponse resp = new ListStacksResponse(); do { ListStacksRequest req = new ListStacksRequest { NextToken = resp.NextToken }; resp = client.ListStacks(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.StackSummaries) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
ListStacksResponse GetStackSummaries(string nextToken = null) { ListStacksResponse result = null; using (AmazonCloudFormationClient CFclient = new AmazonCloudFormationClient()) { ListStacksRequest rq = new ListStacksRequest(); rq.NextToken = nextToken; result = CFclient.ListStacks(rq); } return(result); }
public static ListStacksResponse Unmarshall(UnmarshallerContext _ctx) { ListStacksResponse listStacksResponse = new ListStacksResponse(); listStacksResponse.HttpResponse = _ctx.HttpResponse; listStacksResponse.PageNumber = _ctx.IntegerValue("ListStacks.PageNumber"); listStacksResponse.PageSize = _ctx.IntegerValue("ListStacks.PageSize"); listStacksResponse.RequestId = _ctx.StringValue("ListStacks.RequestId"); listStacksResponse.TotalCount = _ctx.IntegerValue("ListStacks.TotalCount"); List <ListStacksResponse.ListStacks_Stack> listStacksResponse_stacks = new List <ListStacksResponse.ListStacks_Stack>(); for (int i = 0; i < _ctx.Length("ListStacks.Stacks.Length"); i++) { ListStacksResponse.ListStacks_Stack stack = new ListStacksResponse.ListStacks_Stack(); stack.CreateTime = _ctx.StringValue("ListStacks.Stacks[" + i + "].CreateTime"); stack.DisableRollback = _ctx.BooleanValue("ListStacks.Stacks[" + i + "].DisableRollback"); stack.RegionId = _ctx.StringValue("ListStacks.Stacks[" + i + "].RegionId"); stack.StackId = _ctx.StringValue("ListStacks.Stacks[" + i + "].StackId"); stack.StackName = _ctx.StringValue("ListStacks.Stacks[" + i + "].StackName"); stack.Status = _ctx.StringValue("ListStacks.Stacks[" + i + "].Status"); stack.StatusReason = _ctx.StringValue("ListStacks.Stacks[" + i + "].StatusReason"); stack.TimeoutInMinutes = _ctx.IntegerValue("ListStacks.Stacks[" + i + "].TimeoutInMinutes"); stack.ParentStackId = _ctx.StringValue("ListStacks.Stacks[" + i + "].ParentStackId"); stack.UpdateTime = _ctx.StringValue("ListStacks.Stacks[" + i + "].UpdateTime"); stack.StackDriftStatus = _ctx.StringValue("ListStacks.Stacks[" + i + "].StackDriftStatus"); stack.DriftDetectionTime = _ctx.StringValue("ListStacks.Stacks[" + i + "].DriftDetectionTime"); stack.StackType = _ctx.StringValue("ListStacks.Stacks[" + i + "].StackType"); List <ListStacksResponse.ListStacks_Stack.ListStacks_Tag> stack_tags = new List <ListStacksResponse.ListStacks_Stack.ListStacks_Tag>(); for (int j = 0; j < _ctx.Length("ListStacks.Stacks[" + i + "].Tags.Length"); j++) { ListStacksResponse.ListStacks_Stack.ListStacks_Tag tag = new ListStacksResponse.ListStacks_Stack.ListStacks_Tag(); tag.Key = _ctx.StringValue("ListStacks.Stacks[" + i + "].Tags[" + j + "].Key"); tag._Value = _ctx.StringValue("ListStacks.Stacks[" + i + "].Tags[" + j + "].Value"); stack_tags.Add(tag); } stack.Tags = stack_tags; listStacksResponse_stacks.Add(stack); } listStacksResponse.Stacks = listStacksResponse_stacks; return(listStacksResponse); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListStacksResponse response = new ListStacksResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ListStacksResult", 2)) { response.ListStacksResult = ListStacksResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListStacksResponse 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("StackSummaries/member", targetDepth)) { response.StackSummaries.Add(StackSummaryUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("NextToken", targetDepth)) { response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }