Add ReCClientOptions for configurable client behavior
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.
This commit is contained in:
@@ -15,10 +15,11 @@ namespace ReC.Client.Api
|
||||
/// </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) : base(http, "api/Endpoints", logger)
|
||||
public EndpointsApi(HttpClient http, ILogger logger = null, ReCClientOptions options = null) : base(http, "api/Endpoints", logger, options)
|
||||
#else
|
||||
public EndpointsApi(HttpClient http, ILogger? logger = null) : base(http, "api/Endpoints", logger)
|
||||
public EndpointsApi(HttpClient http, ILogger? logger = null, ReCClientOptions? options = null) : base(http, "api/Endpoints", logger, options)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user