Skip to content

Commit 5916c0c

Browse files
algolia-botsbelloneFluf22
committed
feat(specs): Ingestion API: new code property in oauth authentication (generated)
algolia/api-clients-automation#5897 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Sylvain Bellone <sylvain.bellone@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent b475ee2 commit 5916c0c

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

algoliasearch/Models/Ingestion/AuthInput.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ JsonSerializerOptions options
322322
&& root.TryGetProperty("url", out _)
323323
&& root.TryGetProperty("client_id", out _)
324324
&& root.TryGetProperty("client_secret", out _)
325+
&& root.TryGetProperty("code", out _)
325326
)
326327
{
327328
try

algoliasearch/Models/Ingestion/AuthOAuth.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ public AuthOAuth() { }
2626
/// Initializes a new instance of the AuthOAuth class.
2727
/// </summary>
2828
/// <param name="url">URL for the OAuth endpoint. (required).</param>
29-
/// <param name="clientId">Client ID. (required).</param>
30-
/// <param name="clientSecret">Client secret. This field is `null` in the API response. (required).</param>
31-
public AuthOAuth(string url, string clientId, string clientSecret)
29+
public AuthOAuth(string url)
3230
{
3331
Url = url ?? throw new ArgumentNullException(nameof(url));
34-
ClientId = clientId ?? throw new ArgumentNullException(nameof(clientId));
35-
ClientSecret = clientSecret ?? throw new ArgumentNullException(nameof(clientSecret));
3632
}
3733

3834
/// <summary>
@@ -56,6 +52,13 @@ public AuthOAuth(string url, string clientId, string clientSecret)
5652
[JsonPropertyName("client_secret")]
5753
public string ClientSecret { get; set; }
5854

55+
/// <summary>
56+
/// Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response.
57+
/// </summary>
58+
/// <value>Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response. </value>
59+
[JsonPropertyName("code")]
60+
public string Code { get; set; }
61+
5962
/// <summary>
6063
/// OAuth scope.
6164
/// </summary>
@@ -74,6 +77,7 @@ public override string ToString()
7477
sb.Append(" Url: ").Append(Url).Append("\n");
7578
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
7679
sb.Append(" ClientSecret: ").Append(ClientSecret).Append("\n");
80+
sb.Append(" Code: ").Append(Code).Append("\n");
7781
sb.Append(" Scope: ").Append(Scope).Append("\n");
7882
sb.Append("}\n");
7983
return sb.ToString();
@@ -106,6 +110,7 @@ public override bool Equals(object obj)
106110
ClientSecret == input.ClientSecret
107111
|| (ClientSecret != null && ClientSecret.Equals(input.ClientSecret))
108112
)
113+
&& (Code == input.Code || (Code != null && Code.Equals(input.Code)))
109114
&& (Scope == input.Scope || (Scope != null && Scope.Equals(input.Scope)));
110115
}
111116

@@ -130,6 +135,10 @@ public override int GetHashCode()
130135
{
131136
hashCode = (hashCode * 59) + ClientSecret.GetHashCode();
132137
}
138+
if (Code != null)
139+
{
140+
hashCode = (hashCode * 59) + Code.GetHashCode();
141+
}
133142
if (Scope != null)
134143
{
135144
hashCode = (hashCode * 59) + Scope.GetHashCode();

algoliasearch/Models/Ingestion/AuthOAuthPartial.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public AuthOAuthPartial() { }
4242
[JsonPropertyName("client_secret")]
4343
public string ClientSecret { get; set; }
4444

45+
/// <summary>
46+
/// Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response.
47+
/// </summary>
48+
/// <value>Authorization code. Used during an `authorization_code` grant type flow, to request an access_token when creating/updating the authentication. This field is not returned in the API response. </value>
49+
[JsonPropertyName("code")]
50+
public string Code { get; set; }
51+
4552
/// <summary>
4653
/// OAuth scope.
4754
/// </summary>
@@ -60,6 +67,7 @@ public override string ToString()
6067
sb.Append(" Url: ").Append(Url).Append("\n");
6168
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
6269
sb.Append(" ClientSecret: ").Append(ClientSecret).Append("\n");
70+
sb.Append(" Code: ").Append(Code).Append("\n");
6371
sb.Append(" Scope: ").Append(Scope).Append("\n");
6472
sb.Append("}\n");
6573
return sb.ToString();
@@ -92,6 +100,7 @@ public override bool Equals(object obj)
92100
ClientSecret == input.ClientSecret
93101
|| (ClientSecret != null && ClientSecret.Equals(input.ClientSecret))
94102
)
103+
&& (Code == input.Code || (Code != null && Code.Equals(input.Code)))
95104
&& (Scope == input.Scope || (Scope != null && Scope.Equals(input.Scope)));
96105
}
97106

@@ -116,6 +125,10 @@ public override int GetHashCode()
116125
{
117126
hashCode = (hashCode * 59) + ClientSecret.GetHashCode();
118127
}
128+
if (Code != null)
129+
{
130+
hashCode = (hashCode * 59) + Code.GetHashCode();
131+
}
119132
if (Scope != null)
120133
{
121134
hashCode = (hashCode * 59) + Scope.GetHashCode();

0 commit comments

Comments
 (0)