Пример #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRoute53DomainsConfig config = new AmazonRoute53DomainsConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRoute53DomainsClient client = new AmazonRoute53DomainsClient(creds, config);

            ListDomainsResponse resp = new ListDomainsResponse();

            do
            {
                ListDomainsRequest req = new ListDomainsRequest
                {
                    Marker = resp.NextPageMarker
                    ,
                    MaxItems = maxItems
                };

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

                foreach (var obj in resp.Domains)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextPageMarker));
        }
        protected IAmazonRoute53Domains CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonRoute53DomainsConfig {
                RegionEndpoint = region
            };

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

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