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);

            ListFirewallRuleGroupAssociationsResponse resp = new ListFirewallRuleGroupAssociationsResponse();

            do
            {
                ListFirewallRuleGroupAssociationsRequest req = new ListFirewallRuleGroupAssociationsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListFirewallRuleGroupAssociations(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.FirewallRuleGroupAssociations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Example #2
0
        protected IAmazonRoute53Resolver CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonRoute53ResolverConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonRoute53ResolverClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }