Method Create
- Namespace
- MailFathom.Infrastructure.ObjectStorage
- Assembly
- MailFathom.Infrastructure.dll
Create(Uri, string, string, string, bool, TimeSpan, TimeSpan)
Composes the endpoint a deployment's configuration describes.
public static ObjectStorageEndpoint Create(Uri address, string bucket, string keyPrefix, string region, bool usePathStyleAddressing, TimeSpan connectTimeout, TimeSpan requestTimeout)
Parameters
addressUriThe absolute address requests are sent to.
bucketstringThe bucket every object is written into and read from.
keyPrefixstringThe prefix keys are written under, which may be empty and is normalized to end in
/.regionstringThe signing region, which may be empty and then takes DefaultRegion.
usePathStyleAddressingboolWhether the bucket is addressed in the path rather than in the host name.
connectTimeoutTimeSpanHow long establishing a connection may take.
requestTimeoutTimeSpanHow long one whole request may take.
Returns
- ObjectStorageEndpoint
The composed endpoint.
Remarks
Called only after configuration validation has passed, so what is left here is normalization rather than a second set of rules.
Exceptions
- ArgumentNullException
Thrown when
address,bucket,keyPrefix, orregionis null.- ArgumentException
Thrown when
addressis not absolute, orbucketis blank.- ArgumentOutOfRangeException
Thrown when either timeout is not positive.