Skip to content

Commit 11f882b

Browse files
feat(specs): add authentications to ingestion transformations (generated)
algolia/api-clients-automation#3494 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 28ce62a commit 11f882b

File tree

4 files changed

+125
-6
lines changed

4 files changed

+125
-6
lines changed

algoliasearch/Clients/IngestionClient.cs

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ public interface IIngestionClient
13141314
SourceWatchResponse TriggerDockerSourceDiscover(string sourceID, RequestOptions options = null, CancellationToken cancellationToken = default);
13151315

13161316
/// <summary>
1317-
/// Try a transformation.
1317+
/// Try a transformation before creating it.
13181318
/// </summary>
13191319
/// <param name="transformationTry"></param>
13201320
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
@@ -1326,7 +1326,7 @@ public interface IIngestionClient
13261326
Task<TransformationTryResponse> TryTransformationAsync(TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default);
13271327

13281328
/// <summary>
1329-
/// Try a transformation. (Synchronous version)
1329+
/// Try a transformation before creating it. (Synchronous version)
13301330
/// </summary>
13311331
/// <param name="transformationTry"></param>
13321332
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
@@ -1337,6 +1337,32 @@ public interface IIngestionClient
13371337
/// <returns>TransformationTryResponse</returns>
13381338
TransformationTryResponse TryTransformation(TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default);
13391339

