AWSSDK.Core by Amazon Web Services

<PackageReference Include="AWSSDK.Core" Version="3.7.304.2" />

.NET API 2,013,296 bytes

 ClientConfig

public abstract class ClientConfig : IClientConfig
This class is the base class of all the configurations settings to connect to a service.
public static readonly TimeSpan MaxTimeout

public bool AllowAutoRedirect { get; set; }

This flag controls if .NET HTTP infrastructure should follow redirection responses (e.g. HTTP 307 - temporary redirect).

public string AuthenticationRegion { get; set; }

Gets and sets the AuthenticationRegion property. Used in AWS4 request signing, this is an optional property; change it only if the region cannot be determined from the service endpoint.

public string AuthenticationServiceName { get; set; }

Gets and sets the AuthenticationServiceName property. Used in AWS4 request signing, this is the short-form name of the service being called.

public IAWSTokenProvider AWSTokenProvider { get; set; }

public int BufferSize { get; set; }

Gets and Sets the BufferSize property. The BufferSize controls the buffer used to read in from input streams and write out to the request.

public bool CacheHttpClient { get; set; }

This is a switch used for performance testing and is not intended for production applications to change. This switch may be removed in a future version of the SDK as the .NET Core platform matures.

If true, the HttpClient is cached and reused for every request made by the service client and shared with other service clients.

For the .NET Core platform this is default to true because the HttpClient manages the connection pool.

public string ClientAppId { get; set; }

ClientAppId is an optional application specific identifier that can be set. When set it will be appended to the User-Agent header of every request in the form of app/{ClientAppId}.

If the ClientAppId is not set on the object the SDK will search the environment variable AWS_SDK_UA_APP_ID and the shared config profile attribute sdk_ua_app_id for a potential value for the ClientAppId.

public TimeSpan ClockOffset { get; }

The calculated clock skew correction for a specific endpoint, if there is one. This field will be set if a service call resulted in an exception and the SDK has determined that there is a difference between local and server times. If CorrectForClockSkew is set to true, this value will still be set to the correction, but it will not be used by the SDK and clock skew errors will not be retried.

public DateTime CorrectedUtcNow { get; }

Returns the current UTC now after clock correction for this endpoint.

Specify a DefaultConfigurationMode to use.

Returns the DefaultConfigurationMode that will be used. If none is specified, than the correct one is computed by IDefaultConfigurationProvider.

public bool DisableHostPrefixInjection { get; set; }

Gets and sets the DisableHostPrefixInjection flag. If true, host prefix injection will be disabled for this client, the default value of this flag is false. Host prefix injection prefixes the service endpoint with request members from APIs which use this feature. Example: for a hostPrefix of "foo-name." and a endpoint of "service.region.amazonaws.com" the default behavior is to prefix the endpoint with the hostPrefix resulting in a final endpoint of "foo-name.service.region.amazonaws.com". Setting DisableHostPrefixInjection to true will disable hostPrefix injection resulting in a final endpoint of "service.region.amazonaws.com" regardless of the value of hostPrefix. E.g. You may want to disable host prefix injection for testing against a local mock endpoint.

public bool DisableLogging { get; set; }

Gets and sets the DisableLogging. If true logging for this client will be disabled.

public bool DisableRequestCompression { get; set; }

Controls whether request payloads are automatically compressed for supported operations. This setting only applies to operations that support compression. The default value is "false". Set to "true" to disable compression.

public int EndpointDiscoveryCacheLimit { get; set; }

Returns the maximum number of discovered endpoints that can be stored within the cache for the client. The default limit is 1000 cache entries.

public bool EndpointDiscoveryEnabled { get; set; }

Returns the flag indicating if endpoint discovery should be enabled or disabled for operations that are not required to use endpoint discovery.

public IEndpointProvider EndpointProvider { get; set; }

Gets and sets of the EndpointProvider property. This property is used for endpoints resolution. During service client creation it is set to service's default generated EndpointProvider, but can be changed to use custom user supplied EndpointProvider.

public bool FastFailRequests { get; set; }

Under Adaptive retry mode, this flag determines if the client should wait for a send token to become available or don't block and fail the request immediately if a send token is not available.

public int HttpClientCacheSize { get; set; }

If CacheHttpClient is set to true then HttpClientCacheSize controls the number of HttpClients cached.

