Skip to content

Commit 746ad29

Browse files
feat(specs): introduce multifeed composition behavior for beta release (#5828) (generated) [skip ci]
Co-authored-by: Gavin Wade <gavin.wade12@gmail.com>
1 parent f9ac3a7 commit 746ad29

File tree

38 files changed

+2615
-1048
lines changed

38 files changed

+2615
-1048
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Composition/CompositionBehavior.cs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,27 @@
1212
namespace Algolia.Search.Models.Composition;
1313

1414
/// <summary>
15-
/// CompositionBehavior
15+
/// An object containing either an `injection` or `multifeed` behavior schema, but not both.
1616
/// </summary>
1717
public partial class CompositionBehavior
1818
{
1919
/// <summary>
2020
/// Initializes a new instance of the CompositionBehavior class.
2121
/// </summary>
22-
[JsonConstructor]
2322
public CompositionBehavior() { }
2423

25-
/// <summary>
26-
/// Initializes a new instance of the CompositionBehavior class.
27-
/// </summary>
28-
/// <param name="injection">injection (required).</param>
29-
public CompositionBehavior(Injection injection)
30-
{
31-
Injection = injection ?? throw new ArgumentNullException(nameof(injection));
32-
}
33-
3424
/// <summary>
3525
/// Gets or Sets Injection
3626
/// </summary>
3727
[JsonPropertyName("injection")]
3828
public Injection Injection { get; set; }
3929

30+
/// <summary>
31+
/// Gets or Sets Multifeed
32+
/// </summary>
33+
[JsonPropertyName("multifeed")]
34+
public Multifeed Multifeed { get; set; }
35+
4036
/// <summary>
4137
/// Returns the string presentation of the object
4238
/// </summary>
@@ -46,6 +42,7 @@ public override string ToString()
4642
StringBuilder sb = new StringBuilder();
4743
sb.Append("class CompositionBehavior {\n");
4844
sb.Append(" Injection: ").Append(Injection).Append("\n");
45+
sb.Append(" Multifeed: ").Append(Multifeed).Append("\n");
4946
sb.Append("}\n");
5047
return sb.ToString();
5148
}
@@ -72,8 +69,9 @@ public override bool Equals(object obj)
7269
}
7370

7471
return (
75-
Injection == input.Injection || (Injection != null && Injection.Equals(input.Injection))
76-
);
72+
Injection == input.Injection || (Injection != null && Injection.Equals(input.Injection))
73+
)
74+
&& (Multifeed == input.Multifeed || (Multifeed != null && Multifeed.Equals(input.Multifeed)));
7775
}
7876

7977
/// <summary>
@@ -89,6 +87,10 @@ public override int GetHashCode()
8987
{
9088
hashCode = (hashCode * 59) + Injection.GetHashCode();
9189
}
90+
if (Multifeed != null)
91+
{
92+
hashCode = (hashCode * 59) + Multifeed.GetHashCode();
93+
}
9294
return hashCode;
9395
}
9496
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
//
2+
// 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.
3+
//
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Text.Json;
9+
using System.Text.Json.Serialization;
10+
using Algolia.Search.Serializer;
11+
12+
namespace Algolia.Search.Models.Composition;
13+
14+
/// <summary>
15+
/// Multifeed
16+
/// </summary>
17+
public partial class Multifeed
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the Multifeed class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public Multifeed() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the Multifeed class.
27+
/// </summary>
28+
/// <param name="feeds">A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection. (required).</param>
29+
public Multifeed(Dictionary<string, Injection> feeds)
30+
{
31+
Feeds = feeds ?? throw new ArgumentNullException(nameof(feeds));
32+
}
33+
34+
/// <summary>
35+
/// A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.
36+
/// </summary>
37+
/// <value>A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.</value>
38+
[JsonPropertyName("feeds")]
39+
public Dictionary<string, Injection> Feeds { get; set; }
40+
41+
/// <summary>
42+
/// 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.
43+
/// </summary>
44+
/// <value>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.</value>
45+
[JsonPropertyName("feedsOrder")]
46+
public List<string> FeedsOrder { get; set; }
47+
48+
/// <summary>
49+
/// Returns the string presentation of the object
50+
/// </summary>
51+
/// <returns>String presentation of the object</returns>
52+
public override string ToString()
53+
{
54+
StringBuilder sb = new StringBuilder();
55+
sb.Append("class Multifeed {\n");
56+
sb.Append(" Feeds: ").Append(Feeds).Append("\n");
57+
sb.Append(" FeedsOrder: ").Append(FeedsOrder).Append("\n");
58+
sb.Append("}\n");
59+
return sb.ToString();
60+
}
61+
62+
/// <summary>
63+
/// Returns the JSON string presentation of the object
64+
/// </summary>
65+
/// <returns>JSON string presentation of the object</returns>
66+
public virtual string ToJson()
67+
{
68+
return JsonSerializer.Serialize(this, JsonConfig.Options);
69+
}
70+
71+
/// <summary>
72+
/// Returns true if objects are equal
73+
/// </summary>
74+
/// <param name="obj">Object to be compared</param>
75+
/// <returns>Boolean</returns>
76+
public override bool Equals(object obj)
77+
{
78+
if (obj is not Multifeed input)
79+
{
80+
return false;
81+
}
82+
83+
return (
84+
Feeds == input.Feeds
85+
|| Feeds != null && input.Feeds != null && Feeds.SequenceEqual(input.Feeds)
86+
)
87+
&& (
88+
FeedsOrder == input.FeedsOrder
89+
|| FeedsOrder != null
90+
&& input.FeedsOrder != null
91+
&& FeedsOrder.SequenceEqual(input.FeedsOrder)
92+
);
93+
}
94+
95+
/// <summary>
96+
/// Gets the hash code
97+
/// </summary>
98+
/// <returns>Hash code</returns>
99+
public override int GetHashCode()
100+
{
101+
unchecked // Overflow is fine, just wrap
102+
{
103+
int hashCode = 41;
104+
if (Feeds != null)
105+
{
106+
hashCode = (hashCode * 59) + Feeds.GetHashCode();
107+
}
108+
if (FeedsOrder != null)
109+
{
110+
hashCode = (hashCode * 59) + FeedsOrder.GetHashCode();
111+
}
112+
return hashCode;
113+
}
114+
}
115+
}

clients/algoliasearch-client-dart/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';

clients/algoliasearch-client-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;

clients/algoliasearch-client-dart/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);

clients/algoliasearch-client-dart/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+
}

clients/algoliasearch-client-dart/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)