Skip to content

Commit c31bd0e

Browse files
algolia-botFluf22
andcommitted
fix(specs): add missing redirect property to rule consequence schema (generated)
algolia/api-clients-automation#5934 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent d729ab3 commit c31bd0e

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

algoliasearch/Models/Search/Consequence.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public Consequence() { }
4848
[JsonPropertyName("hide")]
4949
public List<ConsequenceHide> Hide { get; set; }
5050

51+
/// <summary>
52+
/// Gets or Sets Redirect
53+
/// </summary>
54+
[JsonPropertyName("redirect")]
55+
public ConsequenceRedirect Redirect { get; set; }
56+
5157
/// <summary>
5258
/// A JSON object with custom data that will be appended to the `userData` array in the response. This object isn't interpreted by the API and is limited to 1&nbsp;kB of minified JSON.
5359
/// </summary>
@@ -67,6 +73,7 @@ public override string ToString()
6773
sb.Append(" Promote: ").Append(Promote).Append("\n");
6874
sb.Append(" FilterPromotes: ").Append(FilterPromotes).Append("\n");
6975
sb.Append(" Hide: ").Append(Hide).Append("\n");
76+
sb.Append(" Redirect: ").Append(Redirect).Append("\n");
7077
sb.Append(" UserData: ").Append(UserData).Append("\n");
7178
sb.Append("}\n");
7279
return sb.ToString();
@@ -102,6 +109,7 @@ public override bool Equals(object obj)
102109
&& (
103110
Hide == input.Hide || Hide != null && input.Hide != null && Hide.SequenceEqual(input.Hide)
104111
)
112+
&& (Redirect == input.Redirect || (Redirect != null && Redirect.Equals(input.Redirect)))
105113
&& (UserData == input.UserData || (UserData != null && UserData.Equals(input.UserData)));
106114
}
107115

@@ -127,6 +135,10 @@ public override int GetHashCode()
127135
{
128136
hashCode = (hashCode * 59) + Hide.GetHashCode();
129137
}
138+
if (Redirect != null)
139+
{
140+
hashCode = (hashCode * 59) + Redirect.GetHashCode();
141+
}
130142
if (UserData != null)
131143
{
132144
hashCode = (hashCode * 59) + UserData.GetHashCode();
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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.Search;
13+
14+
/// <summary>
15+
/// Redirect to a virtual replica index. This consequence is only valid for rules with `scope: redirect`.
16+
/// </summary>
17+
public partial class ConsequenceRedirect
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the ConsequenceRedirect class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public ConsequenceRedirect() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the ConsequenceRedirect class.
27+
/// </summary>
28+
/// <param name="indexName">Name of the virtual replica index to redirect searches to. (required).</param>
29+
public ConsequenceRedirect(string indexName)
30+
{
31+
IndexName = indexName ?? throw new ArgumentNullException(nameof(indexName));
32+
}
33+
34+
/// <summary>
35+
/// Name of the virtual replica index to redirect searches to.
36+
/// </summary>
37+
/// <value>Name of the virtual replica index to redirect searches to.</value>
38+
[JsonPropertyName("indexName")]
39+
public string IndexName { get; set; }
40+
41+
/// <summary>
42+
/// Returns the string presentation of the object
43+
/// </summary>
44+
/// <returns>String presentation of the object</returns>
45+
public override string ToString()
46+
{
47+
StringBuilder sb = new StringBuilder();
48+
sb.Append("class ConsequenceRedirect {\n");
49+
sb.Append(" IndexName: ").Append(IndexName).Append("\n");
50+
sb.Append("}\n");
51+
return sb.ToString();
52+
}
53+
54+
/// <summary>
55+
/// Returns the JSON string presentation of the object
56+
/// </summary>
57+
/// <returns>JSON string presentation of the object</returns>
58+
public virtual string ToJson()
59+
{
60+
return JsonSerializer.Serialize(this, JsonConfig.Options);
61+
}
62+
63+
/// <summary>
64+
/// Returns true if objects are equal
65+
/// </summary>
66+
/// <param name="obj">Object to be compared</param>
67+
/// <returns>Boolean</returns>
68+
public override bool Equals(object obj)
69+
{
70+
if (obj is not ConsequenceRedirect input)
71+
{
72+
return false;
73+
}
74+
75+
return (
76+
IndexName == input.IndexName || (IndexName != null && IndexName.Equals(input.IndexName))
77+
);
78+
}
79+
80+
/// <summary>
81+
/// Gets the hash code
82+
/// </summary>
83+
/// <returns>Hash code</returns>
84+
public override int GetHashCode()
85+
{
86+
unchecked // Overflow is fine, just wrap
87+
{
88+
int hashCode = 41;
89+
if (IndexName != null)
90+
{
91+
hashCode = (hashCode * 59) + IndexName.GetHashCode();
92+
}
93+
return hashCode;
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)