The default value is 1 which is suitable for Windows and for all other platforms that have HttpClient implementations using System.Net.Http.SocketsHttpHandler (.NET Core 2.1 and higher).

public HttpClientFactory HttpClientFactory { get; set; }

HttpClientFactory used to create new HttpClients. If null, an HttpClient will be created by the SDK. Note that IClientConfig members such as ProxyHost, ProxyPort, GetWebProxy, and AllowAutoRedirect will have no effect unless they're used explicitly by the HttpClientFactory implementation. See https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/http-stack?context=xamarin/ios and https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?context=xamarin%2Fcross-platform for guidance on creating HttpClients for your platform.

public bool IgnoreConfiguredEndpointUrls { get; set; }

If set to true the SDK will ignore the configured endpointUrls in the config file or in the environment variables. By default it is set to false.

public bool IsMaxErrorRetrySet { get; }

Determines if MaxErrorRetry has been manually set.

public bool LogMetrics { get; set; }

Flag on whether to log metrics for service calls. This can be set in the application's configs, as below: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSLogMetrics" value"true"/> </appSettings> </configuration>

public bool LogResponse { get; set; }

Gets and sets the LogResponse property. If this property is set to true, the service response is logged. The size of response being logged is controlled by the AWSConfigs.LoggingConfig.LogResponsesSizeLimit property.

public int? MaxConnectionsPerServer { get; set; }

Get or set the value to use for MaxConnectionsPerServer on requests. If this property is null, MaxConnectionsPerServer will be left at its default value of MaxValue.

public int MaxErrorRetry { get; set; }

Returns the flag indicating how many retry HTTP requests an SDK should make for a single SDK operation invocation before giving up. This flag will return 4 when the RetryMode is set to "Legacy" which is the default. For RetryMode values of "Standard" or "Adaptive" this flag will return 2. In addition to the values returned that are dependent on the RetryMode, the value can be set to a specific value by using the AWS_MAX_ATTEMPTS environment variable, max_attempts in the shared configuration file, or by setting a value directly on this property. When using AWS_MAX_ATTEMPTS or max_attempts the value returned from this property will be one less than the value entered because this flag is the number of retry requests, not total requests. To learn more about the RetryMode property that affects the values returned by this flag, see RetryMode.

public Profile Profile { get; set; }

Specifies the profile to be used. When this is set on the ClientConfig and that config is passed to the service client constructor the sdk will try to find the credentials associated with the Profile.Name property If set, this will override AWS_PROFILE and AWSConfigs.ProfileName.

public long ProgressUpdateInterval { get; set; }

Gets or sets the interval at which progress update events are raised for upload operations. By default, the progress update events are raised at every 100KB of data transferred.

If the value of this property is set less than ClientConfig.BufferSize, progress updates events will be raised at the interval specified by ClientConfig.BufferSize.

public ICredentials ProxyCredentials { get; set; }

Credentials to use with a proxy.

public string ProxyHost { get; set; }

Gets and sets of the ProxyHost property.

public int ProxyPort { get; set; }

Gets and sets of the ProxyPort property.

public bool ReadEntireResponse { get; set; }

Gets and sets the ReadEntireResponse property. NOTE: This property does not effect response processing and is deprecated. To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig properties can be used.

public TimeSpan? ReadWriteTimeout { get; set; }

Overrides the default read-write timeout value.

public RegionEndpoint RegionEndpoint { get; set; }

Gets and sets the RegionEndpoint property. The region constant that determines the endpoint to use. Setting this property to null will force the SDK to recalculate the RegionEndpoint value based on App/WebConfig, environment variables, profile, etc.

RegionEndpoint and ServiceURL are mutually exclusive properties. Whichever property is set last will cause the other to automatically be reset to null.

public abstract string RegionEndpointServiceName { get; }

The constant used to lookup in the region hash the endpoint.

public long RequestMinCompressionSizeBytes { get; set; }

Minimum size in bytes that a request body should be to trigger compression.

public bool ResignRetries { get; set; }

Flag on whether to resign requests on retry or not. For Amazon S3 and Amazon Glacier this value will always be set to true.

public RequestRetryMode RetryMode { get; set; }

Returns the flag indicating the current mode in use for request retries and influences the value returned from MaxErrorRetry. The default value is RequestRetryMode.Legacy. This flag can be configured by using the AWS_RETRY_MODE environment variable, retry_mode in the shared configuration file, or by setting this value directly.

