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

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

            ListCertificateAuthoritiesResponse resp = new ListCertificateAuthoritiesResponse();

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

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

                foreach (var obj in resp.CertificateAuthorities)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 2
0
        protected IAmazonACMPCA CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonACMPCAConfig {
                RegionEndpoint = region
            };

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

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
Esempio n. 3
0
 private void AddACMPCAService(IServiceCollection services,
                               RegionEndpoint regionEndpoint,
                               Credentials credentials)
 {
     services.AddSingleton <IAmazonACMPCA>(
         p =>
     {
         var config = new AmazonACMPCAConfig
         {
             RegionEndpoint = regionEndpoint
         };
         return(credentials == null ?
                new AmazonACMPCAClient(config) :
                new AmazonACMPCAClient(credentials, config));
     });
 }