Skip to content

Commit 69f229f

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#33)
Co-authored-by: github-actions[bot] <dependabot@bot.com>
1 parent df968f9 commit 69f229f

35 files changed

Lines changed: 2218 additions & 307 deletions

File tree

src/libs/DeepL/Generated/DeepL.AdminApiClient.AdminGetCustomTagAnalytics.g.cs

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.

src/libs/DeepL/Generated/DeepL.AdminApiClient.g.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace DeepL
55
{
66
/// <summary>
7+
/// Endpoints for organization administrators to manage API keys and retrieve usage analytics.<br/>
78
/// If no httpClient is provided, a new one will be created.<br/>
89
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
910
/// </summary>
@@ -132,10 +133,7 @@ public AdminApiClient(
132133
{
133134

134135
HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
135-
if (baseUri is not null)
136-
{
137-
HttpClient.BaseAddress ??= baseUri;
138-
}
136+
HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
139137
Authorizations = authorizations ?? new global::System.Collections.Generic.List<global::DeepL.EndPointAuthorization>();
140138
Options = options ?? new global::DeepL.AutoSDKClientOptions();
141139
_disposeHttpClient = disposeHttpClient;
@@ -248,7 +246,7 @@ private void SelectServer(global::DeepL.AutoSDKServer? server)
248246
return explicitBaseUri;
249247
}
250248

251-
return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
249+
return ResolveSelectedServer()?.Uri ?? HttpClient.BaseAddress;
252250
}
253251

254252
private global::System.Uri? ResolveBaseUri(

src/libs/DeepL/Generated/DeepL.DeepLClient.g.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public sealed partial class DeepLClient : global::DeepL.IDeepLClient, global::Sy
4545

4646

4747
/// <summary>
48-
///
48+
/// Endpoints for organization administrators to manage API keys and retrieve usage analytics.
4949
/// </summary>
5050
public AdminApiClient AdminApi => new AdminApiClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options)
5151
{
@@ -269,10 +269,7 @@ public DeepLClient(
269269
{
270270

271271
HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
272-
if (baseUri is not null)
273-
{
274-
HttpClient.BaseAddress ??= baseUri;
275-
}
272+
HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
276273
Authorizations = authorizations ?? new global::System.Collections.Generic.List<global::DeepL.EndPointAuthorization>();
277274
Options = options ?? new global::DeepL.AutoSDKClientOptions();
278275
_disposeHttpClient = disposeHttpClient;
@@ -385,7 +382,7 @@ private void SelectServer(global::DeepL.AutoSDKServer? server)
385382
return explicitBaseUri;
386383
}
387384

388-
return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
385+
return ResolveSelectedServer()?.Uri ?? HttpClient.BaseAddress;
389386
}
390387

391388
private global::System.Uri? ResolveBaseUri(
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#nullable enable
2+
3+
namespace DeepL
4+
{
5+
public partial interface IAdminApiClient
6+
{
7+
/// <summary>
8+
/// Get custom tag usage statistics as an admin<br/>
9+
/// Retrieve usage statistics broken down by custom tags within a specified date range.<br/>
10+
/// Optionally aggregate results by day or over the entire period.<br/>
11+
/// Results are paginated; use the `page` parameter with the `next_page` value from<br/>
12+
/// a previous response to retrieve subsequent pages.
13+
/// </summary>
14+
/// <param name="startDate"></param>
15+
/// <param name="endDate"></param>
16+
/// <param name="aggregateBy">
17+
/// Default Value: period
18+
/// </param>
19+
/// <param name="page"></param>
20+
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
21+
/// <param name="cancellationToken">The token to cancel the operation with</param>
22+
/// <exception cref="global::DeepL.ApiException"></exception>
23+
global::System.Threading.Tasks.Task<global::DeepL.CustomTagUsageReport> AdminGetCustomTagAnalyticsAsync(
24+
global::System.DateTime startDate,
25+
global::System.DateTime endDate,
26+
global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? aggregateBy = default,
27+
int? page = default,
28+
global::DeepL.AutoSDKRequestOptions? requestOptions = default,
29+
global::System.Threading.CancellationToken cancellationToken = default);
30+
/// <summary>
31+
/// Get custom tag usage statistics as an admin<br/>
32+
/// Retrieve usage statistics broken down by custom tags within a specified date range.<br/>
33+
/// Optionally aggregate results by day or over the entire period.<br/>
34+
/// Results are paginated; use the `page` parameter with the `next_page` value from<br/>
35+
/// a previous response to retrieve subsequent pages.
36+
/// </summary>
37+
/// <param name="startDate"></param>
38+
/// <param name="endDate"></param>
39+
/// <param name="aggregateBy">
40+
/// Default Value: period
41+
/// </param>
42+
/// <param name="page"></param>
43+
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
44+
/// <param name="cancellationToken">The token to cancel the operation with</param>
45+
/// <exception cref="global::DeepL.ApiException"></exception>
46+
global::System.Threading.Tasks.Task<global::DeepL.AutoSDKHttpResponse<global::DeepL.CustomTagUsageReport>> AdminGetCustomTagAnalyticsAsResponseAsync(
47+
global::System.DateTime startDate,
48+
global::System.DateTime endDate,
49+
global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? aggregateBy = default,
50+
int? page = default,
51+
global::DeepL.AutoSDKRequestOptions? requestOptions = default,
52+
global::System.Threading.CancellationToken cancellationToken = default);
53+
}
54+
}

src/libs/DeepL/Generated/DeepL.IAdminApiClient.g.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace DeepL
55
{
66
/// <summary>
7+
/// Endpoints for organization administrators to manage API keys and retrieve usage analytics.<br/>
78
/// If no httpClient is provided, a new one will be created.<br/>
89
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
910
/// </summary>

src/libs/DeepL/Generated/DeepL.IDeepLClient.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public partial interface IDeepLClient : global::System.IDisposable
6868

6969

7070
/// <summary>
71-
///
71+
/// Endpoints for organization administrators to manage API keys and retrieve usage analytics.
7272
/// </summary>
7373
public AdminApiClient AdminApi { get; }
7474

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace DeepL.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class AdminGetCustomTagAnalyticsAggregateByJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::DeepL.AdminGetCustomTagAnalyticsAggregateBy>
7+
{
8+
/// <inheritdoc />
9+
public override global::DeepL.AdminGetCustomTagAnalyticsAggregateBy Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::DeepL.AdminGetCustomTagAnalyticsAggregateByExtensions.ToEnum(stringValue) ?? default;
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::DeepL.AdminGetCustomTagAnalyticsAggregateBy)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::DeepL.AdminGetCustomTagAnalyticsAggregateBy);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::DeepL.AdminGetCustomTagAnalyticsAggregateBy value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::DeepL.AdminGetCustomTagAnalyticsAggregateByExtensions.ToValueString(value));
51+
}
52+
}
53+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#nullable enable
2+
3+
namespace DeepL.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class AdminGetCustomTagAnalyticsAggregateByNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::DeepL.AdminGetCustomTagAnalyticsAggregateBy?>
7+
{
8+
/// <inheritdoc />
9+
public override global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::DeepL.AdminGetCustomTagAnalyticsAggregateByExtensions.ToEnum(stringValue);
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::DeepL.AdminGetCustomTagAnalyticsAggregateBy)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::DeepL.AdminGetCustomTagAnalyticsAggregateBy?);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::DeepL.AdminGetCustomTagAnalyticsAggregateBy? value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
if (value == null)
51+
{
52+
writer.WriteNullValue();
53+
}
54+
else
55+
{
56+
writer.WriteStringValue(global::DeepL.AdminGetCustomTagAnalyticsAggregateByExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace DeepL.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class CustomTagUsageReportDataAggregateByJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::DeepL.CustomTagUsageReportDataAggregateBy>
7+
{
8+
/// <inheritdoc />
9+
public override global::DeepL.CustomTagUsageReportDataAggregateBy Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::DeepL.CustomTagUsageReportDataAggregateByExtensions.ToEnum(stringValue) ?? default;
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::DeepL.CustomTagUsageReportDataAggregateBy)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::DeepL.CustomTagUsageReportDataAggregateBy);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::DeepL.CustomTagUsageReportDataAggregateBy value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::DeepL.CustomTagUsageReportDataAggregateByExtensions.ToValueString(value));
51+
}
52+
}
53+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#nullable enable
2+
3+
namespace DeepL.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class CustomTagUsageReportDataAggregateByNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::DeepL.CustomTagUsageReportDataAggregateBy?>
7+
{
8+
/// <inheritdoc />
9+
public override global::DeepL.CustomTagUsageReportDataAggregateBy? Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::DeepL.CustomTagUsageReportDataAggregateByExtensions.ToEnum(stringValue);
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::DeepL.CustomTagUsageReportDataAggregateBy)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::DeepL.CustomTagUsageReportDataAggregateBy?);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::DeepL.CustomTagUsageReportDataAggregateBy? value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
if (value == null)
51+
{
52+
writer.WriteNullValue();
53+
}
54+
else
55+
{
56+
writer.WriteStringValue(global::DeepL.CustomTagUsageReportDataAggregateByExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)