示例#1
0
        public AwsClient(AwsService service, AwsRegion region, IAwsCredential credential)
        {
            this.service    = service    ?? throw new ArgumentNullException(nameof(service));
            Region          = region     ?? throw new ArgumentNullException(nameof(region));
            this.credential = credential ?? throw new ArgumentNullException(nameof(credential));

            Endpoint = $"https://{service.Name}.{region.Name}.amazonaws.com/";
        }
示例#2
0
        public AwsClient(AwsService service, AwsRegion region, IAwsCredentials credentials)
        {
            #region Preconditions

            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }

            #endregion

            this.service     = service;
            this.region      = region;
            this.credentials = credentials;

            Endpoint = $"https://{service.Name}.{region.Name}.amazonaws.com/";
        }
示例#3
0
        public AwsClient(AwsService service, AwsRegion region, IAwsCredential credential)
        {
            this.service    = service ?? throw new ArgumentNullException(nameof(service));
            Region          = region ?? throw new ArgumentNullException(nameof(region));
            this.credential = credential ?? throw new ArgumentNullException(nameof(credential));

            Endpoint = $"https://{service.Name}.{region.Name}.amazonaws.com/";

            this.httpClient = new HttpClient(new HttpClientHandler {
                AutomaticDecompression = DecompressionMethods.GZip
            })
            {
                DefaultRequestHeaders =
                {
                    { "User-Agent", "Carbon/2.5" }
                }
            };
        }
示例#4
0
        public CredentialScope(DateTime date, AwsRegion region, AwsService service)
        {
            #region Preconditions

            if (region == null)
            {
                throw new ArgumentNullException(nameof(region));
            }

            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            #endregion

            Date    = date;
            Region  = region;
            Service = service;
        }