From fda06632c1b5818be778571418a1df03f3f0488d Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 15 Nov 2023 18:39:19 +0300 Subject: [PATCH] SP-11985: Add support async with headers --- src/Regula.FaceSDK.WebClient/Api/SearchApi.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Regula.FaceSDK.WebClient/Api/SearchApi.cs b/src/Regula.FaceSDK.WebClient/Api/SearchApi.cs index 9a37fe2..1e99cd0 100644 --- a/src/Regula.FaceSDK.WebClient/Api/SearchApi.cs +++ b/src/Regula.FaceSDK.WebClient/Api/SearchApi.cs @@ -74,7 +74,7 @@ public interface ISearchApi : IApiAccessor /// Request header label. (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse (SearchResult) - System.Threading.Tasks.Task> SearchWithHttpInfoAsync (SearchRequest searchRequest, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> SearchWithHttpInfoAsync (SearchRequest searchRequest, Dictionary headers, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)); #endregion Asynchronous Operations } @@ -278,13 +278,18 @@ public void AddDefaultHeader(string key, string value) /// Request header label. (optional) /// Cancellation Token to cancel request (optional) /// Task of SearchResult - public async System.Threading.Tasks.Task SearchAsync (SearchRequest searchRequest, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SearchAsync(SearchRequest searchRequest, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - ApiResponse localVarResponse = await SearchWithHttpInfoAsync(searchRequest, xRequestID, cancellationToken); - return localVarResponse.Data; + ApiResponse localVarResponse = await SearchWithHttpInfoAsync(searchRequest, new Dictionary(), xRequestID, cancellationToken); + return localVarResponse.Data; } + public async System.Threading.Tasks.Task SearchAsync (SearchRequest searchRequest, Dictionary headers, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + ApiResponse localVarResponse = await SearchWithHttpInfoAsync(searchRequest, headers, xRequestID, cancellationToken); + return localVarResponse.Data; + } /// /// Find person by image in groups /// @@ -293,7 +298,7 @@ public void AddDefaultHeader(string key, string value) /// Request header label. (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse (SearchResult) - public async System.Threading.Tasks.Task> SearchWithHttpInfoAsync (SearchRequest searchRequest, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> SearchWithHttpInfoAsync (SearchRequest searchRequest, Dictionary headers, string xRequestID = default(string), CancellationToken cancellationToken = default(CancellationToken)) { // verify the required parameter 'searchRequest' is set if (searchRequest == null) @@ -302,7 +307,7 @@ public void AddDefaultHeader(string key, string value) var localVarPath = "/api/search"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarHeaderParams = this.Configuration.DefaultHeader.Union(headers).ToDictionary(k => k.Key, v => v.Value); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null;