From 664f9164e01ad57a861136ad37c16bb42f54c6b8 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Tue, 30 Jul 2024 08:41:03 +0000 Subject: [PATCH] fix(specs): proper title with linter (generated) https://github.com/algolia/api-clients-automation/pull/3444 Co-authored-by: algolia-bot Co-authored-by: Pierre Millot --- .../algoliasearch/lib/algoliasearch_lite.dart | 4 ++-- .../algoliasearch/lib/src/deserialize.dart | 15 ++++++------- .../lib/src/model/base_search_params.dart | 2 +- .../base_search_params_without_query.dart | 2 +- .../lib/src/model/browse_params_object.dart | 2 +- .../lib/src/model/consequence_params.dart | 2 +- .../lib/src/model/fallback_params.dart | 2 +- ...ision_from_value_inner.dart => range.dart} | 17 ++++++-------- .../lib/src/model/range.g.dart} | 13 +++++------ .../src/model/redirect_rule_index_data.dart} | 17 +++++++------- .../model/redirect_rule_index_data.g.dart} | 12 +++++----- .../model/redirect_rule_index_metadata.dart | 4 ++-- .../model/redirect_rule_index_metadata.g.dart | 6 ++--- .../lib/src/model/search_for_facets.dart | 2 +- .../lib/src/model/search_for_hits.dart | 2 +- .../lib/src/model/search_params.dart | 2 +- .../lib/src/model/search_params_object.dart | 2 +- .../lib/algolia_client_recommend.dart | 6 ++--- .../client_recommend/lib/src/deserialize.dart | 22 +++++++++---------- .../lib/src/model/base_search_params.dart | 2 +- .../base_search_params_without_query.dart | 2 +- .../lib/src/model/fallback_params.dart | 2 +- .../lib/src/model/range.dart} | 17 ++++++-------- .../lib/src/model/range.g.dart} | 13 +++++------ .../lib/src/model/recommend_rule.dart | 4 ++-- .../lib/src/model/recommend_rule.g.dart | 2 +- .../src/model/redirect_rule_index_data.dart} | 17 +++++++------- .../model/redirect_rule_index_data.g.dart} | 12 +++++----- .../model/redirect_rule_index_metadata.dart | 4 ++-- .../model/redirect_rule_index_metadata.g.dart | 6 ++--- ..._rule_metadata.dart => rule_metadata.dart} | 16 +++++++------- ...e_metadata.g.dart => rule_metadata.g.dart} | 12 +++++----- .../lib/src/model/search_params.dart | 2 +- .../lib/src/model/search_params_object.dart | 2 +- .../lib/algolia_client_search.dart | 4 ++-- .../client_search/lib/src/deserialize.dart | 15 ++++++------- .../lib/src/model/base_search_params.dart | 2 +- .../base_search_params_without_query.dart | 2 +- .../lib/src/model/browse_params_object.dart | 2 +- .../lib/src/model/consequence_params.dart | 2 +- .../lib/src/model/range.dart} | 17 ++++++-------- ...n_from_value_inner.g.dart => range.g.dart} | 13 +++++------ ...ata.dart => redirect_rule_index_data.dart} | 17 +++++++------- .../model/redirect_rule_index_data.g.dart} | 12 +++++----- .../model/redirect_rule_index_metadata.dart | 4 ++-- .../model/redirect_rule_index_metadata.g.dart | 6 ++--- .../lib/src/model/search_for_facets.dart | 2 +- .../lib/src/model/search_for_hits.dart | 2 +- .../lib/src/model/search_params_object.dart | 2 +- 49 files changed, 158 insertions(+), 191 deletions(-) rename packages/algoliasearch/lib/src/model/{around_precision_from_value_inner.dart => range.dart} (63%) rename packages/{client_recommend/lib/src/model/around_precision_from_value_inner.g.dart => algoliasearch/lib/src/model/range.g.dart} (65%) rename packages/{client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart => algoliasearch/lib/src/model/redirect_rule_index_data.dart} (54%) rename packages/{client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart => algoliasearch/lib/src/model/redirect_rule_index_data.g.dart} (62%) rename packages/{client_search/lib/src/model/around_precision_from_value_inner.dart => client_recommend/lib/src/model/range.dart} (63%) rename packages/{algoliasearch/lib/src/model/around_precision_from_value_inner.g.dart => client_recommend/lib/src/model/range.g.dart} (65%) rename packages/{algoliasearch/lib/src/model/redirect_rule_index_metadata_data.dart => client_recommend/lib/src/model/redirect_rule_index_data.dart} (54%) rename packages/{client_search/lib/src/model/redirect_rule_index_metadata_data.g.dart => client_recommend/lib/src/model/redirect_rule_index_data.g.dart} (62%) rename packages/client_recommend/lib/src/model/{recommend_rule_metadata.dart => rule_metadata.dart} (61%) rename packages/client_recommend/lib/src/model/{recommend_rule_metadata.g.dart => rule_metadata.g.dart} (67%) rename packages/{client_recommend/lib/src/model/around_precision_from_value_inner.dart => client_search/lib/src/model/range.dart} (63%) rename packages/client_search/lib/src/model/{around_precision_from_value_inner.g.dart => range.g.dart} (65%) rename packages/client_search/lib/src/model/{redirect_rule_index_metadata_data.dart => redirect_rule_index_data.dart} (54%) rename packages/{algoliasearch/lib/src/model/redirect_rule_index_metadata_data.g.dart => client_search/lib/src/model/redirect_rule_index_data.g.dart} (62%) diff --git a/packages/algoliasearch/lib/algoliasearch_lite.dart b/packages/algoliasearch/lib/algoliasearch_lite.dart index 8830ca6..4ef0559 100644 --- a/packages/algoliasearch/lib/algoliasearch_lite.dart +++ b/packages/algoliasearch/lib/algoliasearch_lite.dart @@ -9,7 +9,6 @@ export 'src/model/acl.dart'; export 'src/model/advanced_syntax_features.dart'; export 'src/model/alternatives_as_exact.dart'; export 'src/model/api_key.dart'; -export 'src/model/around_precision_from_value_inner.dart'; export 'src/model/around_radius_all.dart'; export 'src/model/automatic_facet_filter.dart'; export 'src/model/base_get_api_key_response.dart'; @@ -53,6 +52,7 @@ export 'src/model/mode.dart'; export 'src/model/params.dart'; export 'src/model/personalization.dart'; export 'src/model/query_type.dart'; +export 'src/model/range.dart'; export 'src/model/ranking_info.dart'; export 'src/model/recommend_hit.dart'; export 'src/model/recommendations_hits.dart'; @@ -61,8 +61,8 @@ export 'src/model/recommended_for_you.dart'; export 'src/model/recommended_for_you_model.dart'; export 'src/model/recommended_for_you_query.dart'; export 'src/model/redirect.dart'; +export 'src/model/redirect_rule_index_data.dart'; export 'src/model/redirect_rule_index_metadata.dart'; -export 'src/model/redirect_rule_index_metadata_data.dart'; export 'src/model/redirect_url.dart'; export 'src/model/related_model.dart'; export 'src/model/related_products.dart'; diff --git a/packages/algoliasearch/lib/src/deserialize.dart b/packages/algoliasearch/lib/src/deserialize.dart index dbf5bba..2ef3823 100644 --- a/packages/algoliasearch/lib/src/deserialize.dart +++ b/packages/algoliasearch/lib/src/deserialize.dart @@ -2,7 +2,6 @@ import 'package:algoliasearch/src/model/acl.dart'; import 'package:algoliasearch/src/model/advanced_syntax_features.dart'; import 'package:algoliasearch/src/model/alternatives_as_exact.dart'; import 'package:algoliasearch/src/model/api_key.dart'; -import 'package:algoliasearch/src/model/around_precision_from_value_inner.dart'; import 'package:algoliasearch/src/model/around_radius_all.dart'; import 'package:algoliasearch/src/model/automatic_facet_filter.dart'; import 'package:algoliasearch/src/model/base_get_api_key_response.dart'; @@ -46,6 +45,7 @@ import 'package:algoliasearch/src/model/mode.dart'; import 'package:algoliasearch/src/model/params.dart'; import 'package:algoliasearch/src/model/personalization.dart'; import 'package:algoliasearch/src/model/query_type.dart'; +import 'package:algoliasearch/src/model/range.dart'; import 'package:algoliasearch/src/model/ranking_info.dart'; import 'package:algoliasearch/src/model/recommend_hit.dart'; import 'package:algoliasearch/src/model/recommendations_hits.dart'; @@ -54,8 +54,8 @@ import 'package:algoliasearch/src/model/recommended_for_you.dart'; import 'package:algoliasearch/src/model/recommended_for_you_model.dart'; import 'package:algoliasearch/src/model/recommended_for_you_query.dart'; import 'package:algoliasearch/src/model/redirect.dart'; +import 'package:algoliasearch/src/model/redirect_rule_index_data.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/redirect_url.dart'; import 'package:algoliasearch/src/model/related_model.dart'; import 'package:algoliasearch/src/model/related_products.dart'; @@ -121,9 +121,6 @@ ReturnType deserialize(dynamic value, String targetType, return AlternativesAsExact.fromJson(value) as ReturnType; case 'ApiKey': return ApiKey.fromJson(value as Map) as ReturnType; - case 'AroundPrecisionFromValueInner': - return AroundPrecisionFromValueInner.fromJson( - value as Map) as ReturnType; case 'AroundRadiusAll': return AroundRadiusAll.fromJson(value) as ReturnType; case 'AutomaticFacetFilter': @@ -236,6 +233,8 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'QueryType': return QueryType.fromJson(value) as ReturnType; + case 'Range': + return Range.fromJson(value as Map) as ReturnType; case 'RankingInfo': return RankingInfo.fromJson(value as Map) as ReturnType; case 'RecommendHit': @@ -256,12 +255,12 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'Redirect': return Redirect.fromJson(value as Map) as ReturnType; + case 'RedirectRuleIndexData': + return RedirectRuleIndexData.fromJson(value as Map) + as ReturnType; case 'RedirectRuleIndexMetadata': return RedirectRuleIndexMetadata.fromJson(value as Map) as ReturnType; - case 'RedirectRuleIndexMetadataData': - return RedirectRuleIndexMetadataData.fromJson( - value as Map) as ReturnType; case 'RedirectURL': return RedirectURL.fromJson(value as Map) as ReturnType; case 'RelatedModel': diff --git a/packages/algoliasearch/lib/src/model/base_search_params.dart b/packages/algoliasearch/lib/src/model/base_search_params.dart index 3baf335..2fb3991 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params.dart @@ -130,7 +130,7 @@ final class BaseSearchParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart b/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart index 7d91ad7..e75567a 100644 --- a/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart +++ b/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart @@ -125,7 +125,7 @@ final class BaseSearchParamsWithoutQuery { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/browse_params_object.dart b/packages/algoliasearch/lib/src/model/browse_params_object.dart index a27195e..f2c38f1 100644 --- a/packages/algoliasearch/lib/src/model/browse_params_object.dart +++ b/packages/algoliasearch/lib/src/model/browse_params_object.dart @@ -183,7 +183,7 @@ final class BrowseParamsObject { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/consequence_params.dart b/packages/algoliasearch/lib/src/model/consequence_params.dart index df7b2b8..4117f93 100644 --- a/packages/algoliasearch/lib/src/model/consequence_params.dart +++ b/packages/algoliasearch/lib/src/model/consequence_params.dart @@ -180,7 +180,7 @@ final class ConsequenceParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/fallback_params.dart b/packages/algoliasearch/lib/src/model/fallback_params.dart index cf5ba7f..4091cea 100644 --- a/packages/algoliasearch/lib/src/model/fallback_params.dart +++ b/packages/algoliasearch/lib/src/model/fallback_params.dart @@ -182,7 +182,7 @@ final class FallbackParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/around_precision_from_value_inner.dart b/packages/algoliasearch/lib/src/model/range.dart similarity index 63% rename from packages/algoliasearch/lib/src/model/around_precision_from_value_inner.dart rename to packages/algoliasearch/lib/src/model/range.dart index b426c87..029577a 100644 --- a/packages/algoliasearch/lib/src/model/around_precision_from_value_inner.dart +++ b/packages/algoliasearch/lib/src/model/range.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'around_precision_from_value_inner.g.dart'; +part 'range.g.dart'; @JsonSerializable() -final class AroundPrecisionFromValueInner { - /// Returns a new [AroundPrecisionFromValueInner] instance. - const AroundPrecisionFromValueInner({ +final class Range { + /// Returns a new [Range] instance. + const Range({ this.from, this.value, }); @@ -24,17 +24,14 @@ final class AroundPrecisionFromValueInner { @override bool operator ==(Object other) => identical(this, other) || - other is AroundPrecisionFromValueInner && - other.from == from && - other.value == value; + other is Range && other.from == from && other.value == value; @override int get hashCode => from.hashCode + value.hashCode; - factory AroundPrecisionFromValueInner.fromJson(Map json) => - _$AroundPrecisionFromValueInnerFromJson(json); + factory Range.fromJson(Map json) => _$RangeFromJson(json); - Map toJson() => _$AroundPrecisionFromValueInnerToJson(this); + Map toJson() => _$RangeToJson(this); @override String toString() { diff --git a/packages/client_recommend/lib/src/model/around_precision_from_value_inner.g.dart b/packages/algoliasearch/lib/src/model/range.g.dart similarity index 65% rename from packages/client_recommend/lib/src/model/around_precision_from_value_inner.g.dart rename to packages/algoliasearch/lib/src/model/range.g.dart index 026e055..223e9bd 100644 --- a/packages/client_recommend/lib/src/model/around_precision_from_value_inner.g.dart +++ b/packages/algoliasearch/lib/src/model/range.g.dart @@ -1,18 +1,16 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'around_precision_from_value_inner.dart'; +part of 'range.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( - Map json) => - $checkedCreate( - 'AroundPrecisionFromValueInner', +Range _$RangeFromJson(Map json) => $checkedCreate( + 'Range', json, ($checkedConvert) { - final val = AroundPrecisionFromValueInner( + final val = Range( from: $checkedConvert('from', (v) => (v as num?)?.toInt()), value: $checkedConvert('value', (v) => (v as num?)?.toInt()), ); @@ -20,8 +18,7 @@ AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( }, ); -Map _$AroundPrecisionFromValueInnerToJson( - AroundPrecisionFromValueInner instance) { +Map _$RangeToJson(Range instance) { final val = {}; void writeNotNull(String key, dynamic value) { diff --git a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart b/packages/algoliasearch/lib/src/model/redirect_rule_index_data.dart similarity index 54% rename from packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart rename to packages/algoliasearch/lib/src/model/redirect_rule_index_data.dart index f9bba71..55f0f0e 100644 --- a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart +++ b/packages/algoliasearch/lib/src/model/redirect_rule_index_data.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'redirect_rule_index_metadata_data.g.dart'; +part 'redirect_rule_index_data.g.dart'; @JsonSerializable() -final class RedirectRuleIndexMetadataData { - /// Returns a new [RedirectRuleIndexMetadataData] instance. - const RedirectRuleIndexMetadataData({ +final class RedirectRuleIndexData { + /// Returns a new [RedirectRuleIndexData] instance. + const RedirectRuleIndexData({ required this.ruleObjectID, }); @@ -18,16 +18,15 @@ final class RedirectRuleIndexMetadataData { @override bool operator ==(Object other) => identical(this, other) || - other is RedirectRuleIndexMetadataData && - other.ruleObjectID == ruleObjectID; + other is RedirectRuleIndexData && other.ruleObjectID == ruleObjectID; @override int get hashCode => ruleObjectID.hashCode; - factory RedirectRuleIndexMetadataData.fromJson(Map json) => - _$RedirectRuleIndexMetadataDataFromJson(json); + factory RedirectRuleIndexData.fromJson(Map json) => + _$RedirectRuleIndexDataFromJson(json); - Map toJson() => _$RedirectRuleIndexMetadataDataToJson(this); + Map toJson() => _$RedirectRuleIndexDataToJson(this); @override String toString() { diff --git a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart b/packages/algoliasearch/lib/src/model/redirect_rule_index_data.g.dart similarity index 62% rename from packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart rename to packages/algoliasearch/lib/src/model/redirect_rule_index_data.g.dart index c994c4c..a038eb9 100644 --- a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart +++ b/packages/algoliasearch/lib/src/model/redirect_rule_index_data.g.dart @@ -1,26 +1,26 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'redirect_rule_index_metadata_data.dart'; +part of 'redirect_rule_index_data.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -RedirectRuleIndexMetadataData _$RedirectRuleIndexMetadataDataFromJson( +RedirectRuleIndexData _$RedirectRuleIndexDataFromJson( Map json) => $checkedCreate( - 'RedirectRuleIndexMetadataData', + 'RedirectRuleIndexData', json, ($checkedConvert) { - final val = RedirectRuleIndexMetadataData( + final val = RedirectRuleIndexData( ruleObjectID: $checkedConvert('ruleObjectID', (v) => v as String), ); return val; }, ); -Map _$RedirectRuleIndexMetadataDataToJson( - RedirectRuleIndexMetadataData instance) => +Map _$RedirectRuleIndexDataToJson( + RedirectRuleIndexData instance) => { 'ruleObjectID': instance.ruleObjectID, }; diff --git a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.dart b/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.dart index 8b4934f..58af143 100644 --- a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.dart +++ b/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.dart @@ -1,6 +1,6 @@ // 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/redirect_rule_index_metadata_data.dart'; +import 'package:algoliasearch/src/model/redirect_rule_index_data.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -34,7 +34,7 @@ final class RedirectRuleIndexMetadata { final bool succeed; @JsonKey(name: r'data') - final RedirectRuleIndexMetadataData data; + final RedirectRuleIndexData data; @override bool operator ==(Object other) => diff --git a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.g.dart b/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.g.dart index d2e1897..91cb7e5 100644 --- a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.g.dart +++ b/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata.g.dart @@ -17,10 +17,8 @@ RedirectRuleIndexMetadata _$RedirectRuleIndexMetadataFromJson( dest: $checkedConvert('dest', (v) => v as String), reason: $checkedConvert('reason', (v) => v as String), succeed: $checkedConvert('succeed', (v) => v as bool), - data: $checkedConvert( - 'data', - (v) => RedirectRuleIndexMetadataData.fromJson( - v as Map)), + data: $checkedConvert('data', + (v) => RedirectRuleIndexData.fromJson(v as Map)), ); return val; }, diff --git a/packages/algoliasearch/lib/src/model/search_for_facets.dart b/packages/algoliasearch/lib/src/model/search_for_facets.dart index 0e9ba3a..90e2198 100644 --- a/packages/algoliasearch/lib/src/model/search_for_facets.dart +++ b/packages/algoliasearch/lib/src/model/search_for_facets.dart @@ -187,7 +187,7 @@ final class SearchForFacets { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/search_for_hits.dart b/packages/algoliasearch/lib/src/model/search_for_hits.dart index 7710edc..6092579 100644 --- a/packages/algoliasearch/lib/src/model/search_for_hits.dart +++ b/packages/algoliasearch/lib/src/model/search_for_hits.dart @@ -185,7 +185,7 @@ final class SearchForHits { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/search_params.dart b/packages/algoliasearch/lib/src/model/search_params.dart index b9d29c4..7ad1bf1 100644 --- a/packages/algoliasearch/lib/src/model/search_params.dart +++ b/packages/algoliasearch/lib/src/model/search_params.dart @@ -182,7 +182,7 @@ final class SearchParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/algoliasearch/lib/src/model/search_params_object.dart b/packages/algoliasearch/lib/src/model/search_params_object.dart index 65bdb56..87f9af3 100644 --- a/packages/algoliasearch/lib/src/model/search_params_object.dart +++ b/packages/algoliasearch/lib/src/model/search_params_object.dart @@ -182,7 +182,7 @@ final class SearchParamsObject { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_recommend/lib/algolia_client_recommend.dart b/packages/client_recommend/lib/algolia_client_recommend.dart index 53141f9..9880b6a 100644 --- a/packages/client_recommend/lib/algolia_client_recommend.dart +++ b/packages/client_recommend/lib/algolia_client_recommend.dart @@ -7,7 +7,6 @@ export 'src/api/recommend_client.dart'; export 'src/model/advanced_syntax_features.dart'; export 'src/model/alternatives_as_exact.dart'; -export 'src/model/around_precision_from_value_inner.dart'; export 'src/model/around_radius_all.dart'; export 'src/model/auto_facet_filter.dart'; export 'src/model/base_recommend_request.dart'; @@ -43,25 +42,26 @@ export 'src/model/params_consequence.dart'; export 'src/model/personalization.dart'; export 'src/model/promote_consequence_object.dart'; export 'src/model/query_type.dart'; +export 'src/model/range.dart'; export 'src/model/ranking_info.dart'; export 'src/model/recommend_hit.dart'; export 'src/model/recommend_models.dart'; export 'src/model/recommend_rule.dart'; -export 'src/model/recommend_rule_metadata.dart'; export 'src/model/recommendations_hits.dart'; export 'src/model/recommendations_results.dart'; export 'src/model/recommended_for_you.dart'; export 'src/model/recommended_for_you_model.dart'; export 'src/model/recommended_for_you_query.dart'; export 'src/model/redirect.dart'; +export 'src/model/redirect_rule_index_data.dart'; export 'src/model/redirect_rule_index_metadata.dart'; -export 'src/model/redirect_rule_index_metadata_data.dart'; export 'src/model/redirect_url.dart'; export 'src/model/related_model.dart'; export 'src/model/related_products.dart'; export 'src/model/related_query.dart'; export 'src/model/remove_words_if_no_results.dart'; export 'src/model/rendering_content.dart'; +export 'src/model/rule_metadata.dart'; export 'src/model/search_pagination.dart'; export 'src/model/search_params.dart'; export 'src/model/search_params_object.dart'; diff --git a/packages/client_recommend/lib/src/deserialize.dart b/packages/client_recommend/lib/src/deserialize.dart index 54ab8bb..d65bec0 100644 --- a/packages/client_recommend/lib/src/deserialize.dart +++ b/packages/client_recommend/lib/src/deserialize.dart @@ -1,6 +1,5 @@ import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; -import 'package:algolia_client_recommend/src/model/around_precision_from_value_inner.dart'; import 'package:algolia_client_recommend/src/model/around_radius_all.dart'; import 'package:algolia_client_recommend/src/model/auto_facet_filter.dart'; import 'package:algolia_client_recommend/src/model/base_recommend_request.dart'; @@ -36,25 +35,26 @@ import 'package:algolia_client_recommend/src/model/params_consequence.dart'; import 'package:algolia_client_recommend/src/model/personalization.dart'; import 'package:algolia_client_recommend/src/model/promote_consequence_object.dart'; import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/range.dart'; import 'package:algolia_client_recommend/src/model/ranking_info.dart'; import 'package:algolia_client_recommend/src/model/recommend_hit.dart'; import 'package:algolia_client_recommend/src/model/recommend_models.dart'; import 'package:algolia_client_recommend/src/model/recommend_rule.dart'; -import 'package:algolia_client_recommend/src/model/recommend_rule_metadata.dart'; import 'package:algolia_client_recommend/src/model/recommendations_hits.dart'; import 'package:algolia_client_recommend/src/model/recommendations_results.dart'; import 'package:algolia_client_recommend/src/model/recommended_for_you.dart'; import 'package:algolia_client_recommend/src/model/recommended_for_you_model.dart'; import 'package:algolia_client_recommend/src/model/recommended_for_you_query.dart'; import 'package:algolia_client_recommend/src/model/redirect.dart'; +import 'package:algolia_client_recommend/src/model/redirect_rule_index_data.dart'; import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata.dart'; -import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata_data.dart'; import 'package:algolia_client_recommend/src/model/redirect_url.dart'; import 'package:algolia_client_recommend/src/model/related_model.dart'; import 'package:algolia_client_recommend/src/model/related_products.dart'; import 'package:algolia_client_recommend/src/model/related_query.dart'; import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; import 'package:algolia_client_recommend/src/model/rendering_content.dart'; +import 'package:algolia_client_recommend/src/model/rule_metadata.dart'; import 'package:algolia_client_recommend/src/model/search_pagination.dart'; import 'package:algolia_client_recommend/src/model/search_params.dart'; import 'package:algolia_client_recommend/src/model/search_params_object.dart'; @@ -99,9 +99,6 @@ ReturnType deserialize(dynamic value, String targetType, return AdvancedSyntaxFeatures.fromJson(value) as ReturnType; case 'AlternativesAsExact': return AlternativesAsExact.fromJson(value) as ReturnType; - case 'AroundPrecisionFromValueInner': - return AroundPrecisionFromValueInner.fromJson( - value as Map) as ReturnType; case 'AroundRadiusAll': return AroundRadiusAll.fromJson(value) as ReturnType; case 'AutoFacetFilter': @@ -194,6 +191,8 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'QueryType': return QueryType.fromJson(value) as ReturnType; + case 'Range': + return Range.fromJson(value as Map) as ReturnType; case 'RankingInfo': return RankingInfo.fromJson(value as Map) as ReturnType; case 'RecommendHit': @@ -203,9 +202,6 @@ ReturnType deserialize(dynamic value, String targetType, case 'RecommendRule': return RecommendRule.fromJson(value as Map) as ReturnType; - case 'RecommendRuleMetadata': - return RecommendRuleMetadata.fromJson(value as Map) - as ReturnType; case 'RecommendationsHits': return RecommendationsHits.fromJson(value as Map) as ReturnType; @@ -222,12 +218,12 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'Redirect': return Redirect.fromJson(value as Map) as ReturnType; + case 'RedirectRuleIndexData': + return RedirectRuleIndexData.fromJson(value as Map) + as ReturnType; case 'RedirectRuleIndexMetadata': return RedirectRuleIndexMetadata.fromJson(value as Map) as ReturnType; - case 'RedirectRuleIndexMetadataData': - return RedirectRuleIndexMetadataData.fromJson( - value as Map) as ReturnType; case 'RedirectURL': return RedirectURL.fromJson(value as Map) as ReturnType; case 'RelatedModel': @@ -242,6 +238,8 @@ ReturnType deserialize(dynamic value, String targetType, case 'RenderingContent': return RenderingContent.fromJson(value as Map) as ReturnType; + case 'RuleMetadata': + return RuleMetadata.fromJson(value as Map) as ReturnType; case 'SearchPagination': return SearchPagination.fromJson(value as Map) as ReturnType; diff --git a/packages/client_recommend/lib/src/model/base_search_params.dart b/packages/client_recommend/lib/src/model/base_search_params.dart index 340cfc7..0804061 100644 --- a/packages/client_recommend/lib/src/model/base_search_params.dart +++ b/packages/client_recommend/lib/src/model/base_search_params.dart @@ -130,7 +130,7 @@ final class BaseSearchParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_recommend/lib/src/model/base_search_params_without_query.dart b/packages/client_recommend/lib/src/model/base_search_params_without_query.dart index 982fba8..adeb385 100644 --- a/packages/client_recommend/lib/src/model/base_search_params_without_query.dart +++ b/packages/client_recommend/lib/src/model/base_search_params_without_query.dart @@ -125,7 +125,7 @@ final class BaseSearchParamsWithoutQuery { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_recommend/lib/src/model/fallback_params.dart b/packages/client_recommend/lib/src/model/fallback_params.dart index 154a3a4..e139409 100644 --- a/packages/client_recommend/lib/src/model/fallback_params.dart +++ b/packages/client_recommend/lib/src/model/fallback_params.dart @@ -182,7 +182,7 @@ final class FallbackParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/around_precision_from_value_inner.dart b/packages/client_recommend/lib/src/model/range.dart similarity index 63% rename from packages/client_search/lib/src/model/around_precision_from_value_inner.dart rename to packages/client_recommend/lib/src/model/range.dart index b426c87..029577a 100644 --- a/packages/client_search/lib/src/model/around_precision_from_value_inner.dart +++ b/packages/client_recommend/lib/src/model/range.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'around_precision_from_value_inner.g.dart'; +part 'range.g.dart'; @JsonSerializable() -final class AroundPrecisionFromValueInner { - /// Returns a new [AroundPrecisionFromValueInner] instance. - const AroundPrecisionFromValueInner({ +final class Range { + /// Returns a new [Range] instance. + const Range({ this.from, this.value, }); @@ -24,17 +24,14 @@ final class AroundPrecisionFromValueInner { @override bool operator ==(Object other) => identical(this, other) || - other is AroundPrecisionFromValueInner && - other.from == from && - other.value == value; + other is Range && other.from == from && other.value == value; @override int get hashCode => from.hashCode + value.hashCode; - factory AroundPrecisionFromValueInner.fromJson(Map json) => - _$AroundPrecisionFromValueInnerFromJson(json); + factory Range.fromJson(Map json) => _$RangeFromJson(json); - Map toJson() => _$AroundPrecisionFromValueInnerToJson(this); + Map toJson() => _$RangeToJson(this); @override String toString() { diff --git a/packages/algoliasearch/lib/src/model/around_precision_from_value_inner.g.dart b/packages/client_recommend/lib/src/model/range.g.dart similarity index 65% rename from packages/algoliasearch/lib/src/model/around_precision_from_value_inner.g.dart rename to packages/client_recommend/lib/src/model/range.g.dart index 026e055..223e9bd 100644 --- a/packages/algoliasearch/lib/src/model/around_precision_from_value_inner.g.dart +++ b/packages/client_recommend/lib/src/model/range.g.dart @@ -1,18 +1,16 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'around_precision_from_value_inner.dart'; +part of 'range.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( - Map json) => - $checkedCreate( - 'AroundPrecisionFromValueInner', +Range _$RangeFromJson(Map json) => $checkedCreate( + 'Range', json, ($checkedConvert) { - final val = AroundPrecisionFromValueInner( + final val = Range( from: $checkedConvert('from', (v) => (v as num?)?.toInt()), value: $checkedConvert('value', (v) => (v as num?)?.toInt()), ); @@ -20,8 +18,7 @@ AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( }, ); -Map _$AroundPrecisionFromValueInnerToJson( - AroundPrecisionFromValueInner instance) { +Map _$RangeToJson(Range instance) { final val = {}; void writeNotNull(String key, dynamic value) { diff --git a/packages/client_recommend/lib/src/model/recommend_rule.dart b/packages/client_recommend/lib/src/model/recommend_rule.dart index f81bd9c..a850016 100644 --- a/packages/client_recommend/lib/src/model/recommend_rule.dart +++ b/packages/client_recommend/lib/src/model/recommend_rule.dart @@ -1,7 +1,7 @@ // 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:algolia_client_recommend/src/model/recommend_rule_metadata.dart'; import 'package:algolia_client_recommend/src/model/condition.dart'; +import 'package:algolia_client_recommend/src/model/rule_metadata.dart'; import 'package:algolia_client_recommend/src/model/consequence.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -21,7 +21,7 @@ final class RecommendRule { }); @JsonKey(name: r'_metadata') - final RecommendRuleMetadata? metadata; + final RuleMetadata? metadata; /// Unique identifier of a rule object. @JsonKey(name: r'objectID') diff --git a/packages/client_recommend/lib/src/model/recommend_rule.g.dart b/packages/client_recommend/lib/src/model/recommend_rule.g.dart index b04850c..d62bdfe 100644 --- a/packages/client_recommend/lib/src/model/recommend_rule.g.dart +++ b/packages/client_recommend/lib/src/model/recommend_rule.g.dart @@ -16,7 +16,7 @@ RecommendRule _$RecommendRuleFromJson(Map json) => '_metadata', (v) => v == null ? null - : RecommendRuleMetadata.fromJson(v as Map)), + : RuleMetadata.fromJson(v as Map)), objectID: $checkedConvert('objectID', (v) => v as String?), condition: $checkedConvert( 'condition', diff --git a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.dart b/packages/client_recommend/lib/src/model/redirect_rule_index_data.dart similarity index 54% rename from packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.dart rename to packages/client_recommend/lib/src/model/redirect_rule_index_data.dart index f9bba71..55f0f0e 100644 --- a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.dart +++ b/packages/client_recommend/lib/src/model/redirect_rule_index_data.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'redirect_rule_index_metadata_data.g.dart'; +part 'redirect_rule_index_data.g.dart'; @JsonSerializable() -final class RedirectRuleIndexMetadataData { - /// Returns a new [RedirectRuleIndexMetadataData] instance. - const RedirectRuleIndexMetadataData({ +final class RedirectRuleIndexData { + /// Returns a new [RedirectRuleIndexData] instance. + const RedirectRuleIndexData({ required this.ruleObjectID, }); @@ -18,16 +18,15 @@ final class RedirectRuleIndexMetadataData { @override bool operator ==(Object other) => identical(this, other) || - other is RedirectRuleIndexMetadataData && - other.ruleObjectID == ruleObjectID; + other is RedirectRuleIndexData && other.ruleObjectID == ruleObjectID; @override int get hashCode => ruleObjectID.hashCode; - factory RedirectRuleIndexMetadataData.fromJson(Map json) => - _$RedirectRuleIndexMetadataDataFromJson(json); + factory RedirectRuleIndexData.fromJson(Map json) => + _$RedirectRuleIndexDataFromJson(json); - Map toJson() => _$RedirectRuleIndexMetadataDataToJson(this); + Map toJson() => _$RedirectRuleIndexDataToJson(this); @override String toString() { diff --git a/packages/client_search/lib/src/model/redirect_rule_index_metadata_data.g.dart b/packages/client_recommend/lib/src/model/redirect_rule_index_data.g.dart similarity index 62% rename from packages/client_search/lib/src/model/redirect_rule_index_metadata_data.g.dart rename to packages/client_recommend/lib/src/model/redirect_rule_index_data.g.dart index c994c4c..a038eb9 100644 --- a/packages/client_search/lib/src/model/redirect_rule_index_metadata_data.g.dart +++ b/packages/client_recommend/lib/src/model/redirect_rule_index_data.g.dart @@ -1,26 +1,26 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'redirect_rule_index_metadata_data.dart'; +part of 'redirect_rule_index_data.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -RedirectRuleIndexMetadataData _$RedirectRuleIndexMetadataDataFromJson( +RedirectRuleIndexData _$RedirectRuleIndexDataFromJson( Map json) => $checkedCreate( - 'RedirectRuleIndexMetadataData', + 'RedirectRuleIndexData', json, ($checkedConvert) { - final val = RedirectRuleIndexMetadataData( + final val = RedirectRuleIndexData( ruleObjectID: $checkedConvert('ruleObjectID', (v) => v as String), ); return val; }, ); -Map _$RedirectRuleIndexMetadataDataToJson( - RedirectRuleIndexMetadataData instance) => +Map _$RedirectRuleIndexDataToJson( + RedirectRuleIndexData instance) => { 'ruleObjectID': instance.ruleObjectID, }; diff --git a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart b/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart index 9ac021c..0358abc 100644 --- a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart +++ b/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart @@ -1,6 +1,6 @@ // 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:algolia_client_recommend/src/model/redirect_rule_index_metadata_data.dart'; +import 'package:algolia_client_recommend/src/model/redirect_rule_index_data.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -34,7 +34,7 @@ final class RedirectRuleIndexMetadata { final bool succeed; @JsonKey(name: r'data') - final RedirectRuleIndexMetadataData data; + final RedirectRuleIndexData data; @override bool operator ==(Object other) => diff --git a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart b/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart index d2e1897..91cb7e5 100644 --- a/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart +++ b/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart @@ -17,10 +17,8 @@ RedirectRuleIndexMetadata _$RedirectRuleIndexMetadataFromJson( dest: $checkedConvert('dest', (v) => v as String), reason: $checkedConvert('reason', (v) => v as String), succeed: $checkedConvert('succeed', (v) => v as bool), - data: $checkedConvert( - 'data', - (v) => RedirectRuleIndexMetadataData.fromJson( - v as Map)), + data: $checkedConvert('data', + (v) => RedirectRuleIndexData.fromJson(v as Map)), ); return val; }, diff --git a/packages/client_recommend/lib/src/model/recommend_rule_metadata.dart b/packages/client_recommend/lib/src/model/rule_metadata.dart similarity index 61% rename from packages/client_recommend/lib/src/model/recommend_rule_metadata.dart rename to packages/client_recommend/lib/src/model/rule_metadata.dart index 2f01ee3..0ddcfdb 100644 --- a/packages/client_recommend/lib/src/model/recommend_rule_metadata.dart +++ b/packages/client_recommend/lib/src/model/rule_metadata.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'recommend_rule_metadata.g.dart'; +part 'rule_metadata.g.dart'; @JsonSerializable() -final class RecommendRuleMetadata { - /// Returns a new [RecommendRuleMetadata] instance. - const RecommendRuleMetadata({ +final class RuleMetadata { + /// Returns a new [RuleMetadata] instance. + const RuleMetadata({ this.lastUpdate, }); @@ -19,15 +19,15 @@ final class RecommendRuleMetadata { @override bool operator ==(Object other) => identical(this, other) || - other is RecommendRuleMetadata && other.lastUpdate == lastUpdate; + other is RuleMetadata && other.lastUpdate == lastUpdate; @override int get hashCode => lastUpdate.hashCode; - factory RecommendRuleMetadata.fromJson(Map json) => - _$RecommendRuleMetadataFromJson(json); + factory RuleMetadata.fromJson(Map json) => + _$RuleMetadataFromJson(json); - Map toJson() => _$RecommendRuleMetadataToJson(this); + Map toJson() => _$RuleMetadataToJson(this); @override String toString() { diff --git a/packages/client_recommend/lib/src/model/recommend_rule_metadata.g.dart b/packages/client_recommend/lib/src/model/rule_metadata.g.dart similarity index 67% rename from packages/client_recommend/lib/src/model/recommend_rule_metadata.g.dart rename to packages/client_recommend/lib/src/model/rule_metadata.g.dart index 30dcaaf..518d3ae 100644 --- a/packages/client_recommend/lib/src/model/recommend_rule_metadata.g.dart +++ b/packages/client_recommend/lib/src/model/rule_metadata.g.dart @@ -1,26 +1,24 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'recommend_rule_metadata.dart'; +part of 'rule_metadata.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -RecommendRuleMetadata _$RecommendRuleMetadataFromJson( - Map json) => +RuleMetadata _$RuleMetadataFromJson(Map json) => $checkedCreate( - 'RecommendRuleMetadata', + 'RuleMetadata', json, ($checkedConvert) { - final val = RecommendRuleMetadata( + final val = RuleMetadata( lastUpdate: $checkedConvert('lastUpdate', (v) => v as String?), ); return val; }, ); -Map _$RecommendRuleMetadataToJson( - RecommendRuleMetadata instance) { +Map _$RuleMetadataToJson(RuleMetadata instance) { final val = {}; void writeNotNull(String key, dynamic value) { diff --git a/packages/client_recommend/lib/src/model/search_params.dart b/packages/client_recommend/lib/src/model/search_params.dart index a648ca4..f863536 100644 --- a/packages/client_recommend/lib/src/model/search_params.dart +++ b/packages/client_recommend/lib/src/model/search_params.dart @@ -182,7 +182,7 @@ final class SearchParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_recommend/lib/src/model/search_params_object.dart b/packages/client_recommend/lib/src/model/search_params_object.dart index f3d0664..134903a 100644 --- a/packages/client_recommend/lib/src/model/search_params_object.dart +++ b/packages/client_recommend/lib/src/model/search_params_object.dart @@ -182,7 +182,7 @@ final class SearchParamsObject { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/algolia_client_search.dart b/packages/client_search/lib/algolia_client_search.dart index 944b643..0cb5134 100644 --- a/packages/client_search/lib/algolia_client_search.dart +++ b/packages/client_search/lib/algolia_client_search.dart @@ -13,7 +13,6 @@ export 'src/model/alternatives_as_exact.dart'; export 'src/model/anchoring.dart'; export 'src/model/api_key.dart'; export 'src/model/api_key_operation.dart'; -export 'src/model/around_precision_from_value_inner.dart'; export 'src/model/around_radius_all.dart'; export 'src/model/assign_user_id_params.dart'; export 'src/model/automatic_facet_filter.dart'; @@ -94,10 +93,11 @@ export 'src/model/personalization.dart'; export 'src/model/promote_object_id.dart'; export 'src/model/promote_object_ids.dart'; export 'src/model/query_type.dart'; +export 'src/model/range.dart'; export 'src/model/ranking_info.dart'; export 'src/model/redirect.dart'; +export 'src/model/redirect_rule_index_data.dart'; export 'src/model/redirect_rule_index_metadata.dart'; -export 'src/model/redirect_rule_index_metadata_data.dart'; export 'src/model/redirect_url.dart'; export 'src/model/remove_user_id_response.dart'; export 'src/model/remove_words_if_no_results.dart'; diff --git a/packages/client_search/lib/src/deserialize.dart b/packages/client_search/lib/src/deserialize.dart index c4fefce..4299423 100644 --- a/packages/client_search/lib/src/deserialize.dart +++ b/packages/client_search/lib/src/deserialize.dart @@ -6,7 +6,6 @@ import 'package:algolia_client_search/src/model/alternatives_as_exact.dart'; import 'package:algolia_client_search/src/model/anchoring.dart'; import 'package:algolia_client_search/src/model/api_key.dart'; import 'package:algolia_client_search/src/model/api_key_operation.dart'; -import 'package:algolia_client_search/src/model/around_precision_from_value_inner.dart'; import 'package:algolia_client_search/src/model/around_radius_all.dart'; import 'package:algolia_client_search/src/model/assign_user_id_params.dart'; import 'package:algolia_client_search/src/model/automatic_facet_filter.dart'; @@ -87,10 +86,11 @@ import 'package:algolia_client_search/src/model/personalization.dart'; import 'package:algolia_client_search/src/model/promote_object_id.dart'; import 'package:algolia_client_search/src/model/promote_object_ids.dart'; import 'package:algolia_client_search/src/model/query_type.dart'; +import 'package:algolia_client_search/src/model/range.dart'; import 'package:algolia_client_search/src/model/ranking_info.dart'; import 'package:algolia_client_search/src/model/redirect.dart'; +import 'package:algolia_client_search/src/model/redirect_rule_index_data.dart'; import 'package:algolia_client_search/src/model/redirect_rule_index_metadata.dart'; -import 'package:algolia_client_search/src/model/redirect_rule_index_metadata_data.dart'; import 'package:algolia_client_search/src/model/redirect_url.dart'; import 'package:algolia_client_search/src/model/remove_user_id_response.dart'; import 'package:algolia_client_search/src/model/remove_words_if_no_results.dart'; @@ -185,9 +185,6 @@ ReturnType deserialize(dynamic value, String targetType, return ApiKey.fromJson(value as Map) as ReturnType; case 'ApiKeyOperation': return ApiKeyOperation.fromJson(value) as ReturnType; - case 'AroundPrecisionFromValueInner': - return AroundPrecisionFromValueInner.fromJson( - value as Map) as ReturnType; case 'AroundRadiusAll': return AroundRadiusAll.fromJson(value) as ReturnType; case 'AssignUserIdParams': @@ -399,16 +396,18 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'QueryType': return QueryType.fromJson(value) as ReturnType; + case 'Range': + return Range.fromJson(value as Map) as ReturnType; case 'RankingInfo': return RankingInfo.fromJson(value as Map) as ReturnType; case 'Redirect': return Redirect.fromJson(value as Map) as ReturnType; + case 'RedirectRuleIndexData': + return RedirectRuleIndexData.fromJson(value as Map) + as ReturnType; case 'RedirectRuleIndexMetadata': return RedirectRuleIndexMetadata.fromJson(value as Map) as ReturnType; - case 'RedirectRuleIndexMetadataData': - return RedirectRuleIndexMetadataData.fromJson( - value as Map) as ReturnType; case 'RedirectURL': return RedirectURL.fromJson(value as Map) as ReturnType; case 'RemoveUserIdResponse': diff --git a/packages/client_search/lib/src/model/base_search_params.dart b/packages/client_search/lib/src/model/base_search_params.dart index 7613849..7208b6d 100644 --- a/packages/client_search/lib/src/model/base_search_params.dart +++ b/packages/client_search/lib/src/model/base_search_params.dart @@ -130,7 +130,7 @@ final class BaseSearchParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/base_search_params_without_query.dart b/packages/client_search/lib/src/model/base_search_params_without_query.dart index a248950..ca67cc9 100644 --- a/packages/client_search/lib/src/model/base_search_params_without_query.dart +++ b/packages/client_search/lib/src/model/base_search_params_without_query.dart @@ -125,7 +125,7 @@ final class BaseSearchParamsWithoutQuery { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/browse_params_object.dart b/packages/client_search/lib/src/model/browse_params_object.dart index 69e1932..c9d7544 100644 --- a/packages/client_search/lib/src/model/browse_params_object.dart +++ b/packages/client_search/lib/src/model/browse_params_object.dart @@ -183,7 +183,7 @@ final class BrowseParamsObject { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/consequence_params.dart b/packages/client_search/lib/src/model/consequence_params.dart index e502559..15bf975 100644 --- a/packages/client_search/lib/src/model/consequence_params.dart +++ b/packages/client_search/lib/src/model/consequence_params.dart @@ -180,7 +180,7 @@ final class ConsequenceParams { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_recommend/lib/src/model/around_precision_from_value_inner.dart b/packages/client_search/lib/src/model/range.dart similarity index 63% rename from packages/client_recommend/lib/src/model/around_precision_from_value_inner.dart rename to packages/client_search/lib/src/model/range.dart index b426c87..029577a 100644 --- a/packages/client_recommend/lib/src/model/around_precision_from_value_inner.dart +++ b/packages/client_search/lib/src/model/range.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'around_precision_from_value_inner.g.dart'; +part 'range.g.dart'; @JsonSerializable() -final class AroundPrecisionFromValueInner { - /// Returns a new [AroundPrecisionFromValueInner] instance. - const AroundPrecisionFromValueInner({ +final class Range { + /// Returns a new [Range] instance. + const Range({ this.from, this.value, }); @@ -24,17 +24,14 @@ final class AroundPrecisionFromValueInner { @override bool operator ==(Object other) => identical(this, other) || - other is AroundPrecisionFromValueInner && - other.from == from && - other.value == value; + other is Range && other.from == from && other.value == value; @override int get hashCode => from.hashCode + value.hashCode; - factory AroundPrecisionFromValueInner.fromJson(Map json) => - _$AroundPrecisionFromValueInnerFromJson(json); + factory Range.fromJson(Map json) => _$RangeFromJson(json); - Map toJson() => _$AroundPrecisionFromValueInnerToJson(this); + Map toJson() => _$RangeToJson(this); @override String toString() { diff --git a/packages/client_search/lib/src/model/around_precision_from_value_inner.g.dart b/packages/client_search/lib/src/model/range.g.dart similarity index 65% rename from packages/client_search/lib/src/model/around_precision_from_value_inner.g.dart rename to packages/client_search/lib/src/model/range.g.dart index 026e055..223e9bd 100644 --- a/packages/client_search/lib/src/model/around_precision_from_value_inner.g.dart +++ b/packages/client_search/lib/src/model/range.g.dart @@ -1,18 +1,16 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'around_precision_from_value_inner.dart'; +part of 'range.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( - Map json) => - $checkedCreate( - 'AroundPrecisionFromValueInner', +Range _$RangeFromJson(Map json) => $checkedCreate( + 'Range', json, ($checkedConvert) { - final val = AroundPrecisionFromValueInner( + final val = Range( from: $checkedConvert('from', (v) => (v as num?)?.toInt()), value: $checkedConvert('value', (v) => (v as num?)?.toInt()), ); @@ -20,8 +18,7 @@ AroundPrecisionFromValueInner _$AroundPrecisionFromValueInnerFromJson( }, ); -Map _$AroundPrecisionFromValueInnerToJson( - AroundPrecisionFromValueInner instance) { +Map _$RangeToJson(Range instance) { final val = {}; void writeNotNull(String key, dynamic value) { diff --git a/packages/client_search/lib/src/model/redirect_rule_index_metadata_data.dart b/packages/client_search/lib/src/model/redirect_rule_index_data.dart similarity index 54% rename from packages/client_search/lib/src/model/redirect_rule_index_metadata_data.dart rename to packages/client_search/lib/src/model/redirect_rule_index_data.dart index f9bba71..55f0f0e 100644 --- a/packages/client_search/lib/src/model/redirect_rule_index_metadata_data.dart +++ b/packages/client_search/lib/src/model/redirect_rule_index_data.dart @@ -3,12 +3,12 @@ import 'package:json_annotation/json_annotation.dart'; -part 'redirect_rule_index_metadata_data.g.dart'; +part 'redirect_rule_index_data.g.dart'; @JsonSerializable() -final class RedirectRuleIndexMetadataData { - /// Returns a new [RedirectRuleIndexMetadataData] instance. - const RedirectRuleIndexMetadataData({ +final class RedirectRuleIndexData { + /// Returns a new [RedirectRuleIndexData] instance. + const RedirectRuleIndexData({ required this.ruleObjectID, }); @@ -18,16 +18,15 @@ final class RedirectRuleIndexMetadataData { @override bool operator ==(Object other) => identical(this, other) || - other is RedirectRuleIndexMetadataData && - other.ruleObjectID == ruleObjectID; + other is RedirectRuleIndexData && other.ruleObjectID == ruleObjectID; @override int get hashCode => ruleObjectID.hashCode; - factory RedirectRuleIndexMetadataData.fromJson(Map json) => - _$RedirectRuleIndexMetadataDataFromJson(json); + factory RedirectRuleIndexData.fromJson(Map json) => + _$RedirectRuleIndexDataFromJson(json); - Map toJson() => _$RedirectRuleIndexMetadataDataToJson(this); + Map toJson() => _$RedirectRuleIndexDataToJson(this); @override String toString() { diff --git a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.g.dart b/packages/client_search/lib/src/model/redirect_rule_index_data.g.dart similarity index 62% rename from packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.g.dart rename to packages/client_search/lib/src/model/redirect_rule_index_data.g.dart index c994c4c..a038eb9 100644 --- a/packages/algoliasearch/lib/src/model/redirect_rule_index_metadata_data.g.dart +++ b/packages/client_search/lib/src/model/redirect_rule_index_data.g.dart @@ -1,26 +1,26 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'redirect_rule_index_metadata_data.dart'; +part of 'redirect_rule_index_data.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -RedirectRuleIndexMetadataData _$RedirectRuleIndexMetadataDataFromJson( +RedirectRuleIndexData _$RedirectRuleIndexDataFromJson( Map json) => $checkedCreate( - 'RedirectRuleIndexMetadataData', + 'RedirectRuleIndexData', json, ($checkedConvert) { - final val = RedirectRuleIndexMetadataData( + final val = RedirectRuleIndexData( ruleObjectID: $checkedConvert('ruleObjectID', (v) => v as String), ); return val; }, ); -Map _$RedirectRuleIndexMetadataDataToJson( - RedirectRuleIndexMetadataData instance) => +Map _$RedirectRuleIndexDataToJson( + RedirectRuleIndexData instance) => { 'ruleObjectID': instance.ruleObjectID, }; diff --git a/packages/client_search/lib/src/model/redirect_rule_index_metadata.dart b/packages/client_search/lib/src/model/redirect_rule_index_metadata.dart index eb89fdb..9df7eb0 100644 --- a/packages/client_search/lib/src/model/redirect_rule_index_metadata.dart +++ b/packages/client_search/lib/src/model/redirect_rule_index_metadata.dart @@ -1,6 +1,6 @@ // 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:algolia_client_search/src/model/redirect_rule_index_metadata_data.dart'; +import 'package:algolia_client_search/src/model/redirect_rule_index_data.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -34,7 +34,7 @@ final class RedirectRuleIndexMetadata { final bool succeed; @JsonKey(name: r'data') - final RedirectRuleIndexMetadataData data; + final RedirectRuleIndexData data; @override bool operator ==(Object other) => diff --git a/packages/client_search/lib/src/model/redirect_rule_index_metadata.g.dart b/packages/client_search/lib/src/model/redirect_rule_index_metadata.g.dart index d2e1897..91cb7e5 100644 --- a/packages/client_search/lib/src/model/redirect_rule_index_metadata.g.dart +++ b/packages/client_search/lib/src/model/redirect_rule_index_metadata.g.dart @@ -17,10 +17,8 @@ RedirectRuleIndexMetadata _$RedirectRuleIndexMetadataFromJson( dest: $checkedConvert('dest', (v) => v as String), reason: $checkedConvert('reason', (v) => v as String), succeed: $checkedConvert('succeed', (v) => v as bool), - data: $checkedConvert( - 'data', - (v) => RedirectRuleIndexMetadataData.fromJson( - v as Map)), + data: $checkedConvert('data', + (v) => RedirectRuleIndexData.fromJson(v as Map)), ); return val; }, diff --git a/packages/client_search/lib/src/model/search_for_facets.dart b/packages/client_search/lib/src/model/search_for_facets.dart index 4c1768f..8ef7649 100644 --- a/packages/client_search/lib/src/model/search_for_facets.dart +++ b/packages/client_search/lib/src/model/search_for_facets.dart @@ -192,7 +192,7 @@ final class SearchForFacets { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/search_for_hits.dart b/packages/client_search/lib/src/model/search_for_hits.dart index c36b8e3..4b4c4ce 100644 --- a/packages/client_search/lib/src/model/search_for_hits.dart +++ b/packages/client_search/lib/src/model/search_for_hits.dart @@ -190,7 +190,7 @@ final class SearchForHits { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision; diff --git a/packages/client_search/lib/src/model/search_params_object.dart b/packages/client_search/lib/src/model/search_params_object.dart index 90a9507..92c5683 100644 --- a/packages/client_search/lib/src/model/search_params_object.dart +++ b/packages/client_search/lib/src/model/search_params_object.dart @@ -182,7 +182,7 @@ final class SearchParamsObject { final dynamic aroundRadius; /// One of types: - /// - [List] + /// - [List] /// - [int] @JsonKey(name: r'aroundPrecision') final dynamic aroundPrecision;