Skip to content

Commit 14b7e61

Browse files
feat(specs): update transformation specs for no-code (generated)
algolia/api-clients-automation#4901 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Mehmet Ali Gok <[email protected]>
1 parent b2e65fc commit 14b7e61

File tree

7 files changed

+502
-11
lines changed

7 files changed

+502
-11
lines changed

algoliasearch/Models/Ingestion/Transformation.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ namespace Algolia.Search.Models.Ingestion;
1616
/// </summary>
1717
public partial class Transformation
1818
{
19+
/// <summary>
20+
/// Gets or Sets Type
21+
/// </summary>
22+
[JsonPropertyName("type")]
23+
public TransformationType? Type { get; set; }
24+
1925
/// <summary>
2026
/// Initializes a new instance of the Transformation class.
2127
/// </summary>
@@ -26,7 +32,7 @@ public Transformation() { }
2632
/// Initializes a new instance of the Transformation class.
2733
/// </summary>
2834
/// <param name="transformationID">Universally unique identifier (UUID) of a transformation. (required).</param>
29-
/// <param name="code">The source code of the transformation. (required).</param>
35+
/// <param name="code">It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code. (required).</param>
3036
/// <param name="name">The uniquely identified name of your transformation. (required).</param>
3137
/// <param name="createdAt">Date of creation in RFC 3339 format. (required).</param>
3238
/// <param name="updatedAt">Date of last update in RFC 3339 format. (required).</param>
@@ -61,12 +67,19 @@ string updatedAt
6167
public List<string> AuthenticationIDs { get; set; }
6268

6369
/// <summary>
64-
/// The source code of the transformation.
70+
/// It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
6571
/// </summary>
66-
/// <value>The source code of the transformation.</value>
72+
/// <value>It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.</value>
6773
[JsonPropertyName("code")]
74+
[Obsolete]
6875
public string Code { get; set; }
6976

77+
/// <summary>
78+
/// Gets or Sets Input
79+
/// </summary>
80+
[JsonPropertyName("input")]
81+
public TransformationInput Input { get; set; }
82+
7083
/// <summary>
7184
/// The uniquely identified name of your transformation.
7285
/// </summary>
@@ -113,6 +126,8 @@ public override string ToString()
113126
sb.Append(" TransformationID: ").Append(TransformationID).Append("\n");
114127
sb.Append(" AuthenticationIDs: ").Append(AuthenticationIDs).Append("\n");
115128
sb.Append(" Code: ").Append(Code).Append("\n");
129+
sb.Append(" Type: ").Append(Type).Append("\n");
130+
sb.Append(" Input: ").Append(Input).Append("\n");
116131
sb.Append(" Name: ").Append(Name).Append("\n");
117132
sb.Append(" Description: ").Append(Description).Append("\n");
118133
sb.Append(" Owner: ").Append(Owner).Append("\n");
@@ -154,6 +169,8 @@ public override bool Equals(object obj)
154169
&& AuthenticationIDs.SequenceEqual(input.AuthenticationIDs)
155170
)
156171
&& (Code == input.Code || (Code != null && Code.Equals(input.Code)))
172+
&& (Type == input.Type || Type.Equals(input.Type))
173+
&& (Input == input.Input || (Input != null && Input.Equals(input.Input)))
157174
&& (Name == input.Name || (Name != null && Name.Equals(input.Name)))
158175
&& (
159176
Description == input.Description
@@ -185,6 +202,11 @@ public override int GetHashCode()
185202
{
186203
hashCode = (hashCode * 59) + Code.GetHashCode();
187204
}
205+
hashCode = (hashCode * 59) + Type.GetHashCode();
206+
if (Input != null)
207+
{
208+
hashCode = (hashCode * 59) + Input.GetHashCode();
209+
}
188210
if (Name != null)
189211
{
190212
hashCode = (hashCode * 59) + Name.GetHashCode();
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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.Ingestion;
13+
14+
/// <summary>
15+
/// Input for a transformation that contains the source code of the transformation.
16+
/// </summary>
17+
public partial class TransformationCode
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the TransformationCode class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public TransformationCode() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the TransformationCode class.
27+
/// </summary>
28+
/// <param name="code">The source code of the transformation. (required).</param>
29+
public TransformationCode(string code)
30+
{
31+
Code = code ?? throw new ArgumentNullException(nameof(code));
32+
}
33+
34+
/// <summary>
35+
/// The source code of the transformation.
36+
/// </summary>
37+
/// <value>The source code of the transformation.</value>
38+
[JsonPropertyName("code")]
39+
public string Code { 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 TransformationCode {\n");
49+
sb.Append(" Code: ").Append(Code).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 TransformationCode input)
71+
{
72+
return false;
73+
}
74+
75+
return (Code == input.Code || (Code != null && Code.Equals(input.Code)));
76+
}
77+
78+
/// <summary>
79+
/// Gets the hash code
80+
/// </summary>
81+
/// <returns>Hash code</returns>
82+
public override int GetHashCode()
83+
{
84+
unchecked // Overflow is fine, just wrap
85+
{
86+
int hashCode = 41;
87+
if (Code != null)
88+
{
89+
hashCode = (hashCode * 59) + Code.GetHashCode();
90+
}
91+
return hashCode;
92+
}
93+
}
94+
}

algoliasearch/Models/Ingestion/TransformationCreate.cs

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ namespace Algolia.Search.Models.Ingestion;
1616
/// </summary>
1717
public partial class TransformationCreate
1818
{
19+
/// <summary>
20+
/// Gets or Sets Type
21+
/// </summary>
22+
[JsonPropertyName("type")]
23+
public TransformationType? Type { get; set; }
24+
1925
/// <summary>
2026
/// Initializes a new instance of the TransformationCreate class.
2127
/// </summary>
@@ -25,19 +31,22 @@ public TransformationCreate() { }
2531
/// <summary>
2632
/// Initializes a new instance of the TransformationCreate class.
2733
/// </summary>
28-
/// <param name="code">The source code of the transformation. (required).</param>
2934
/// <param name="name">The uniquely identified name of your transformation. (required).</param>
30-
public TransformationCreate(string code, string name)
35+
/// <param name="type">type (required).</param>
36+
/// <param name="input">input (required).</param>
37+
public TransformationCreate(string name, TransformationType? type, TransformationInput input)
3138
{
32-
Code = code ?? throw new ArgumentNullException(nameof(code));
3339
Name = name ?? throw new ArgumentNullException(nameof(name));
40+
Type = type;
41+
Input = input ?? throw new ArgumentNullException(nameof(input));
3442
}
3543

3644
/// <summary>
37-
/// The source code of the transformation.
45+
/// It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
3846
/// </summary>
39-
/// <value>The source code of the transformation.</value>
47+
/// <value>It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.</value>
4048
[JsonPropertyName("code")]
49+
[Obsolete]
4150
public string Code { get; set; }
4251

4352
/// <summary>
@@ -47,6 +56,12 @@ public TransformationCreate(string code, string name)
4756
[JsonPropertyName("name")]
4857
public string Name { get; set; }
4958

59+
/// <summary>
60+
/// Gets or Sets Input
61+
/// </summary>
62+
[JsonPropertyName("input")]
63+
public TransformationInput Input { get; set; }
64+
5065
/// <summary>
5166
/// A descriptive name for your transformation of what it does.
5267
/// </summary>
@@ -71,6 +86,8 @@ public override string ToString()
7186
sb.Append("class TransformationCreate {\n");
7287
sb.Append(" Code: ").Append(Code).Append("\n");
7388
sb.Append(" Name: ").Append(Name).Append("\n");
89+
sb.Append(" Type: ").Append(Type).Append("\n");
90+
sb.Append(" Input: ").Append(Input).Append("\n");
7491
sb.Append(" Description: ").Append(Description).Append("\n");
7592
sb.Append(" AuthenticationIDs: ").Append(AuthenticationIDs).Append("\n");
7693
sb.Append("}\n");
@@ -100,6 +117,8 @@ public override bool Equals(object obj)
100117

101118
return (Code == input.Code || (Code != null && Code.Equals(input.Code)))
102119
&& (Name == input.Name || (Name != null && Name.Equals(input.Name)))
120+
&& (Type == input.Type || Type.Equals(input.Type))
121+
&& (Input == input.Input || (Input != null && Input.Equals(input.Input)))
103122
&& (
104123
Description == input.Description
105124
|| (Description != null && Description.Equals(input.Description))
@@ -129,6 +148,11 @@ public override int GetHashCode()
129148
{
130149
hashCode = (hashCode * 59) + Name.GetHashCode();
131150
}
151+
hashCode = (hashCode * 59) + Type.GetHashCode();
152+
if (Input != null)
153+
{
154+
hashCode = (hashCode * 59) + Input.GetHashCode();
155+
}
132156
if (Description != null)
133157
{
134158
hashCode = (hashCode * 59) + Description.GetHashCode();

0 commit comments

Comments
 (0)