1340+
/// <summary>
1341+
/// Try a transformation before updating it.
1342+
/// </summary>
1343+
/// <param name="transformationID">Unique identifier of a transformation.</param>
1344+
/// <param name="transformationTry"></param>
1345+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1346+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1347+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1348+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1349+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1350+
/// <returns>Task of TransformationTryResponse</returns>
1351+
Task<TransformationTryResponse> TryTransformationBeforeUpdateAsync(string transformationID, TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default);
1352+
1353+
/// <summary>
1354+
/// Try a transformation before updating it. (Synchronous version)
1355+
/// </summary>
1356+
/// <param name="transformationID">Unique identifier of a transformation.</param>
1357+
/// <param name="transformationTry"></param>
1358+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1359+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1360+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1361+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1362+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1363+
/// <returns>TransformationTryResponse</returns>
1364+
TransformationTryResponse TryTransformationBeforeUpdate(string transformationID, TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default);
1365+
13401366
/// <summary>
13411367
/// Updates an authentication resource.
13421368
/// </summary>
@@ -4009,7 +4035,7 @@ public SourceWatchResponse TriggerDockerSourceDiscover(string sourceID, RequestO
40094035

40104036

40114037
/// <summary>
4012-
/// Try a transformation.
4038+
/// Try a transformation before creating it.
40134039
/// </summary>
40144040
///
40154041
/// Required API Key ACLs:
@@ -4038,7 +4064,7 @@ public async Task<TransformationTryResponse> TryTransformationAsync(Transformati
40384064

40394065

40404066
/// <summary>
4041-
/// Try a transformation. (Synchronous version)
4067+
/// Try a transformation before creating it. (Synchronous version)
40424068
/// </summary>
40434069
///
40444070
/// Required API Key ACLs:
@@ -4056,6 +4082,61 @@ public TransformationTryResponse TryTransformation(TransformationTry transformat
40564082
AsyncHelper.RunSync(() => TryTransformationAsync(transformationTry, options, cancellationToken));
40574083

40584084

4085+
/// <summary>
4086+
/// Try a transformation before updating it.
4087+
/// </summary>
4088+
///
4089+
/// Required API Key ACLs:
4090+
/// - addObject
4091+
/// - deleteIndex
4092+
/// - editSettings
4093+
/// <param name="transformationID">Unique identifier of a transformation.</param>
4094+
/// <param name="transformationTry"></param>
4095+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
4096+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
4097+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
4098+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
4099+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
4100+
/// <returns>Task of TransformationTryResponse</returns>
4101+
public async Task<TransformationTryResponse> TryTransformationBeforeUpdateAsync(string transformationID, TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default)
4102+
{
4103+
4104+
if (transformationID == null)
4105+
throw new ArgumentException("Parameter `transformationID` is required when calling `TryTransformationBeforeUpdate`.");
4106+
4107+
4108+
if (transformationTry == null)
4109+
throw new ArgumentException("Parameter `transformationTry` is required when calling `TryTransformationBeforeUpdate`.");
4110+
4111+
var requestOptions = new InternalRequestOptions(options);
4112+
4113+
requestOptions.PathParameters.Add("transformationID", QueryStringHelper.ParameterToString(transformationID));
4114+
4115+
requestOptions.Data = transformationTry;
4116+
return await _transport.ExecuteRequestAsync<TransformationTryResponse>(new HttpMethod("POST"), "/1/transformations/{transformationID}/try", requestOptions, cancellationToken).ConfigureAwait(false);
4117+
}
4118+
4119+
4120+
/// <summary>
4121+
/// Try a transformation before updating it. (Synchronous version)
4122+
/// </summary>
4123+
///
4124+
/// Required API Key ACLs:
4125+
/// - addObject
4126+
/// - deleteIndex
4127+
/// - editSettings
4128+
/// <param name="transformationID">Unique identifier of a transformation.</param>
4129+
/// <param name="transformationTry"></param>
4130+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
4131+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
4132+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
4133+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
4134+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
4135+
/// <returns>TransformationTryResponse</returns>
4136+
public TransformationTryResponse TryTransformationBeforeUpdate(string transformationID, TransformationTry transformationTry, RequestOptions options = null, CancellationToken cancellationToken = default) =>
4137+
AsyncHelper.RunSync(() => TryTransformationBeforeUpdateAsync(transformationID, transformationTry, options, cancellationToken));
4138+
4139+
40594140
/// <summary>
40604141
/// Updates an authentication resource.
40614142
/// </summary>

algoliasearch/Models/Ingestion/Transformation.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ public Transformation(string transformationID, string code, string name, string
4343
[JsonPropertyName("transformationID")]
4444
public string TransformationID { get; set; }
4545

46+
/// <summary>
47+
/// The authentications associated for the current transformation.
48+
/// </summary>
49+
/// <value>The authentications associated for the current transformation.</value>
50+
[JsonPropertyName("authenticationIDs")]
51+
public List<string> AuthenticationIDs { get; set; }
52+
4653
/// <summary>
4754
/// The source code of the transformation.
4855
/// </summary>
@@ -87,6 +94,7 @@ public override string ToString()
8794
StringBuilder sb = new StringBuilder();
8895
sb.Append("class Transformation {\n");
8996
sb.Append(" TransformationID: ").Append(TransformationID).Append("\n");
97+
sb.Append(" AuthenticationIDs: ").Append(AuthenticationIDs).Append("\n");
9098
sb.Append(" Code: ").Append(Code).Append("\n");
9199
sb.Append(" Name: ").Append(Name).Append("\n");
92100
sb.Append(" Description: ").Append(Description).Append("\n");
@@ -119,6 +127,7 @@ public override bool Equals(object obj)
119127

120128
return
121129
(TransformationID == input.TransformationID || (TransformationID != null && TransformationID.Equals(input.TransformationID))) &&
130+
(AuthenticationIDs == input.AuthenticationIDs || AuthenticationIDs != null && input.AuthenticationIDs != null && AuthenticationIDs.SequenceEqual(input.AuthenticationIDs)) &&
122131
(Code == input.Code || (Code != null && Code.Equals(input.Code))) &&
123132
(Name == input.Name || (Name != null && Name.Equals(input.Name))) &&
124133
(Description == input.Description || (Description != null && Description.Equals(input.Description))) &&
@@ -139,6 +148,10 @@ public override int GetHashCode()
139148
{
140149
hashCode = (hashCode * 59) + TransformationID.GetHashCode();
141150
}
151+
if (AuthenticationIDs != null)
152+
{
153+
hashCode = (hashCode * 59) + AuthenticationIDs.GetHashCode();
154+
}
142155
if (Code != null)
143156
{
144157
hashCode = (hashCode * 59) + Code.GetHashCode();

algoliasearch/Models/Ingestion/TransformationCreate.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ public TransformationCreate(string code, string name)
5353
[JsonPropertyName("description")]
5454
public string Description { get; set; }
5555

56+
/// <summary>
57+
/// The authentications associated for the current transformation.
58+
/// </summary>
59+
/// <value>The authentications associated for the current transformation.</value>
60+
[JsonPropertyName("authenticationIDs")]
61+
public List<string> AuthenticationIDs { get; set; }
62+
5663
/// <summary>
5764
/// Returns the string presentation of the object
5865
/// </summary>
@@ -64,6 +71,7 @@ public override string ToString()
6471
sb.Append(" Code: ").Append(Code).Append("\n");
6572
sb.Append(" Name: ").Append(Name).Append("\n");
6673
sb.Append(" Description: ").Append(Description).Append("\n");
74+
sb.Append(" AuthenticationIDs: ").Append(AuthenticationIDs).Append("\n");
6775
sb.Append("}\n");
6876
return sb.ToString();
6977
}
@@ -92,7 +100,8 @@ public override bool Equals(object obj)
92100
return
93101
(Code == input.Code || (Code != null && Code.Equals(input.Code))) &&
94102
(Name == input.Name || (Name != null && Name.Equals(input.Name))) &&
95-
(Description == input.Description || (Description != null && Description.Equals(input.Description)));
103+
(Description == input.Description || (Description != null && Description.Equals(input.Description))) &&
104+
(AuthenticationIDs == input.AuthenticationIDs || AuthenticationIDs != null && input.AuthenticationIDs != null && AuthenticationIDs.SequenceEqual(input.AuthenticationIDs));
96105
}
97106

98107
/// <summary>
@@ -116,6 +125,10 @@ public override int GetHashCode()
116125
{
117126
hashCode = (hashCode * 59) + Description.GetHashCode();
118127
}
128+
if (AuthenticationIDs != null)
129+
{
130+
hashCode = (hashCode * 59) + AuthenticationIDs.GetHashCode();
131+
}
119132
return hashCode;
120133
}
121134
}

algoliasearch/Models/Ingestion/TransformationTry.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public TransformationTry(string code, object sampleRecord)
4646
[JsonPropertyName("sampleRecord")]
4747
public object SampleRecord { get; set; }
4848

49+
/// <summary>
50+
/// Gets or Sets Authentications
51+
/// </summary>
52+
[JsonPropertyName("authentications")]
53+
public List<AuthenticationCreate> Authentications { get; set; }
54+
4955
/// <summary>
5056
/// Returns the string presentation of the object
5157
/// </summary>
@@ -56,6 +62,7 @@ public override string ToString()
5662
sb.Append("class TransformationTry {\n");
5763
sb.Append(" Code: ").Append(Code).Append("\n");
5864
sb.Append(" SampleRecord: ").Append(SampleRecord).Append("\n");
65+
sb.Append(" Authentications: ").Append(Authentications).Append("\n");
5966
sb.Append("}\n");
6067
return sb.ToString();
6168
}
@@ -83,7 +90,8 @@ public override bool Equals(object obj)
8390

8491
return
8592
(Code == input.Code || (Code != null && Code.Equals(input.Code))) &&
86-
(SampleRecord == input.SampleRecord || (SampleRecord != null && SampleRecord.Equals(input.SampleRecord)));
93+
(SampleRecord == input.SampleRecord || (SampleRecord != null && SampleRecord.Equals(input.SampleRecord))) &&
94+
(Authentications == input.Authentications || Authentications != null && input.Authentications != null && Authentications.SequenceEqual(input.Authentications));
8795
}
8896

8997
/// <summary>
@@ -103,6 +111,10 @@ public override int GetHashCode()
103111
{
104112
hashCode = (hashCode * 59) + SampleRecord.GetHashCode();
105113
}
114+
if (Authentications != null)
115+
{
116+
hashCode = (hashCode * 59) + Authentications.GetHashCode();
117+
}
106118
return hashCode;
107119
}
108120
}

0 commit comments

Comments
 (0)