Skip to content

Commit c152637

Browse files
feat(specs): add with transformation helpers (generated)
algolia/api-clients-automation#4931 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 4acbee1 commit c152637

File tree

5 files changed

+450
-6
lines changed

5 files changed

+450
-6
lines changed

algoliasearch/Models/Ingestion/WatchResponse.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ public WatchResponse(string runID)
4646
public string EventID { get; set; }
4747

4848
/// <summary>
49-
/// when used with discovering or validating sources, the sampled data of your source is returned.
49+
/// This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source.
5050
/// </summary>
51-
/// <value>when used with discovering or validating sources, the sampled data of your source is returned.</value>
51+
/// <value>This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source. </value>
5252
[JsonPropertyName("data")]
5353
public List<object> Data { get; set; }
5454

5555
/// <summary>
56-
/// in case of error, observability events will be added to the response, if any.
56+
/// in case of error, observability events will be added to the response.
5757
/// </summary>
58-
/// <value>in case of error, observability events will be added to the response, if any.</value>
58+
/// <value>in case of error, observability events will be added to the response.</value>
5959
[JsonPropertyName("events")]
6060
public List<Event> Events { get; set; }
6161

6262
/// <summary>
63-
/// a message describing the outcome of a validate run.
63+
/// a message describing the outcome of the operation that has been ran (push, discover or validate) run.
6464
/// </summary>
65-
/// <value>a message describing the outcome of a validate run.</value>
65+
/// <value>a message describing the outcome of the operation that has been ran (push, discover or validate) run.</value>
6666
[JsonPropertyName("message")]
6767
public string Message { get; set; }
6868

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
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+
/// An event describe a step of the task execution flow..
16+
/// </summary>
17+
public partial class Event
18+
{
19+
/// <summary>
20+
/// Gets or Sets Status
21+
/// </summary>
22+
[JsonPropertyName("status")]
23+
public EventStatus? Status { get; set; }
24+
25+
/// <summary>
26+
/// Gets or Sets Type
27+
/// </summary>
28+
[JsonPropertyName("type")]
29+
public EventType? Type { get; set; }
30+
31+
/// <summary>
32+
/// Initializes a new instance of the Event class.
33+
/// </summary>
34+
[JsonConstructor]
35+
public Event() { }
36+
37+
/// <summary>
38+
/// Initializes a new instance of the Event class.
39+
/// </summary>
40+
/// <param name="eventID">Universally unique identifier (UUID) of an event. (required).</param>
41+
/// <param name="runID">Universally unique identifier (UUID) of a task run. (required).</param>
42+
/// <param name="status">status (required).</param>
43+
/// <param name="type">type (required).</param>
44+
/// <param name="batchSize">The extracted record batch size. (required).</param>
45+
/// <param name="publishedAt">Date of publish RFC 3339 format. (required).</param>
46+
public Event(
47+
string eventID,
48+
string runID,
49+
EventStatus? status,
50+
EventType? type,
51+
int batchSize,
52+
string publishedAt
53+
)
54+
{
55+
EventID = eventID ?? throw new ArgumentNullException(nameof(eventID));
56+
RunID = runID ?? throw new ArgumentNullException(nameof(runID));
57+
Status = status;
58+
Type = type;
59+
BatchSize = batchSize;
60+
PublishedAt = publishedAt ?? throw new ArgumentNullException(nameof(publishedAt));
61+
}
62+
63+
/// <summary>
64+
/// Universally unique identifier (UUID) of an event.
65+
/// </summary>
66+
/// <value>Universally unique identifier (UUID) of an event.</value>
67+
[JsonPropertyName("eventID")]
68+
public string EventID { get; set; }
69+
70+
/// <summary>
71+
/// Universally unique identifier (UUID) of a task run.
72+
/// </summary>
73+
/// <value>Universally unique identifier (UUID) of a task run.</value>
74+
[JsonPropertyName("runID")]
75+
public string RunID { get; set; }
76+
77+
/// <summary>
78+
/// The extracted record batch size.
79+
/// </summary>
80+
/// <value>The extracted record batch size.</value>
81+
[JsonPropertyName("batchSize")]
82+
public int BatchSize { get; set; }
83+
84+
/// <summary>
85+
/// Gets or Sets Data
86+
/// </summary>
87+
[JsonPropertyName("data")]
88+
public Dictionary<string, object> Data { get; set; }
89+
90+
/// <summary>
91+
/// Date of publish RFC 3339 format.
92+
/// </summary>
93+
/// <value>Date of publish RFC 3339 format.</value>
94+
[JsonPropertyName("publishedAt")]
95+
public string PublishedAt { get; set; }
96+
97+
/// <summary>
98+
/// Returns the string presentation of the object
99+
/// </summary>
100+
/// <returns>String presentation of the object</returns>
101+
public override string ToString()
102+
{
103+
StringBuilder sb = new StringBuilder();
104+
sb.Append("class Event {\n");
105+
sb.Append(" EventID: ").Append(EventID).Append("\n");
106+
sb.Append(" RunID: ").Append(RunID).Append("\n");
107+
sb.Append(" Status: ").Append(Status).Append("\n");
108+
sb.Append(" Type: ").Append(Type).Append("\n");
109+
sb.Append(" BatchSize: ").Append(BatchSize).Append("\n");
110+
sb.Append(" Data: ").Append(Data).Append("\n");
111+
sb.Append(" PublishedAt: ").Append(PublishedAt).Append("\n");
112+
sb.Append("}\n");
113+
return sb.ToString();
114+
}
115+
116+
/// <summary>
117+
/// Returns the JSON string presentation of the object
118+
/// </summary>
119+
/// <returns>JSON string presentation of the object</returns>
120+
public virtual string ToJson()
121+
{
122+
return JsonSerializer.Serialize(this, JsonConfig.Options);
123+
}
124+
125+
/// <summary>
126+
/// Returns true if objects are equal
127+
/// </summary>
128+
/// <param name="obj">Object to be compared</param>
129+
/// <returns>Boolean</returns>
130+
public override bool Equals(object obj)
131+
{
132+
if (obj is not Event input)
133+
{
134+
return false;
135+
}
136+
137+
return (EventID == input.EventID || (EventID != null && EventID.Equals(input.EventID)))
138+
&& (RunID == input.RunID || (RunID != null && RunID.Equals(input.RunID)))
139+
&& (Status == input.Status || Status.Equals(input.Status))
140+
&& (Type == input.Type || Type.Equals(input.Type))
141+
&& (BatchSize == input.BatchSize || BatchSize.Equals(input.BatchSize))
142+
&& (
143+
Data == input.Data || Data != null && input.Data != null && Data.SequenceEqual(input.Data)
144+
)
145+
&& (
146+
PublishedAt == input.PublishedAt
147+
|| (PublishedAt != null && PublishedAt.Equals(input.PublishedAt))
148+
);
149+
}
150+
151+
/// <summary>
152+
/// Gets the hash code
153+
/// </summary>
154+
/// <returns>Hash code</returns>
155+
public override int GetHashCode()
156+
{
157+
unchecked // Overflow is fine, just wrap
158+
{
159+
int hashCode = 41;
160+
if (EventID != null)
161+
{
162+
hashCode = (hashCode * 59) + EventID.GetHashCode();
163+
}
164+
if (RunID != null)
165+
{
166+
hashCode = (hashCode * 59) + RunID.GetHashCode();
167+
}
168+
hashCode = (hashCode * 59) + Status.GetHashCode();
169+
hashCode = (hashCode * 59) + Type.GetHashCode();
170+
hashCode = (hashCode * 59) + BatchSize.GetHashCode();
171+
if (Data != null)
172+
{
173+
hashCode = (hashCode * 59) + Data.GetHashCode();
174+
}
175+
if (PublishedAt != null)
176+
{
177+
hashCode = (hashCode * 59) + PublishedAt.GetHashCode();
178+
}
179+
return hashCode;
180+
}
181+
}
182+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
/// Defines EventStatus
16+
/// </summary>
17+
[JsonConverter(typeof(Serializer.JsonStringEnumConverter<EventStatus>))]
18+
public enum EventStatus
19+
{
20+
/// <summary>
21+
/// Enum Created for value: created
22+
/// </summary>
23+
[JsonPropertyName("created")]
24+
Created = 1,
25+
26+
/// <summary>
27+
/// Enum Started for value: started
28+
/// </summary>
29+
[JsonPropertyName("started")]
30+
Started = 2,
31+
32+
/// <summary>
33+
/// Enum Retried for value: retried
34+
/// </summary>
35+
[JsonPropertyName("retried")]
36+
Retried = 3,
37+
38+
/// <summary>
39+
/// Enum Failed for value: failed
40+
/// </summary>
41+
[JsonPropertyName("failed")]
42+
Failed = 4,
43+
44+
/// <summary>
45+
/// Enum Succeeded for value: succeeded
46+
/// </summary>
47+
[JsonPropertyName("succeeded")]
48+
Succeeded = 5,
49+
50+
/// <summary>
51+
/// Enum Critical for value: critical
52+
/// </summary>
53+
[JsonPropertyName("critical")]
54+
Critical = 6,
55+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
/// Defines EventType
16+
/// </summary>
17+
[JsonConverter(typeof(Serializer.JsonStringEnumConverter<EventType>))]
18+
public enum EventType
19+
{
20+
/// <summary>
21+
/// Enum Fetch for value: fetch
22+
/// </summary>
23+
[JsonPropertyName("fetch")]
24+
Fetch = 1,
25+
26+
/// <summary>
27+
/// Enum Record for value: record
28+
/// </summary>
29+
[JsonPropertyName("record")]
30+
Record = 2,
31+
32+
/// <summary>
33+
/// Enum Log for value: log
34+
/// </summary>
35+
[JsonPropertyName("log")]
36+
Log = 3,
37+
38+
/// <summary>
39+
/// Enum Transform for value: transform
40+
/// </summary>
41+
[JsonPropertyName("transform")]
42+
Transform = 4,
43+
}

0 commit comments

Comments
 (0)