Method FromApiKey
- Namespace
- MailFathom.AI.Providers
- Assembly
- MailFathom.AI.dll
FromApiKey(string, IDisposable?, IReadOnlyList<ProviderEndpointHeader>?, IReadOnlyList<IDisposable>?)
Builds a credential that presents a provider-issued key.
public static ProviderEndpointCredential FromApiKey(string apiKey, IDisposable? resolvedMaterial, IReadOnlyList<ProviderEndpointHeader>? extraHeaders = null, IReadOnlyList<IDisposable>? extraHeaderMaterial = null)
Parameters
apiKeystringThe resolved key.
resolvedMaterialIDisposableThe secret material the key was read from, released when this credential is, or null when the caller holds none.
extraHeadersIReadOnlyList<ProviderEndpointHeader>The resolved headers every request carries, or null where the endpoint declared none.
extraHeaderMaterialIReadOnlyList<IDisposable>The secret material those headers were read from, released when this credential is.
Returns
- ProviderEndpointCredential
The credential.
Exceptions
- ArgumentException
Thrown when the key is blank.