Skip to content

Commit 6cd90b0

Browse files
feat(specs): document runMetadata parameter (generated)
algolia/api-clients-automation#5087 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Devin Beeuwkes <[email protected]>
1 parent d145212 commit 6cd90b0

File tree

3 files changed

+125
-3
lines changed

3 files changed

+125
-3
lines changed

algoliasearch/Clients/IngestionClient.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,7 @@ RunSourceResponse RunSource(
18431843
/// - deleteIndex
18441844
/// - editSettings
18451845
/// <param name="taskID">Unique identifier of a task.</param>
1846+
/// <param name="runTaskPayload"> (optional)</param>
18461847
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
18471848
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
18481849
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1851,6 +1852,7 @@ RunSourceResponse RunSource(
18511852
/// <returns>Task of RunResponse</returns>
18521853
Task<RunResponse> RunTaskAsync(
18531854
string taskID,
1855+
RunTaskPayload runTaskPayload = default,
18541856
RequestOptions options = null,
18551857
CancellationToken cancellationToken = default
18561858
);
@@ -1864,6 +1866,7 @@ Task<RunResponse> RunTaskAsync(
18641866
/// - deleteIndex
18651867
/// - editSettings
18661868
/// <param name="taskID">Unique identifier of a task.</param>
1869+
/// <param name="runTaskPayload"> (optional)</param>
18671870
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
18681871
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
18691872
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1872,6 +1875,7 @@ Task<RunResponse> RunTaskAsync(
18721875
/// <returns>RunResponse</returns>
18731876
RunResponse RunTask(
18741877
string taskID,
1878+
RunTaskPayload runTaskPayload = default,
18751879
RequestOptions options = null,
18761880
CancellationToken cancellationToken = default
18771881
);
@@ -1885,6 +1889,7 @@ RunResponse RunTask(
18851889
/// - deleteIndex
18861890
/// - editSettings
18871891
/// <param name="taskID">Unique identifier of a task.</param>
1892+
/// <param name="runTaskPayload"> (optional)</param>
18881893
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
18891894
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
18901895
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1894,6 +1899,7 @@ RunResponse RunTask(
18941899
[Obsolete]
18951900
Task<RunResponse> RunTaskV1Async(
18961901
string taskID,
1902+
RunTaskPayload runTaskPayload = default,
18971903
RequestOptions options = null,
18981904
CancellationToken cancellationToken = default
18991905
);
@@ -1907,6 +1913,7 @@ Task<RunResponse> RunTaskV1Async(
19071913
/// - deleteIndex
19081914
/// - editSettings
19091915
/// <param name="taskID">Unique identifier of a task.</param>
1916+
/// <param name="runTaskPayload"> (optional)</param>
19101917
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
19111918
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
19121919
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1916,6 +1923,7 @@ Task<RunResponse> RunTaskV1Async(
19161923
[Obsolete]
19171924
RunResponse RunTaskV1(
19181925
string taskID,
1926+
RunTaskPayload runTaskPayload = default,
19191927
RequestOptions options = null,
19201928
CancellationToken cancellationToken = default
19211929
);
@@ -4297,6 +4305,7 @@ public RunSourceResponse RunSource(
42974305
/// <inheritdoc />
42984306
public async Task<RunResponse> RunTaskAsync(
42994307
string taskID,
4308+
RunTaskPayload runTaskPayload = default,
43004309
RequestOptions options = null,
43014310
CancellationToken cancellationToken = default
43024311
)
@@ -4308,6 +4317,7 @@ public async Task<RunResponse> RunTaskAsync(
43084317

43094318
requestOptions.PathParameters.Add("taskID", QueryStringHelper.ParameterToString(taskID));
43104319

4320+
requestOptions.Data = runTaskPayload;
43114321
return await _transport
43124322
.ExecuteRequestAsync<RunResponse>(
43134323
new HttpMethod("POST"),
@@ -4321,14 +4331,16 @@ public async Task<RunResponse> RunTaskAsync(
43214331
/// <inheritdoc />
43224332
public RunResponse RunTask(
43234333
string taskID,
4334+
RunTaskPayload runTaskPayload = default,
43244335
RequestOptions options = null,
43254336
CancellationToken cancellationToken = default
4326-
) => AsyncHelper.RunSync(() => RunTaskAsync(taskID, options, cancellationToken));
4337+
) => AsyncHelper.RunSync(() => RunTaskAsync(taskID, runTaskPayload, options, cancellationToken));
43274338

43284339
/// <inheritdoc />
43294340
[Obsolete]
43304341
public async Task<RunResponse> RunTaskV1Async(
43314342
string taskID,
4343+
RunTaskPayload runTaskPayload = default,
43324344
RequestOptions options = null,
43334345
CancellationToken cancellationToken = default
43344346
)
@@ -4340,6 +4352,7 @@ public async Task<RunResponse> RunTaskV1Async(
43404352

43414353
requestOptions.PathParameters.Add("taskID", QueryStringHelper.ParameterToString(taskID));
43424354

4355+
requestOptions.Data = runTaskPayload;
43434356
return await _transport
43444357
.ExecuteRequestAsync<RunResponse>(
43454358
new HttpMethod("POST"),
@@ -4354,9 +4367,11 @@ public async Task<RunResponse> RunTaskV1Async(
43544367
[Obsolete]
43554368
public RunResponse RunTaskV1(
43564369
string taskID,
4370+
RunTaskPayload runTaskPayload = default,
43574371
RequestOptions options = null,
43584372
CancellationToken cancellationToken = default
4359-
) => AsyncHelper.RunSync(() => RunTaskV1Async(taskID, options, cancellationToken));
4373+
) =>
4374+
AsyncHelper.RunSync(() => RunTaskV1Async(taskID, runTaskPayload, options, cancellationToken));
43604375

43614376
/// <inheritdoc />
43624377
public async Task<List<Authentication>> SearchAuthenticationsAsync(

algoliasearch/Models/Ingestion/RunSourcePayload.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public RunSourcePayload() { }
4848
[JsonPropertyName("entityIDs")]
4949
public List<string> EntityIDs { get; set; }
5050

51+
/// <summary>
52+
/// Additional information that will be passed to the created runs.
53+
/// </summary>
54+
/// <value>Additional information that will be passed to the created runs.</value>
55+
[JsonPropertyName("runMetadata")]
56+
public Dictionary<string, object> RunMetadata { get; set; }
57+
5158
/// <summary>
5259
/// Returns the string presentation of the object
5360
/// </summary>
@@ -60,6 +67,7 @@ public override string ToString()
6067
sb.Append(" IndexToExclude: ").Append(IndexToExclude).Append("\n");
6168
sb.Append(" EntityIDs: ").Append(EntityIDs).Append("\n");
6269
sb.Append(" EntityType: ").Append(EntityType).Append("\n");
70+
sb.Append(" RunMetadata: ").Append(RunMetadata).Append("\n");
6371
sb.Append("}\n");
6472
return sb.ToString();
6573
}
@@ -101,7 +109,13 @@ public override bool Equals(object obj)
101109
EntityIDs == input.EntityIDs
102110
|| EntityIDs != null && input.EntityIDs != null && EntityIDs.SequenceEqual(input.EntityIDs)
103111
)
104-
&& (EntityType == input.EntityType || EntityType.Equals(input.EntityType));
112+
&& (EntityType == input.EntityType || EntityType.Equals(input.EntityType))
113+
&& (
114+
RunMetadata == input.RunMetadata
115+
|| RunMetadata != null
116+
&& input.RunMetadata != null
117+
&& RunMetadata.SequenceEqual(input.RunMetadata)
118+
);
105119
}
106120

107121
/// <summary>
@@ -126,6 +140,10 @@ public override int GetHashCode()
126140
hashCode = (hashCode * 59) + EntityIDs.GetHashCode();
127141
}
128142
hashCode = (hashCode * 59) + EntityType.GetHashCode();
143+
if (RunMetadata != null)
144+
{
145+
hashCode = (hashCode * 59) + RunMetadata.GetHashCode();
146+
}
129147
return hashCode;
130148
}
131149
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
/// RunTaskPayload
16+
/// </summary>
17+
public partial class RunTaskPayload
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the RunTaskPayload class.
21+
/// </summary>
22+
public RunTaskPayload() { }
23+
24+
/// <summary>
25+
/// Additional information that will be passed to the created run.
26+
/// </summary>
27+
/// <value>Additional information that will be passed to the created run.</value>
28+
[JsonPropertyName("runMetadata")]
29+
public Dictionary<string, object> RunMetadata { get; set; }
30+
31+
/// <summary>
32+
/// Returns the string presentation of the object
33+
/// </summary>
34+
/// <returns>String presentation of the object</returns>
35+
public override string ToString()
36+
{
37+
StringBuilder sb = new StringBuilder();
38+
sb.Append("class RunTaskPayload {\n");
39+
sb.Append(" RunMetadata: ").Append(RunMetadata).Append("\n");
40+
sb.Append("}\n");
41+
return sb.ToString();
42+
}
43+
44+
/// <summary>
45+
/// Returns the JSON string presentation of the object
46+
/// </summary>
47+
/// <returns>JSON string presentation of the object</returns>
48+
public virtual string ToJson()
49+
{
50+
return JsonSerializer.Serialize(this, JsonConfig.Options);
51+
}
52+
53+
/// <summary>
54+
/// Returns true if objects are equal
55+
/// </summary>
56+
/// <param name="obj">Object to be compared</param>
57+
/// <returns>Boolean</returns>
58+
public override bool Equals(object obj)
59+
{
60+
if (obj is not RunTaskPayload input)
61+
{
62+
return false;
63+
}
64+
65+
return (
66+
RunMetadata == input.RunMetadata
67+
|| RunMetadata != null
68+
&& input.RunMetadata != null
69+
&& RunMetadata.SequenceEqual(input.RunMetadata)
70+
);
71+
}
72+
73+
/// <summary>
74+
/// Gets the hash code
75+
/// </summary>
76+
/// <returns>Hash code</returns>
77+
public override int GetHashCode()
78+
{
79+
unchecked // Overflow is fine, just wrap
80+
{
81+
int hashCode = 41;
82+
if (RunMetadata != null)
83+
{
84+
hashCode = (hashCode * 59) + RunMetadata.GetHashCode();
85+
}
86+
return hashCode;
87+
}
88+
}
89+
}

0 commit comments

Comments
 (0)