< Summary

Information
Class: Elsa.Api.Client.Options.ElsaClientBuilderOptions
Assembly: Elsa.Api.Client
File(s): /home/runner/work/elsa-core/elsa-core/src/clients/Elsa.Api.Client/Options/ElsaClientBuilderOptions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 48
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_BaseAddress()100%210%
get_ApiKey()100%210%
get_AuthenticationHandler()100%210%
get_ConfigureHttpClient()100%210%
get_ConfigureHttpClientBuilder()100%210%
get_ConfigureRetryPolicy()100%210%
get_ConfigureJsonSerializerOptions()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/clients/Elsa.Api.Client/Options/ElsaClientBuilderOptions.cs

#LineLine coverage
 1using System.Text.Json;
 2using Elsa.Api.Client.HttpMessageHandlers;
 3using Microsoft.Extensions.DependencyInjection;
 4using Polly;
 5
 6namespace Elsa.Api.Client.Options;
 7
 8/// <summary>
 9/// Represents options for building an Elsa API client.
 10/// </summary>
 11public class ElsaClientBuilderOptions
 12{
 13    /// <summary>
 14    /// Gets or sets the base address of the Elsa server.
 15    /// </summary>
 016    public Uri BaseAddress { get; set; } = default!;
 17
 18    /// <summary>
 19    /// Gets or sets the API key function to use when authenticating with the Elsa server.
 20    /// </summary>
 021    public string? ApiKey { get; set; }
 22
 23    /// <summary>
 24    /// A <see cref="DelegatingHandler"/> type that can be used to authenticate with the Elsa server.
 25    /// Defaults to <see cref="ApiKeyHttpMessageHandler"/>.
 26    /// </summary>
 027    public Type AuthenticationHandler { get; set; } = typeof(ApiKeyHttpMessageHandler);
 28
 29    /// <summary>
 30    /// Gets or sets a delegate that can be used to configure the HTTP client.
 31    /// </summary>
 032    public Action<IServiceProvider, HttpClient>? ConfigureHttpClient { get; set; }
 33
 34    /// <summary>
 35    /// Gets or sets a delegate that can be used to configure the HTTP client builder.
 36    /// </summary>
 037    public Action<IHttpClientBuilder> ConfigureHttpClientBuilder { get; set; } = _ => { };
 38
 39    /// <summary>
 40    /// Gets or sets a delegate that can be used to configure the retry policy.
 41    /// </summary>
 042    public Action<IHttpClientBuilder>? ConfigureRetryPolicy { get; set; } = builder => builder.AddTransientHttpErrorPoli
 43
 44    /// <summary>
 45    /// Gets or sets a delegate that can be used to configure the JSON serializer options.
 46    /// </summary>
 047    public Action<IServiceProvider, JsonSerializerOptions>? ConfigureJsonSerializerOptions { get; set; }
 48}