Files
idoklad/Client/ClientSecretDokladApiBuilder.cs
2026-06-15 08:42:56 +02:00

22 lines
831 B
C#

using IdokladSdk;
using IdokladSdk.Authentication;
using IdokladSdk.Builders;
namespace Idoklad.Client;
/// <summary>
/// <see cref="DokladApiBuilder"/> variant that uses a caller-supplied <see cref="IAuthentication"/>
/// (here <see cref="ClientSecretAuthentication"/>) instead of the SDK's applicationId-mandatory
/// client credentials. The rest of the builder pipeline (HttpClient, options, urls, Build) is reused.
/// </summary>
public sealed class ClientSecretDokladApiBuilder : DokladApiBuilder
{
private readonly IAuthentication _authentication;
public ClientSecretDokladApiBuilder(string appName, string appVersion, IAuthentication authentication)
: base(appName, appVersion)
=> _authentication = authentication;
protected override IAuthentication GetAuthentication() => _authentication;
}