Skip to content

Commit

Permalink
chore: generated code for commit 5331694.
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Welke <kai.welke@algolia.com>
  • Loading branch information
algolia-bot and kai687 committed Jul 25, 2024
1 parent 5331694 commit ddc71bb
Show file tree
Hide file tree
Showing 95 changed files with 13,324 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,8 @@ public interface ISearchClient
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>Task of IndexSettings</returns>
Task<IndexSettings> GetSettingsAsync(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default);
/// <returns>Task of SettingsResponse</returns>
Task<SettingsResponse> GetSettingsAsync(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves an object with non-null index settings. (Synchronous version)
Expand All @@ -812,8 +812,8 @@ public interface ISearchClient
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>IndexSettings</returns>
IndexSettings GetSettings(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default);
/// <returns>SettingsResponse</returns>
SettingsResponse GetSettings(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves all allowed IP addresses with access to your application.
Expand Down Expand Up @@ -3077,8 +3077,8 @@ public Rule GetRule(string indexName, string objectID, RequestOptions options =
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>Task of IndexSettings</returns>
public async Task<IndexSettings> GetSettingsAsync(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default)
/// <returns>Task of SettingsResponse</returns>
public async Task<SettingsResponse> GetSettingsAsync(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default)
{

if (indexName == null)
Expand All @@ -3088,7 +3088,7 @@ public async Task<IndexSettings> GetSettingsAsync(string indexName, RequestOptio

requestOptions.PathParameters.Add("indexName", QueryStringHelper.ParameterToString(indexName));

return await _transport.ExecuteRequestAsync<IndexSettings>(new HttpMethod("GET"), "/1/indexes/{indexName}/settings", requestOptions, cancellationToken).ConfigureAwait(false);
return await _transport.ExecuteRequestAsync<SettingsResponse>(new HttpMethod("GET"), "/1/indexes/{indexName}/settings", requestOptions, cancellationToken).ConfigureAwait(false);
}


Expand All @@ -3104,8 +3104,8 @@ public async Task<IndexSettings> GetSettingsAsync(string indexName, RequestOptio
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>IndexSettings</returns>
public IndexSettings GetSettings(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default) =>
/// <returns>SettingsResponse</returns>
public SettingsResponse GetSettings(string indexName, RequestOptions options = null, CancellationToken cancellationToken = default) =>
AsyncHelper.RunSync(() => GetSettingsAsync(indexName, options, cancellationToken));


Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Search;

/// <summary>
/// WithPrimary
/// </summary>
public partial class WithPrimary
{
/// <summary>
/// Initializes a new instance of the WithPrimary class.
/// </summary>
public WithPrimary()
{
}

/// <summary>
/// Replica indices only: the name of the primary index for this replica.
/// </summary>
/// <value>Replica indices only: the name of the primary index for this replica. </value>
[JsonPropertyName("primary")]
public string Primary { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class WithPrimary {\n");
sb.Append(" Primary: ").Append(Primary).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not WithPrimary input)
{
return false;
}

return
(Primary == input.Primary || (Primary != null && Primary.Equals(input.Primary)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Primary != null)
{
hashCode = (hashCode * 59) + Primary.GetHashCode();
}
return hashCode;
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export 'src/model/search_strategy.dart';
export 'src/model/search_type_default.dart';
export 'src/model/search_type_facet.dart';
export 'src/model/semantic_search.dart';
export 'src/model/settings_response.dart';
export 'src/model/snippet_result_option.dart';
export 'src/model/sort_remaining_by.dart';
export 'src/model/supported_language.dart';
Expand All @@ -98,5 +99,6 @@ export 'src/model/trending_items_model.dart';
export 'src/model/trending_items_query.dart';
export 'src/model/typo_tolerance_enum.dart';
export 'src/model/value.dart';
export 'src/model/with_primary.dart';

export 'src/extension.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import 'package:algoliasearch/src/model/search_strategy.dart';
import 'package:algoliasearch/src/model/search_type_default.dart';
import 'package:algoliasearch/src/model/search_type_facet.dart';
import 'package:algoliasearch/src/model/semantic_search.dart';
import 'package:algoliasearch/src/model/settings_response.dart';
import 'package:algoliasearch/src/model/snippet_result_option.dart';
import 'package:algoliasearch/src/model/sort_remaining_by.dart';
import 'package:algoliasearch/src/model/supported_language.dart';
Expand All @@ -91,6 +92,7 @@ import 'package:algoliasearch/src/model/trending_items_model.dart';
import 'package:algoliasearch/src/model/trending_items_query.dart';
import 'package:algoliasearch/src/model/typo_tolerance_enum.dart';
import 'package:algoliasearch/src/model/value.dart';
import 'package:algoliasearch/src/model/with_primary.dart';

final _regList = RegExp(r'^List<(.*)>$');
final _regSet = RegExp(r'^Set<(.*)>$');
Expand Down Expand Up @@ -320,6 +322,9 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
case 'SemanticSearch':
return SemanticSearch.fromJson(value as Map<String, dynamic>)
as ReturnType;
case 'SettingsResponse':
return SettingsResponse.fromJson(value as Map<String, dynamic>)
as ReturnType;
case 'SnippetResultOption':
return SnippetResultOption.fromJson(value as Map<String, dynamic>)
as ReturnType;
Expand Down Expand Up @@ -350,6 +355,8 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
return TypoToleranceEnum.fromJson(value) as ReturnType;
case 'Value':
return Value.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'WithPrimary':
return WithPrimary.fromJson(value as Map<String, dynamic>) as ReturnType;
default:
RegExpMatch? match;

Expand Down
Loading

0 comments on commit ddc71bb

Please # to comment.