From ce6efbf413b7a6bfc5224644ba8694de6e7490de Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Tue, 11 Jun 2024 13:14:10 +0000 Subject: [PATCH] chore: generated code for commit 072c38b9. [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/algolia/api-clients-automation/commit/072c38b9afa21e3118c5aa5a7f804d8fc7c653c9 Co-authored-by: algolia-bot Co-authored-by: Clément Vannicatte --- algoliasearch/.openapi-generator/FILES | 180 ++---------------- algoliasearch/Models/Recommend/RankingInfo.cs | 14 +- algoliasearch/Utils/SearchClientExtensions.cs | 27 +++ 3 files changed, 42 insertions(+), 179 deletions(-) diff --git a/algoliasearch/.openapi-generator/FILES b/algoliasearch/.openapi-generator/FILES index e9445bfaa..212de941a 100644 --- a/algoliasearch/.openapi-generator/FILES +++ b/algoliasearch/.openapi-generator/FILES @@ -1,172 +1,14 @@ ../Algolia.Search.sln ../global.json -.openapi-generator-ignore Algolia.Search.csproj -Clients/SearchClient.cs -Clients/SearchConfiguration.cs -Models/Search/Acl.cs -Models/Search/Action.cs -Models/Search/AddApiKeyResponse.cs -Models/Search/AdvancedSyntaxFeatures.cs -Models/Search/AlternativesAsExact.cs -Models/Search/Anchoring.cs -Models/Search/ApiKey.cs -Models/Search/ApiKeyOperation.cs -Models/Search/AroundPrecision.cs -Models/Search/AroundPrecisionFromValueInner.cs -Models/Search/AroundRadius.cs -Models/Search/AroundRadiusAll.cs -Models/Search/AssignUserIdParams.cs -Models/Search/AttributeToUpdate.cs -Models/Search/AutomaticFacetFilter.cs -Models/Search/AutomaticFacetFilters.cs -Models/Search/BaseGetApiKeyResponse.cs -Models/Search/BaseIndexSettings.cs -Models/Search/BaseSearchParams.cs -Models/Search/BaseSearchParamsWithoutQuery.cs -Models/Search/BaseSearchResponse.cs -Models/Search/BatchAssignUserIdsParams.cs -Models/Search/BatchDictionaryEntriesParams.cs -Models/Search/BatchDictionaryEntriesRequest.cs -Models/Search/BatchParams.cs -Models/Search/BatchRequest.cs -Models/Search/BatchResponse.cs -Models/Search/BatchWriteParams.cs -Models/Search/BrowseParams.cs -Models/Search/BrowseParamsObject.cs -Models/Search/BrowseResponse.cs -Models/Search/BuiltInOperation.cs -Models/Search/BuiltInOperationType.cs -Models/Search/Condition.cs -Models/Search/Consequence.cs -Models/Search/ConsequenceHide.cs -Models/Search/ConsequenceParams.cs -Models/Search/ConsequenceQuery.cs -Models/Search/ConsequenceQueryObject.cs -Models/Search/CreatedAtResponse.cs -Models/Search/Cursor.cs -Models/Search/DeleteApiKeyResponse.cs -Models/Search/DeleteByParams.cs -Models/Search/DeleteSourceResponse.cs -Models/Search/DeletedAtResponse.cs -Models/Search/DictionaryAction.cs -Models/Search/DictionaryEntry.cs -Models/Search/DictionaryEntryState.cs -Models/Search/DictionaryLanguage.cs -Models/Search/DictionarySettingsParams.cs -Models/Search/DictionaryType.cs -Models/Search/Distinct.cs -Models/Search/Edit.cs -Models/Search/EditType.cs -Models/Search/ErrorBase.cs -Models/Search/ExactOnSingleWordQuery.cs -Models/Search/Exhaustive.cs -Models/Search/FacetFilters.cs -Models/Search/FacetHits.cs -Models/Search/FacetOrdering.cs -Models/Search/Facets.cs -Models/Search/FacetsStats.cs -Models/Search/FetchedIndex.cs -Models/Search/GetApiKeyResponse.cs -Models/Search/GetDictionarySettingsResponse.cs -Models/Search/GetLogsResponse.cs -Models/Search/GetObjectsParams.cs -Models/Search/GetObjectsRequest.cs -Models/Search/GetObjectsResponse.cs -Models/Search/GetTaskResponse.cs -Models/Search/GetTopUserIdsResponse.cs -Models/Search/HasPendingMappingsResponse.cs -Models/Search/HighlightResult.cs -Models/Search/HighlightResultOption.cs -Models/Search/Hit.cs -Models/Search/IgnorePlurals.cs -Models/Search/IndexSettings.cs -Models/Search/IndexSettingsAsSearchParams.cs -Models/Search/Languages.cs -Models/Search/ListApiKeysResponse.cs -Models/Search/ListClustersResponse.cs -Models/Search/ListIndicesResponse.cs -Models/Search/ListUserIdsResponse.cs -Models/Search/Log.cs -Models/Search/LogQuery.cs -Models/Search/LogType.cs -Models/Search/MatchLevel.cs -Models/Search/MatchedGeoLocation.cs -Models/Search/Mode.cs -Models/Search/MultipleBatchRequest.cs -Models/Search/MultipleBatchResponse.cs -Models/Search/NumericFilters.cs -Models/Search/OperationIndexParams.cs -Models/Search/OperationType.cs -Models/Search/OptionalFilters.cs -Models/Search/Params.cs -Models/Search/Personalization.cs -Models/Search/Promote.cs -Models/Search/PromoteObjectID.cs -Models/Search/PromoteObjectIDs.cs -Models/Search/QueryType.cs -Models/Search/RankingInfo.cs -Models/Search/ReRankingApplyFilter.cs -Models/Search/Redirect.cs -Models/Search/RedirectRuleIndexMetadata.cs -Models/Search/RedirectRuleIndexMetadataData.cs -Models/Search/RemoveStopWords.cs -Models/Search/RemoveUserIdResponse.cs -Models/Search/RemoveWordsIfNoResults.cs -Models/Search/RenderingContent.cs -Models/Search/ReplaceAllObjectsResponse.cs -Models/Search/ReplaceSourceResponse.cs -Models/Search/Rule.cs -Models/Search/SaveObjectResponse.cs -Models/Search/SaveSynonymResponse.cs -Models/Search/ScopeType.cs -Models/Search/SearchDictionaryEntriesParams.cs -Models/Search/SearchDictionaryEntriesResponse.cs -Models/Search/SearchForFacetValuesRequest.cs -Models/Search/SearchForFacetValuesResponse.cs -Models/Search/SearchForFacets.cs -Models/Search/SearchForFacetsOptions.cs -Models/Search/SearchForHits.cs -Models/Search/SearchForHitsOptions.cs -Models/Search/SearchHits.cs -Models/Search/SearchMethodParams.cs -Models/Search/SearchParams.cs -Models/Search/SearchParamsObject.cs -Models/Search/SearchParamsQuery.cs -Models/Search/SearchParamsString.cs -Models/Search/SearchQuery.cs -Models/Search/SearchResponse.cs -Models/Search/SearchResponses.cs -Models/Search/SearchResult.cs -Models/Search/SearchRulesParams.cs -Models/Search/SearchRulesResponse.cs -Models/Search/SearchStrategy.cs -Models/Search/SearchSynonymsParams.cs -Models/Search/SearchSynonymsResponse.cs -Models/Search/SearchTypeDefault.cs -Models/Search/SearchTypeFacet.cs -Models/Search/SearchUserIdsParams.cs -Models/Search/SearchUserIdsResponse.cs -Models/Search/SecuredAPIKeyRestrictions.cs -Models/Search/SemanticSearch.cs -Models/Search/SnippetResult.cs -Models/Search/SnippetResultOption.cs -Models/Search/SortRemainingBy.cs -Models/Search/Source.cs -Models/Search/StandardEntries.cs -Models/Search/SupportedLanguage.cs -Models/Search/SynonymHit.cs -Models/Search/SynonymType.cs -Models/Search/TagFilters.cs -Models/Search/TaskStatus.cs -Models/Search/TimeRange.cs -Models/Search/TypoTolerance.cs -Models/Search/TypoToleranceEnum.cs -Models/Search/UpdateApiKeyResponse.cs -Models/Search/UpdatedAtResponse.cs -Models/Search/UpdatedAtWithObjectIdResponse.cs -Models/Search/UpdatedRuleResponse.cs -Models/Search/UserHighlightResult.cs -Models/Search/UserHit.cs -Models/Search/UserId.cs -Models/Search/Value.cs +Clients/UsageClient.cs +Clients/UsageConfiguration.cs +Models/Usage/ErrorBase.cs +Models/Usage/GetUsage200Response.cs +Models/Usage/GetUsage200ResponseStatisticsInner.cs +Models/Usage/GetUsage400Response.cs +Models/Usage/GetUsage400ResponseError.cs +Models/Usage/GetUsage400ResponseErrorErrorsInner.cs +Models/Usage/Granularity.cs +Models/Usage/Statistic.cs +Models/Usage/StatisticValue.cs diff --git a/algoliasearch/Models/Recommend/RankingInfo.cs b/algoliasearch/Models/Recommend/RankingInfo.cs index 43b62edc4..c0affdebd 100644 --- a/algoliasearch/Models/Recommend/RankingInfo.cs +++ b/algoliasearch/Models/Recommend/RankingInfo.cs @@ -24,24 +24,18 @@ public RankingInfo() { } /// /// Initializes a new instance of the RankingInfo class. /// - /// Whether a filter matched the query. (required). /// Position of the first matched word in the best matching attribute of the record. (required). /// Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). (required). /// Number of exactly matched words. (required). /// Number of typos encountered when matching the record. (required). - /// Whether the record was promoted by a rule. (required). /// Overall ranking of the record, expressed as a single integer. This attribute is internal. (required). - /// Number of matched words. (required). - public RankingInfo(int filters, int firstMatchedWord, int geoDistance, int nbExactWords, int nbTypos, bool promoted, int userScore, int words) + public RankingInfo(int firstMatchedWord, int geoDistance, int nbExactWords, int nbTypos, int userScore) { - Filters = filters; FirstMatchedWord = firstMatchedWord; GeoDistance = geoDistance; NbExactWords = nbExactWords; NbTypos = nbTypos; - Promoted = promoted; UserScore = userScore; - Words = words; } /// @@ -49,7 +43,7 @@ public RankingInfo(int filters, int firstMatchedWord, int geoDistance, int nbExa /// /// Whether a filter matched the query. [JsonPropertyName("filters")] - public int Filters { get; set; } + public int? Filters { get; set; } /// /// Position of the first matched word in the best matching attribute of the record. @@ -103,7 +97,7 @@ public RankingInfo(int filters, int firstMatchedWord, int geoDistance, int nbExa /// /// Whether the record was promoted by a rule. [JsonPropertyName("promoted")] - public bool Promoted { get; set; } + public bool? Promoted { get; set; } /// /// Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0. @@ -124,7 +118,7 @@ public RankingInfo(int filters, int firstMatchedWord, int geoDistance, int nbExa /// /// Number of matched words. [JsonPropertyName("words")] - public int Words { get; set; } + public int? Words { get; set; } /// /// Whether the record is re-ranked. diff --git a/algoliasearch/Utils/SearchClientExtensions.cs b/algoliasearch/Utils/SearchClientExtensions.cs index 84b53b80f..8047419ee 100644 --- a/algoliasearch/Utils/SearchClientExtensions.cs +++ b/algoliasearch/Utils/SearchClientExtensions.cs @@ -46,6 +46,33 @@ public GetTaskResponse WaitForTask(string indexName, long taskId, int maxRetries Func timeout = null, RequestOptions requestOptions = null, CancellationToken ct = default) => AsyncHelper.RunSync(() => WaitForTaskAsync(indexName, taskId, maxRetries, timeout, requestOptions, ct)); + /// + /// Wait for an application-level task to complete with `taskID`. + /// + /// The `taskID` returned in the method response. + /// The maximum number of retry. 50 by default. (optional) + /// The function to decide how long to wait between retries. Math.Min(retryCount * 200, 5000) by default. (optional) + /// The requestOptions to send along with the query, they will be merged with the transporter requestOptions. (optional) + /// Cancellation token (optional) + public async Task WaitForAppTaskAsync(long taskId, int maxRetries = DefaultMaxRetries, + Func timeout = null, RequestOptions requestOptions = null, CancellationToken ct = default) + { + return await RetryUntil(async () => await GetAppTaskAsync(taskId, requestOptions, ct), + resp => resp.Status == Models.Search.TaskStatus.Published, maxRetries, timeout, ct).ConfigureAwait(false); + } + + /// + /// Wait for an application-level task to complete with `taskID`. (Synchronous version) + /// + /// The `taskID` returned in the method response. + /// The maximum number of retry. 50 by default. (optional) + /// The function to decide how long to wait between retries. Math.Min(retryCount * 200, 5000) by default. (optional) + /// The requestOptions to send along with the query, they will be merged with the transporter requestOptions. (optional) + /// Cancellation token (optional) + public GetTaskResponse WaitForAppTask(long taskId, int maxRetries = DefaultMaxRetries, + Func timeout = null, RequestOptions requestOptions = null, CancellationToken ct = default) => + AsyncHelper.RunSync(() => WaitForAppTaskAsync(taskId, maxRetries, timeout, requestOptions, ct)); + /// /// Helper method that waits for an API key task to be processed. ///