From 4d28633432481944c979b711f433dceecc0a18bc Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Tue, 26 Nov 2024 17:15:39 +0000 Subject: [PATCH] fix(specs): `saveRule` response type [skip-bc] (generated) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/algolia/api-clients-automation/pull/4170 Co-authored-by: algolia-bot Co-authored-by: Clément Vannicatte --- .../lib/algolia_client_search.dart | 1 - .../lib/src/api/search_client.dart | 7 ++- .../client_search/lib/src/deserialize.dart | 4 -- .../lib/src/model/updated_rule_response.dart | 49 ------------------- .../src/model/updated_rule_response.g.dart | 29 ----------- 5 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 packages/client_search/lib/src/model/updated_rule_response.dart delete mode 100644 packages/client_search/lib/src/model/updated_rule_response.g.dart diff --git a/packages/client_search/lib/algolia_client_search.dart b/packages/client_search/lib/algolia_client_search.dart index 37a46c1..09b195a 100644 --- a/packages/client_search/lib/algolia_client_search.dart +++ b/packages/client_search/lib/algolia_client_search.dart @@ -155,7 +155,6 @@ export 'src/model/typo_tolerance_enum.dart'; export 'src/model/update_api_key_response.dart'; export 'src/model/updated_at_response.dart'; export 'src/model/updated_at_with_object_id_response.dart'; -export 'src/model/updated_rule_response.dart'; export 'src/model/user_highlight_result.dart'; export 'src/model/user_hit.dart'; export 'src/model/user_id.dart'; diff --git a/packages/client_search/lib/src/api/search_client.dart b/packages/client_search/lib/src/api/search_client.dart index 6e2ac16..942d282 100644 --- a/packages/client_search/lib/src/api/search_client.dart +++ b/packages/client_search/lib/src/api/search_client.dart @@ -62,7 +62,6 @@ import 'package:algolia_client_search/src/model/synonym_hit.dart'; import 'package:algolia_client_search/src/model/update_api_key_response.dart'; import 'package:algolia_client_search/src/model/updated_at_response.dart'; import 'package:algolia_client_search/src/model/updated_at_with_object_id_response.dart'; -import 'package:algolia_client_search/src/model/updated_rule_response.dart'; import 'package:algolia_client_search/src/model/user_id.dart'; final class SearchClient implements ApiClient { @@ -1770,7 +1769,7 @@ final class SearchClient implements ApiClient { /// * [rule] /// * [forwardToReplicas] Whether changes are applied to replica indices. /// * [requestOptions] additional request configuration. - Future saveRule({ + Future saveRule({ required String indexName, required String objectID, required Rule rule, @@ -1801,9 +1800,9 @@ final class SearchClient implements ApiClient { request: request, options: requestOptions, ); - return deserialize( + return deserialize( response, - 'UpdatedRuleResponse', + 'UpdatedAtResponse', growable: true, ); } diff --git a/packages/client_search/lib/src/deserialize.dart b/packages/client_search/lib/src/deserialize.dart index 2fd8b33..de2e527 100644 --- a/packages/client_search/lib/src/deserialize.dart +++ b/packages/client_search/lib/src/deserialize.dart @@ -148,7 +148,6 @@ import 'package:algolia_client_search/src/model/typo_tolerance_enum.dart'; import 'package:algolia_client_search/src/model/update_api_key_response.dart'; import 'package:algolia_client_search/src/model/updated_at_response.dart'; import 'package:algolia_client_search/src/model/updated_at_with_object_id_response.dart'; -import 'package:algolia_client_search/src/model/updated_rule_response.dart'; import 'package:algolia_client_search/src/model/user_highlight_result.dart'; import 'package:algolia_client_search/src/model/user_hit.dart'; import 'package:algolia_client_search/src/model/user_id.dart'; @@ -565,9 +564,6 @@ ReturnType deserialize(dynamic value, String targetType, case 'UpdatedAtWithObjectIdResponse': return UpdatedAtWithObjectIdResponse.fromJson( value as Map) as ReturnType; - case 'UpdatedRuleResponse': - return UpdatedRuleResponse.fromJson(value as Map) - as ReturnType; case 'UserHighlightResult': return UserHighlightResult.fromJson(value as Map) as ReturnType; diff --git a/packages/client_search/lib/src/model/updated_rule_response.dart b/packages/client_search/lib/src/model/updated_rule_response.dart deleted file mode 100644 index 092a6ec..0000000 --- a/packages/client_search/lib/src/model/updated_rule_response.dart +++ /dev/null @@ -1,49 +0,0 @@ -// 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:json_annotation/json_annotation.dart'; - -part 'updated_rule_response.g.dart'; - -@JsonSerializable() -final class UpdatedRuleResponse { - /// Returns a new [UpdatedRuleResponse] instance. - const UpdatedRuleResponse({ - required this.objectID, - required this.updatedAt, - required this.taskID, - }); - - /// Unique identifier of a rule object. - @JsonKey(name: r'objectID') - final String objectID; - - /// Date and time when the object was updated, in RFC 3339 format. - @JsonKey(name: r'updatedAt') - final String updatedAt; - - /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`. - @JsonKey(name: r'taskID') - final int taskID; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is UpdatedRuleResponse && - other.objectID == objectID && - other.updatedAt == updatedAt && - other.taskID == taskID; - - @override - int get hashCode => objectID.hashCode + updatedAt.hashCode + taskID.hashCode; - - factory UpdatedRuleResponse.fromJson(Map json) => - _$UpdatedRuleResponseFromJson(json); - - Map toJson() => _$UpdatedRuleResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/packages/client_search/lib/src/model/updated_rule_response.g.dart b/packages/client_search/lib/src/model/updated_rule_response.g.dart deleted file mode 100644 index 16e4801..0000000 --- a/packages/client_search/lib/src/model/updated_rule_response.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'updated_rule_response.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -UpdatedRuleResponse _$UpdatedRuleResponseFromJson(Map json) => - $checkedCreate( - 'UpdatedRuleResponse', - json, - ($checkedConvert) { - final val = UpdatedRuleResponse( - objectID: $checkedConvert('objectID', (v) => v as String), - updatedAt: $checkedConvert('updatedAt', (v) => v as String), - taskID: $checkedConvert('taskID', (v) => (v as num).toInt()), - ); - return val; - }, - ); - -Map _$UpdatedRuleResponseToJson( - UpdatedRuleResponse instance) => - { - 'objectID': instance.objectID, - 'updatedAt': instance.updatedAt, - 'taskID': instance.taskID, - };