Skip to content

Commit 2e87108

Browse files
algolia-botClaraMullerFluf22
committed
fix(specs): invalid API format for multi feed in Comp API (generated)
algolia/api-clients-automation#5993 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent d9a4b55 commit 2e87108

File tree

2 files changed

+97
-2
lines changed

2 files changed

+97
-2
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
/// Feed formatted as an injection.
16+
/// </summary>
17+
public partial class FeedInjection
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the FeedInjection class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public FeedInjection() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the FeedInjection class.
27+
/// </summary>
28+
/// <param name="injection">injection (required).</param>
29+
public FeedInjection(Injection injection)
30+
{
31+
Injection = injection ?? throw new ArgumentNullException(nameof(injection));
32+
}
33+
34+
/// <summary>
35+
/// Gets or Sets Injection
36+
/// </summary>
37+
[JsonPropertyName("injection")]
38+
public Injection Injection { get; set; }
39+
40+
/// <summary>
41+
/// Returns the string presentation of the object
42+
/// </summary>
43+
/// <returns>String presentation of the object</returns>
44+
public override string ToString()
45+
{
46+
StringBuilder sb = new StringBuilder();
47+
sb.Append("class FeedInjection {\n");
48+
sb.Append(" Injection: ").Append(Injection).Append("\n");
49+
sb.Append("}\n");
50+
return sb.ToString();
51+
}
52+
53+
/// <summary>
54+
/// Returns the JSON string presentation of the object
55+
/// </summary>
56+
/// <returns>JSON string presentation of the object</returns>
57+
public virtual string ToJson()
58+
{
59+
return JsonSerializer.Serialize(this, JsonConfig.Options);
60+
}
61+
62+
/// <summary>
63+
/// Returns true if objects are equal
64+
/// </summary>
65+
/// <param name="obj">Object to be compared</param>
66+
/// <returns>Boolean</returns>
67+
public override bool Equals(object obj)
68+
{
69+
if (obj is not FeedInjection input)
70+
{
71+
return false;
72+
}
73+
74+
return (
75+
Injection == input.Injection || (Injection != null && Injection.Equals(input.Injection))
76+
);
77+
}
78+
79+
/// <summary>
80+
/// Gets the hash code
81+
/// </summary>
82+
/// <returns>Hash code</returns>
83+
public override int GetHashCode()
84+
{
85+
unchecked // Overflow is fine, just wrap
86+
{
87+
int hashCode = 41;
88+
if (Injection != null)
89+
{
90+
hashCode = (hashCode * 59) + Injection.GetHashCode();
91+
}
92+
return hashCode;
93+
}
94+
}
95+
}

algoliasearch/Models/Composition/Multifeed.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Multifeed() { }
2626
/// Initializes a new instance of the Multifeed class.
2727
/// </summary>
2828
/// <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)
29+
public Multifeed(Dictionary<string, FeedInjection> feeds)
3030
{
3131
Feeds = feeds ?? throw new ArgumentNullException(nameof(feeds));
3232
}
@@ -36,7 +36,7 @@ public Multifeed(Dictionary<string, Injection> feeds)
3636
/// </summary>
3737
/// <value>A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.</value>
3838
[JsonPropertyName("feeds")]
39-
public Dictionary<string, Injection> Feeds { get; set; }
39+
public Dictionary<string, FeedInjection> Feeds { get; set; }
4040

4141
/// <summary>
4242
/// 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.

0 commit comments

Comments
 (0)