Skip to content

Commit 1ab9deb

Browse files
algolia-botmillotp
andcommitted
feat(specs): add runSource endpoint (#3453) (generated) [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent b90bef2 commit 1ab9deb

File tree

66 files changed

+4271
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4271
-0
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,32 @@ public interface IIngestionClient
10211021
/// <returns>RunResponse</returns>
10221022
RunResponse PushTask(string taskID, BatchWriteParams batchWriteParams, RequestOptions options = null, CancellationToken cancellationToken = default);
10231023

1024+
/// <summary>
1025+
/// Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
1026+
/// </summary>
1027+
/// <param name="sourceID">Unique identifier of a source.</param>
1028+
/// <param name="runSourcePayload"> (optional)</param>
1029+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1030+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1031+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1032+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1033+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1034+
/// <returns>Task of RunSourceResponse</returns>
1035+
Task<RunSourceResponse> RunSourceAsync(string sourceID, RunSourcePayload runSourcePayload = default, RequestOptions options = null, CancellationToken cancellationToken = default);
1036+
1037+
/// <summary>
1038+
/// Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task. (Synchronous version)
1039+
/// </summary>
1040+
/// <param name="sourceID">Unique identifier of a source.</param>
1041+
/// <param name="runSourcePayload"> (optional)</param>
1042+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1043+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1044+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1045+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1046+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1047+
/// <returns>RunSourceResponse</returns>
1048+
RunSourceResponse RunSource(string sourceID, RunSourcePayload runSourcePayload = default, RequestOptions options = null, CancellationToken cancellationToken = default);
1049+
10241050
/// <summary>
10251051
/// Runs a task. You can check the status of task runs with the observability endpoints.
10261052
/// </summary>
@@ -3354,6 +3380,57 @@ public RunResponse PushTask(string taskID, BatchWriteParams batchWriteParams, Re
33543380
AsyncHelper.RunSync(() => PushTaskAsync(taskID, batchWriteParams, options, cancellationToken));
33553381

33563382

3383+
/// <summary>
3384+
/// Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
3385+
/// </summary>
3386+
///
3387+
/// Required API Key ACLs:
3388+
/// - addObject
3389+
/// - deleteIndex
3390+
/// - editSettings
3391+
/// <param name="sourceID">Unique identifier of a source.</param>
3392+
/// <param name="runSourcePayload"> (optional)</param>
3393+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
3394+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
3395+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
3396+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
3397+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
3398+
/// <returns>Task of RunSourceResponse</returns>
3399+
public async Task<RunSourceResponse> RunSourceAsync(string sourceID, RunSourcePayload runSourcePayload = default, RequestOptions options = null, CancellationToken cancellationToken = default)
3400+
{
3401+
3402+
if (sourceID == null)
3403+
throw new ArgumentException("Parameter `sourceID` is required when calling `RunSource`.");
3404+
3405+
var requestOptions = new InternalRequestOptions(options);
3406+
3407+
requestOptions.PathParameters.Add("sourceID", QueryStringHelper.ParameterToString(sourceID));
3408+
3409+
requestOptions.Data = runSourcePayload;
3410+
return await _transport.ExecuteRequestAsync<RunSourceResponse>(new HttpMethod("POST"), "/1/sources/{sourceID}/run", requestOptions, cancellationToken).ConfigureAwait(false);
3411+
}
3412+
3413+
3414+
/// <summary>
3415+
/// Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task. (Synchronous version)
3416+
/// </summary>
3417+
///
3418+
/// Required API Key ACLs:
3419+
/// - addObject
3420+
/// - deleteIndex
3421+
/// - editSettings
3422+
/// <param name="sourceID">Unique identifier of a source.</param>
3423+
/// <param name="runSourcePayload"> (optional)</param>
3424+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
3425+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
3426+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
3427+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
3428+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
3429+
/// <returns>RunSourceResponse</returns>
3430+
public RunSourceResponse RunSource(string sourceID, RunSourcePayload runSourcePayload = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
3431+
AsyncHelper.RunSync(() => RunSourceAsync(sourceID, runSourcePayload, options, cancellationToken));
3432+
3433+
33573434
/// <summary>
33583435
/// Runs a task. You can check the status of task runs with the observability endpoints.
33593436
/// </summary>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Ingestion;
13+
14+
/// <summary>
15+
/// Type of entity to update.
16+
/// </summary>
17+
/// <value>Type of entity to update.</value>
18+
public enum EntityType
19+
{
20+
/// <summary>
21+
/// Enum Product for value: product
22+
/// </summary>
23+
[JsonPropertyName("product")]
24+
Product = 1,
25+
26+
/// <summary>
27+
/// Enum Collection for value: collection
28+
/// </summary>
29+
[JsonPropertyName("collection")]
30+
Collection = 2
31+
}
32+
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Ingestion;
13+
14+
/// <summary>
15+
/// RunSourcePayload
16+
/// </summary>
17+
public partial class RunSourcePayload
18+
{
19+
20+
/// <summary>
21+
/// Gets or Sets EntityType
22+
/// </summary>
23+
[JsonPropertyName("entityType")]
24+
public EntityType? EntityType { get; set; }
25+
/// <summary>
26+
/// Initializes a new instance of the RunSourcePayload class.
27+
/// </summary>
28+
public RunSourcePayload()
29+
{
30+
}
31+
32+
/// <summary>
33+
/// List of index names to include in reidexing/update.
34+
/// </summary>
35+
/// <value>List of index names to include in reidexing/update.</value>
36+
[JsonPropertyName("indexToInclude")]
37+
public List<string> IndexToInclude { get; set; }
38+
39+
/// <summary>
40+
/// List of index names to exclude in reidexing/update.
41+
/// </summary>
42+
/// <value>List of index names to exclude in reidexing/update.</value>
43+
[JsonPropertyName("indexToExclude")]
44+
public List<string> IndexToExclude { get; set; }
45+
46+
/// <summary>
47+
/// List of entityID to update.
48+
/// </summary>
49+
/// <value>List of entityID to update.</value>
50+
[JsonPropertyName("entityIDs")]
51+
public List<string> EntityIDs { get; set; }
52+
53+
/// <summary>
54+
/// Returns the string presentation of the object
55+
/// </summary>
56+
/// <returns>String presentation of the object</returns>
57+
public override string ToString()
58+
{
59+
StringBuilder sb = new StringBuilder();
60+
sb.Append("class RunSourcePayload {\n");
61+
sb.Append(" IndexToInclude: ").Append(IndexToInclude).Append("\n");
62+
sb.Append(" IndexToExclude: ").Append(IndexToExclude).Append("\n");
63+
sb.Append(" EntityIDs: ").Append(EntityIDs).Append("\n");
64+
sb.Append(" EntityType: ").Append(EntityType).Append("\n");
65+
sb.Append("}\n");
66+
return sb.ToString();
67+
}
68+
69+
/// <summary>
70+
/// Returns the JSON string presentation of the object
71+
/// </summary>
72+
/// <returns>JSON string presentation of the object</returns>
73+
public virtual string ToJson()
74+
{
75+
return JsonSerializer.Serialize(this, JsonConfig.Options);
76+
}
77+
78+
/// <summary>
79+
/// Returns true if objects are equal
80+
/// </summary>
81+
/// <param name="obj">Object to be compared</param>
82+
/// <returns>Boolean</returns>
83+
public override bool Equals(object obj)
84+
{
85+
if (obj is not RunSourcePayload input)
86+
{
87+
return false;
88+
}
89+
90+
return
91+
(IndexToInclude == input.IndexToInclude || IndexToInclude != null && input.IndexToInclude != null && IndexToInclude.SequenceEqual(input.IndexToInclude)) &&
92+
(IndexToExclude == input.IndexToExclude || IndexToExclude != null && input.IndexToExclude != null && IndexToExclude.SequenceEqual(input.IndexToExclude)) &&
93+
(EntityIDs == input.EntityIDs || EntityIDs != null && input.EntityIDs != null && EntityIDs.SequenceEqual(input.EntityIDs)) &&
94+
(EntityType == input.EntityType || EntityType.Equals(input.EntityType));
95+
}
96+
97+
/// <summary>
98+
/// Gets the hash code
99+
/// </summary>
100+
/// <returns>Hash code</returns>
101+
public override int GetHashCode()
102+
{
103+
unchecked // Overflow is fine, just wrap
104+
{
105+
int hashCode = 41;
106+
if (IndexToInclude != null)
107+
{
108+
hashCode = (hashCode * 59) + IndexToInclude.GetHashCode();
109+
}
110+
if (IndexToExclude != null)
111+
{
112+
hashCode = (hashCode * 59) + IndexToExclude.GetHashCode();
113+
}
114+
if (EntityIDs != null)
115+
{
116+
hashCode = (hashCode * 59) + EntityIDs.GetHashCode();
117+
}
118+
hashCode = (hashCode * 59) + EntityType.GetHashCode();
119+
return hashCode;
120+
}
121+
}
122+
123+
}
124+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Ingestion;
13+
14+
/// <summary>
15+
/// RunSourceResponse
16+
/// </summary>
17+
public partial class RunSourceResponse
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the RunSourceResponse class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public RunSourceResponse() { }
24+
/// <summary>
25+
/// Initializes a new instance of the RunSourceResponse class.
26+
/// </summary>
27+
/// <param name="taskWithRunID">Map of taskID sent for reindex with the corresponding runID. (required).</param>
28+
/// <param name="createdAt">Date of creation in RFC 3339 format. (required).</param>
29+
public RunSourceResponse(Dictionary<string, string> taskWithRunID, string createdAt)
30+
{
31+
TaskWithRunID = taskWithRunID ?? throw new ArgumentNullException(nameof(taskWithRunID));
32+
CreatedAt = createdAt ?? throw new ArgumentNullException(nameof(createdAt));
33+
}
34+
35+
/// <summary>
36+
/// Map of taskID sent for reindex with the corresponding runID.
37+
/// </summary>
38+
/// <value>Map of taskID sent for reindex with the corresponding runID.</value>
39+
[JsonPropertyName("taskWithRunID")]
40+
public Dictionary<string, string> TaskWithRunID { get; set; }
41+
42+
/// <summary>
43+
/// Date of creation in RFC 3339 format.
44+
/// </summary>
45+
/// <value>Date of creation in RFC 3339 format.</value>
46+
[JsonPropertyName("createdAt")]
47+
public string CreatedAt { get; set; }
48+
49+
/// <summary>
50+
/// Returns the string presentation of the object
51+
/// </summary>
52+
/// <returns>String presentation of the object</returns>
53+
public override string ToString()
54+
{
55+
StringBuilder sb = new StringBuilder();
56+
sb.Append("class RunSourceResponse {\n");
57+
sb.Append(" TaskWithRunID: ").Append(TaskWithRunID).Append("\n");
58+
sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n");
59+
sb.Append("}\n");
60+
return sb.ToString();
61+
}
62+
63+
/// <summary>
64+
/// Returns the JSON string presentation of the object
65+
/// </summary>
66+
/// <returns>JSON string presentation of the object</returns>
67+
public virtual string ToJson()
68+
{
69+
return JsonSerializer.Serialize(this, JsonConfig.Options);
70+
}
71+
72+
/// <summary>
73+
/// Returns true if objects are equal
74+
/// </summary>
75+
/// <param name="obj">Object to be compared</param>
76+
/// <returns>Boolean</returns>
77+
public override bool Equals(object obj)
78+
{
79+
if (obj is not RunSourceResponse input)
80+
{
81+
return false;
82+
}
83+
84+
return
85+
(TaskWithRunID == input.TaskWithRunID || TaskWithRunID != null && input.TaskWithRunID != null && TaskWithRunID.SequenceEqual(input.TaskWithRunID)) &&
86+
(CreatedAt == input.CreatedAt || (CreatedAt != null && CreatedAt.Equals(input.CreatedAt)));
87+
}
88+
89+
/// <summary>
90+
/// Gets the hash code
91+
/// </summary>
92+
/// <returns>Hash code</returns>
93+
public override int GetHashCode()
94+
{
95+
unchecked // Overflow is fine, just wrap
96+
{
97+
int hashCode = 41;
98+
if (TaskWithRunID != null)
99+
{
100+
hashCode = (hashCode * 59) + TaskWithRunID.GetHashCode();
101+
}
102+
if (CreatedAt != null)
103+
{
104+
hashCode = (hashCode * 59) + CreatedAt.GetHashCode();
105+
}
106+
return hashCode;
107+
}
108+
}
109+
110+
}
111+

0 commit comments

Comments
 (0)