Skip to content

Commit e89c384

Browse files
feat(specs): introduce multifeed composition behavior for beta release (generated)
algolia/api-clients-automation#5828 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Gavin Wade <gavin.wade12@gmail.com>
1 parent bcfd4da commit e89c384

File tree

6 files changed

+122
-11
lines changed

6 files changed

+122
-11
lines changed

packages/client_composition/lib/algolia_client_composition.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export 'src/model/main.dart';
6262
export 'src/model/main_injection_query_parameters.dart';
6363
export 'src/model/match_level.dart';
6464
export 'src/model/matched_geo_location.dart';
65+
export 'src/model/multifeed.dart';
6566
export 'src/model/multiple_batch_request.dart';
6667
export 'src/model/multiple_batch_response.dart';
6768
export 'src/model/params.dart';

packages/client_composition/lib/src/deserialize.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import 'package:algolia_client_composition/src/model/main.dart';
5555
import 'package:algolia_client_composition/src/model/main_injection_query_parameters.dart';
5656
import 'package:algolia_client_composition/src/model/match_level.dart';
5757
import 'package:algolia_client_composition/src/model/matched_geo_location.dart';
58+
import 'package:algolia_client_composition/src/model/multifeed.dart';
5859
import 'package:algolia_client_composition/src/model/multiple_batch_request.dart';
5960
import 'package:algolia_client_composition/src/model/multiple_batch_response.dart';
6061
import 'package:algolia_client_composition/src/model/params.dart';
@@ -261,6 +262,8 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
261262
case 'MatchedGeoLocation':
262263
return MatchedGeoLocation.fromJson(value as Map<String, dynamic>)
263264
as ReturnType;
265+
case 'Multifeed':
266+
return Multifeed.fromJson(value as Map<String, dynamic>) as ReturnType;
264267
case 'MultipleBatchRequest':
265268
return MultipleBatchRequest.fromJson(value as Map<String, dynamic>)
266269
as ReturnType;

packages/client_composition/lib/src/model/composition_behavior.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// 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.
22
// ignore_for_file: unused_element
33
import 'package:algolia_client_composition/src/model/injection.dart';
4+
import 'package:algolia_client_composition/src/model/multifeed.dart';
45

56
import 'package:json_annotation/json_annotation.dart';
67

@@ -10,19 +11,25 @@ part 'composition_behavior.g.dart';
1011
final class CompositionBehavior {
1112
/// Returns a new [CompositionBehavior] instance.
1213
const CompositionBehavior({
13-
required this.injection,
14+
this.injection,
15+
this.multifeed,
1416
});
1517

1618
@JsonKey(name: r'injection')
17-
final Injection injection;
19+
final Injection? injection;
20+
21+
@JsonKey(name: r'multifeed')
22+
final Multifeed? multifeed;
1823

1924
@override
2025
bool operator ==(Object other) =>
2126
identical(this, other) ||
22-
other is CompositionBehavior && other.injection == injection;
27+
other is CompositionBehavior &&
28+
other.injection == injection &&
29+
other.multifeed == multifeed;
2330

2431
@override
25-
int get hashCode => injection.hashCode;
32+
int get hashCode => injection.hashCode + multifeed.hashCode;
2633

2734
factory CompositionBehavior.fromJson(Map<String, dynamic> json) =>
2835
_$CompositionBehaviorFromJson(json);

packages/client_composition/lib/src/model/composition_behavior.g.dart

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// 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.
2+
// ignore_for_file: unused_element
3+
import 'package:algolia_client_composition/src/model/injection.dart';
4+
5+
import 'package:json_annotation/json_annotation.dart';
6+
7+
part 'multifeed.g.dart';
8+
9+
@JsonSerializable()
10+
final class Multifeed {
11+
/// Returns a new [Multifeed] instance.
12+
const Multifeed({
13+
required this.feeds,
14+
this.feedsOrder,
15+
});
16+
17+
/// A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.
18+
@JsonKey(name: r'feeds')
19+
final Map<String, Injection> feeds;
20+
21+
/// A list of Feed IDs that specifies the order in which to order the results in the response. The IDs should be a subset of those in the Feeds object, and only those specified will be processed. When this field is not set, all Feeds are processed and returned with a default ordering.
22+
@JsonKey(name: r'feedsOrder')
23+
final List<String>? feedsOrder;
24+
25+
@override
26+
bool operator ==(Object other) =>
27+
identical(this, other) ||
28+
other is Multifeed &&
29+
other.feeds == feeds &&
30+
other.feedsOrder == feedsOrder;
31+
32+
@override
33+
int get hashCode => feeds.hashCode + feedsOrder.hashCode;
34+
35+
factory Multifeed.fromJson(Map<String, dynamic> json) =>
36+
_$MultifeedFromJson(json);
37+
38+
Map<String, dynamic> toJson() => _$MultifeedToJson(this);
39+
40+
@override
41+
String toString() {
42+
return toJson().toString();
43+
}
44+
}

packages/client_composition/lib/src/model/multifeed.g.dart

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)