Introduced a new `ReCClientOptions` property to `BaseCrudApi` and its derived classes to enhance flexibility and control over client behavior. Updated constructors to accept an optional `ReCClientOptions` parameter, with default options applied when omitted. Modified `CreateAsync`, `UpdateAsync`, and other methods in `BaseCrudApi` to utilize the `Options.LogSuccessfulRequests` property for more granular logging control. Updated derived API classes (`CommonApi`, `EndpointAuthApi`, `EndpointParamsApi`, `EndpointsApi`, `ProfileApi`, `RecActionApi`, and `ResultApi`) to pass the `options` parameter to the base constructor. Ensured compatibility with both `NETFRAMEWORK` and other frameworks by using nullable annotations where applicable. These changes improve the extensibility and maintainability of the API client.
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using System.Net.Http;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace ReC.Client.Api
|
|
{
|
|
/// <summary>
|
|
/// Provides access to endpoint definitions.
|
|
/// </summary>
|
|
public class EndpointsApi : BaseCrudApi
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="EndpointsApi"/> class.
|
|
/// </summary>
|
|
/// <param name="http">The HTTP client used for requests.</param>
|
|
/// <param name="logger">An optional logger used to record API call outcomes.</param>
|
|
/// <param name="options">An optional set of client options. Defaults are used when omitted.</param>
|
|
#if NETFRAMEWORK
|
|
public EndpointsApi(HttpClient http, ILogger logger = null, ReCClientOptions options = null) : base(http, "api/Endpoints", logger, options)
|
|
#else
|
|
public EndpointsApi(HttpClient http, ILogger? logger = null, ReCClientOptions? options = null) : base(http, "api/Endpoints", logger, options)
|
|
#endif
|
|
{
|
|
}
|
|
}
|
|
}
|