public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonRoute53ResolverConfig config = new AmazonRoute53ResolverConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonRoute53ResolverClient client = new AmazonRoute53ResolverClient(creds, config); ListFirewallConfigsResponse resp = new ListFirewallConfigsResponse(); do { ListFirewallConfigsRequest req = new ListFirewallConfigsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListFirewallConfigs(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.FirewallConfigs) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListFirewallConfigsResponse response = new ListFirewallConfigsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("FirewallConfigs", targetDepth)) { var unmarshaller = new ListUnmarshaller <FirewallConfig, FirewallConfigUnmarshaller>(FirewallConfigUnmarshaller.Instance); response.FirewallConfigs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }