Skip to content

Commit fc9a66d

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 3f2c8a0 commit fc9a66d

File tree

2 files changed

+130
-13
lines changed

2 files changed

+130
-13
lines changed

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+
}

0 commit comments

Comments
 (0)