public string ServiceId { get; set; }

The serviceId for the service, which is specified in the metadata in the ServiceModel. The transformed value of the service ID (replace any spaces in the service ID with underscores and uppercase all letters) is used to set service-specific endpoint urls. I.e: AWS_ENDPOINT_URL_ELASTIC_BEANSTALK For configuration files, replace any spaces with underscores and lowercase all letters I.e. elastic_beanstalk = endpoint_url = http://localhost:8000

public string ServiceURL { get; set; }

Gets and sets of the ServiceURL property. This is an optional property; change it only if you want to try a different service endpoint.

RegionEndpoint and ServiceURL are mutually exclusive properties. Whichever property is set last will cause the other to automatically be reset to null.

public abstract string ServiceVersion { get; }

Gets Service Version

public SigningAlgorithm SignatureMethod { get; set; }

Gets and sets of the signatureMethod property.

public string SignatureVersion { get; set; }

Gets and sets of the SignatureVersion property. Note: This property exists for backward compatibility but is no longer used by any service other than S3.

public bool ThrottleRetries { get; set; }

Enable or disable the Retry Throttling feature by setting the ThrottleRetries flag to True/False respectively. Retry Throttling is a feature that intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful as well. In such situations the allotted retry capacity for the service URL will be drained until requests start to succeed again. Once the requisite capacity is available, retries would be permitted again. When retries are throttled, the service enters a fail-fast behaviour as the traditional retry attempt for the request would be circumvented. Hence, errors will resurface quickly. This will result in a greater number of exceptions but prevents requests being tied up in unsuccessful retry attempts. Note: Retry Throttling is enabled by default. Set the ThrottleRetries flag to false to switch off this feature.

public TimeSpan? Timeout { get; set; }

.NET Framework 3.5 ------------------ Overrides the default request timeout value. This field does not impact Begin*/End* calls. A manual timeout must be implemented. .NET Framework 4.5 ------------------ Overrides the default request timeout value. This field does not impact *Async calls. A manual timeout (for instance, using CancellationToken) must be implemented.

public bool UseAlternateUserAgentHeader { get; set; }

When set to true, the service client will use the x-amz-user-agent header instead of the User-Agent header to report version and environment information to the AWS service. Note: This is especially useful when using a platform like WebAssembly which doesn't allow to specify the User-Agent header.

public bool UseDualstackEndpoint { get; set; }

Configures the endpoint calculation for a service to go to a dual stack (ipv6 enabled) endpoint for the configured region.

public bool UseFIPSEndpoint { get; set; }

Configures the endpoint calculation to go to a FIPS (https://aws.amazon.com/compliance/fips/) endpoint for the configured region.

public bool UseHttp { get; set; }

Gets and sets the UseHttp. If this property is set to true, the client attempts to use HTTP protocol, if the target endpoint supports it. By default, this property is set to false.

public abstract string UserAgent { get; }

Gets and sets of the UserAgent property.

protected ClientConfig(IDefaultConfigurationProvider defaultConfigurationProvider)

public ClientConfig()

public static TimeSpan? GetTimeoutValue(TimeSpan? clientTimeout, TimeSpan? requestTimeout)

Returns the request timeout value if its value is set, else returns client timeout value.

public static void ValidateTimeout(TimeSpan? timeout)

Throw an exception if the boxed TimeSpan parameter doesn't have a value or is out of range.

public virtual string DetermineDnsSuffix()

Given this client configuration, return a DNS suffix for service endpoint url.

public virtual string DetermineServiceURL()

Given this client configuration, return a string form ofthe service endpoint url.

Returns a WebProxy instance configured to match the proxy settings in the client configuration.

protected virtual void Initialize()

public void SetUseNagleIfAvailable(bool useNagle)

Enable or disable the Nagle algorithm on the underlying http client. This method is not intended to be called by consumers of the AWS SDK for .NET

public void SetWebProxy(IWebProxy proxy)

Unpacks the host, port and any credentials info into the instance's proxy-related fields. Unlike the SetWebProxy implementation on .NET 3.5/4.5,the Host and the Port are not reconstructed from the input proxyuri

public virtual void Validate()

Performs validation on this config object. Throws exception if any of the required values are missing/invalid.