Skip to content

Commit

Permalink
chore: generated code for commit daa9867. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Raffray <[email protected]>
Co-authored-by: Mouaad Aallam <[email protected]>
  • Loading branch information
3 people committed Oct 23, 2023
1 parent daa9867 commit 18e32cd
Show file tree
Hide file tree
Showing 305 changed files with 6,971 additions and 2,410 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export 'src/model/base_index_settings.dart';
export 'src/model/base_search_params.dart';
export 'src/model/base_search_params_without_query.dart';
export 'src/model/base_search_response.dart';
export 'src/model/base_search_response_redirect.dart';
export 'src/model/browse_params_object.dart';
export 'src/model/browse_response.dart';
export 'src/model/built_in_operation.dart';
Expand All @@ -41,6 +40,7 @@ export 'src/model/edit.dart';
export 'src/model/edit_type.dart';
export 'src/model/error_base.dart';
export 'src/model/exact_on_single_word_query.dart';
export 'src/model/exhaustive.dart';
export 'src/model/facet_hits.dart';
export 'src/model/facet_ordering.dart';
export 'src/model/facets.dart';
Expand All @@ -64,6 +64,7 @@ export 'src/model/promote_object_id.dart';
export 'src/model/promote_object_ids.dart';
export 'src/model/query_type.dart';
export 'src/model/ranking_info.dart';
export 'src/model/redirect.dart';
export 'src/model/redirect_rule_index_metadata.dart';
export 'src/model/redirect_rule_index_metadata_data.dart';
export 'src/model/remove_words_if_no_results.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:algoliasearch/src/model/base_index_settings.dart';
import 'package:algoliasearch/src/model/base_search_params.dart';
import 'package:algoliasearch/src/model/base_search_params_without_query.dart';
import 'package:algoliasearch/src/model/base_search_response.dart';
import 'package:algoliasearch/src/model/base_search_response_redirect.dart';
import 'package:algoliasearch/src/model/browse_params_object.dart';
import 'package:algoliasearch/src/model/browse_response.dart';
import 'package:algoliasearch/src/model/built_in_operation.dart';
Expand All @@ -34,6 +33,7 @@ import 'package:algoliasearch/src/model/edit.dart';
import 'package:algoliasearch/src/model/edit_type.dart';
import 'package:algoliasearch/src/model/error_base.dart';
import 'package:algoliasearch/src/model/exact_on_single_word_query.dart';
import 'package:algoliasearch/src/model/exhaustive.dart';
import 'package:algoliasearch/src/model/facet_hits.dart';
import 'package:algoliasearch/src/model/facet_ordering.dart';
import 'package:algoliasearch/src/model/facets.dart';
Expand All @@ -57,6 +57,7 @@ import 'package:algoliasearch/src/model/promote_object_id.dart';
import 'package:algoliasearch/src/model/promote_object_ids.dart';
import 'package:algoliasearch/src/model/query_type.dart';
import 'package:algoliasearch/src/model/ranking_info.dart';
import 'package:algoliasearch/src/model/redirect.dart';
import 'package:algoliasearch/src/model/redirect_rule_index_metadata.dart';
import 'package:algoliasearch/src/model/redirect_rule_index_metadata_data.dart';
import 'package:algoliasearch/src/model/remove_words_if_no_results.dart';
Expand Down Expand Up @@ -150,9 +151,6 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
case 'BaseSearchResponse':
return BaseSearchResponse.fromJson(value as Map<String, dynamic>)
as ReturnType;
case 'BaseSearchResponseRedirect':
return BaseSearchResponseRedirect.fromJson(value as Map<String, dynamic>)
as ReturnType;
case 'BrowseParamsObject':
return BrowseParamsObject.fromJson(value as Map<String, dynamic>)
as ReturnType;
Expand Down Expand Up @@ -202,6 +200,8 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
return ErrorBase.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ExactOnSingleWordQuery':
return ExactOnSingleWordQuery.fromJson(value) as ReturnType;
case 'Exhaustive':
return Exhaustive.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'FacetHits':
return FacetHits.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'FacetOrdering':
Expand Down Expand Up @@ -258,6 +258,8 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
return QueryType.fromJson(value) as ReturnType;
case 'RankingInfo':
return RankingInfo.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'Redirect':
return Redirect.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RedirectRuleIndexMetadata':
return RedirectRuleIndexMetadata.fromJson(value as Map<String, dynamic>)
as ReturnType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
// 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.
// ignore_for_file: unused_element
import 'package:algoliasearch/src/model/base_search_response_redirect.dart';
import 'package:algoliasearch/src/model/redirect.dart';
import 'package:algoliasearch/src/model/facets_stats.dart';
import 'package:algoliasearch/src/model/rendering_content.dart';
import 'package:algoliasearch/src/model/exhaustive.dart';

