Exemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonCodeArtifactConfig config = new AmazonCodeArtifactConfig();

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

            ListDomainsResponse resp = new ListDomainsResponse();

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

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

                foreach (var obj in resp.Domains)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
 protected IAmazonCodeArtifact CreateClient(AWSCredentials credentials, RegionEndpoint region)
 {
     var config = new AmazonCodeArtifactConfig { RegionEndpoint = region };
     Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
     this.CustomizeClientConfig(config);
     var client = new AmazonCodeArtifactClient(credentials, config);
     client.BeforeRequestEvent += RequestEventHandler;
     client.AfterResponseEvent += ResponseEventHandler;
     return client;
 }