import 'package:collection/collection.dart';
import 'package:json_annotation/json_annotation.dart';

part 'base_search_response.g.dart';

@JsonSerializable()
final class BaseSearchResponse {
@JsonSerializable(createFieldMap: true)
final class BaseSearchResponse extends DelegatingMap<String, dynamic> {
/// Returns a new [BaseSearchResponse] instance.
const BaseSearchResponse({
this.abTestID,
this.abTestVariantID,
this.aroundLatLng,
this.automaticRadius,
this.exhaustive,
this.exhaustiveFacetsCount,
this.exhaustiveNbHits,
this.exhaustiveTypo,
Expand All @@ -29,14 +32,17 @@ final class BaseSearchResponse {
required this.nbPages,
this.nbSortedHits,
required this.page,
this.redirect,
this.parsedQuery,
required this.processingTimeMS,
this.processingTimingsMS,
this.queryAfterRemoval,
this.redirect,
this.renderingContent,
this.serverTimeMS,
this.serverUsed,
this.userData,
this.renderingContent,
});
Map<String, dynamic> additionalProperties = const {},
}) : super(additionalProperties);

/// A/B test ID. This is only included in the response for indices that are part of an A/B test.
@JsonKey(name: r'abTestID')
Expand All @@ -55,15 +61,21 @@ final class BaseSearchResponse {
@JsonKey(name: r'automaticRadius')
final String? automaticRadius;

/// Indicates whether the facet count is exhaustive (exact) or approximate.
@JsonKey(name: r'exhaustive')
final Exhaustive? exhaustive;

/// See the `facetsCount` field of the `exhaustive` object in the response.
@Deprecated('exhaustiveFacetsCount has been deprecated')
@JsonKey(name: r'exhaustiveFacetsCount')
final bool? exhaustiveFacetsCount;

/// Indicates whether the number of hits `nbHits` is exhaustive (exact) or approximate.
/// See the `nbHits` field of the `exhaustive` object in the response.
@Deprecated('exhaustiveNbHits has been deprecated')
@JsonKey(name: r'exhaustiveNbHits')
final bool? exhaustiveNbHits;

/// Indicates whether the search for typos was exhaustive (exact) or approximate.
/// See the `typo` field of the `exhaustive` object in the response.
@Deprecated('exhaustiveTypo has been deprecated')
@JsonKey(name: r'exhaustiveTypo')
final bool? exhaustiveTypo;

Expand Down Expand Up @@ -109,9 +121,6 @@ final class BaseSearchResponse {
@JsonKey(name: r'page')
final int page;

@JsonKey(name: r'redirect')
final BaseSearchResponseRedirect? redirect;

/// Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
@JsonKey(name: r'parsedQuery')
final String? parsedQuery;
Expand All @@ -120,10 +129,24 @@ final class BaseSearchResponse {
@JsonKey(name: r'processingTimeMS')
final int processingTimeMS;

/// Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
@JsonKey(name: r'processingTimingsMS')
final Object? processingTimingsMS;

/// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
@JsonKey(name: r'queryAfterRemoval')
final String? queryAfterRemoval;

@JsonKey(name: r'redirect')
final Redirect? redirect;

@JsonKey(name: r'renderingContent')
final RenderingContent? renderingContent;

/// Time the server took to process the request, in milliseconds.
@JsonKey(name: r'serverTimeMS')
final int? serverTimeMS;

/// Host name of the server that processed the request.
@JsonKey(name: r'serverUsed')
final String? serverUsed;
Expand All @@ -132,9 +155,6 @@ final class BaseSearchResponse {
@JsonKey(name: r'userData')
final Object? userData;

@JsonKey(name: r'renderingContent')
final RenderingContent? renderingContent;

@override
bool operator ==(Object other) =>
identical(this, other) ||
Expand All @@ -143,6 +163,7 @@ final class BaseSearchResponse {
other.abTestVariantID == abTestVariantID &&
other.aroundLatLng == aroundLatLng &&
other.automaticRadius == automaticRadius &&
other.exhaustive == exhaustive &&
other.exhaustiveFacetsCount == exhaustiveFacetsCount &&
other.exhaustiveNbHits == exhaustiveNbHits &&
other.exhaustiveTypo == exhaustiveTypo &&
Expand All @@ -156,20 +177,24 @@ final class BaseSearchResponse {
other.nbPages == nbPages &&
other.nbSortedHits == nbSortedHits &&
other.page == page &&
other.redirect == redirect &&
other.parsedQuery == parsedQuery &&
other.processingTimeMS == processingTimeMS &&
other.processingTimingsMS == processingTimingsMS &&
other.queryAfterRemoval == queryAfterRemoval &&
other.redirect == redirect &&
other.renderingContent == renderingContent &&
other.serverTimeMS == serverTimeMS &&
other.serverUsed == serverUsed &&
other.userData == userData &&
other.renderingContent == renderingContent;
const MapEquality<String, dynamic>().equals(this, this);

@override
int get hashCode =>
abTestID.hashCode +
abTestVariantID.hashCode +
aroundLatLng.hashCode +
automaticRadius.hashCode +
exhaustive.hashCode +
exhaustiveFacetsCount.hashCode +
exhaustiveNbHits.hashCode +
exhaustiveTypo.hashCode +
Expand All @@ -183,18 +208,56 @@ final class BaseSearchResponse {
nbPages.hashCode +
nbSortedHits.hashCode +
page.hashCode +
redirect.hashCode +
parsedQuery.hashCode +
processingTimeMS.hashCode +
processingTimingsMS.hashCode +
queryAfterRemoval.hashCode +
redirect.hashCode +
renderingContent.hashCode +
serverTimeMS.hashCode +
serverUsed.hashCode +
(userData == null ? 0 : userData.hashCode) +
renderingContent.hashCode;

factory BaseSearchResponse.fromJson(Map<String, dynamic> json) =>
_$BaseSearchResponseFromJson(json);
const MapEquality<String, dynamic>().hash(this);

factory BaseSearchResponse.fromJson(Map<String, dynamic> json) {
final instance = _$BaseSearchResponseFromJson(json);
final additionalProperties = Map<String, dynamic>.from(json)
..removeWhere(
(key, value) => _$BaseSearchResponseFieldMap.containsKey(key));
return BaseSearchResponse(
abTestID: instance.abTestID,
abTestVariantID: instance.abTestVariantID,
aroundLatLng: instance.aroundLatLng,
automaticRadius: instance.automaticRadius,
exhaustive: instance.exhaustive,
exhaustiveFacetsCount: instance.exhaustiveFacetsCount,
exhaustiveNbHits: instance.exhaustiveNbHits,
exhaustiveTypo: instance.exhaustiveTypo,
facets: instance.facets,
facetsStats: instance.facetsStats,
hitsPerPage: instance.hitsPerPage,
index: instance.index,
indexUsed: instance.indexUsed,
message: instance.message,
nbHits: instance.nbHits,
nbPages: instance.nbPages,
nbSortedHits: instance.nbSortedHits,
page: instance.page,
parsedQuery: instance.parsedQuery,
processingTimeMS: instance.processingTimeMS,
processingTimingsMS: instance.processingTimingsMS,
queryAfterRemoval: instance.queryAfterRemoval,
redirect: instance.redirect,
renderingContent: instance.renderingContent,
serverTimeMS: instance.serverTimeMS,
serverUsed: instance.serverUsed,
userData: instance.userData,
additionalProperties: additionalProperties,
);
}

Map<String, dynamic> toJson() => _$BaseSearchResponseToJson(this);
Map<String, dynamic> toJson() =>
_$BaseSearchResponseToJson(this)..addAll(this);

@override
String toString() {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 18e32cd

Please sign in to comment.