Skip to content

Commit 2b2fd26

Browse files
🔖 Version 4.5.0 (#417)
1 parent 35aadb3 commit 2b2fd26

3 files changed

Lines changed: 18 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Mindee .NET Client Library Changelog
22

3+
## v4.5.0 - 2026-07-22
4+
### Changes
5+
* :sparkles: add support for failed webhook responses
6+
* :sparkles: add public accessor for direct URl polling
7+
* :sparkles: add support for cancellation token
8+
9+
310
## v4.4.1 - 2026-02-22
411
### Fixes
512
* :bug: fix CLI not targeting correct .NET versions

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>4.4.1</VersionPrefix>
3+
<VersionPrefix>4.5.0</VersionPrefix>
44
<VersionSuffix></VersionSuffix>
55
<Authors>Mindee</Authors>
66
<TargetFrameworks>net472;net48;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>

src/Mindee/V2/Client.cs

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ InputSource inputSource
123123
default:
124124
throw new MindeeInputException($"Unsupported input source {inputSource.GetType().Name}");
125125
}
126-
127126
return await _mindeeApi.ReqPostEnqueueAsync(inputSource, parameters, ct);
128127
}
129128

@@ -151,21 +150,21 @@ public async Task<JobResponse> GetJobFromUrlAsync(string pollingUrl, Cancellatio
151150
/// <summary>
152151
/// Get a result directly from a polling URL.
153152
/// </summary>
154-
/// <param name="pollingUrl">The result's URL.</param>
153+
/// <param name="resultUrl">The result's URL.</param>
155154
/// <param name="ct">Cancellation token.</param>
156155
/// <returns>
157156
/// <see cref="ExtractionResponse" />
158157
/// </returns>
159-
public async Task<TResponse> GetResultFromUrlAsync<TResponse>(string pollingUrl, CancellationToken ct = default)
158+
public async Task<TResponse> GetResultFromUrlAsync<TResponse>(string resultUrl, CancellationToken ct = default)
160159
where TResponse : BaseResponse, new()
161160
{
162-
_logger?.LogInformation("Polling: {}", pollingUrl);
161+
_logger?.LogInformation("Getting result at: {}", resultUrl);
163162

164-
if (string.IsNullOrWhiteSpace(pollingUrl))
163+
if (string.IsNullOrWhiteSpace(resultUrl))
165164
{
166-
throw new MindeeInputException(nameof(pollingUrl));
165+
throw new MindeeInputException(nameof(resultUrl));
167166
}
168-
return await _mindeeApi.ReqGetResultFromUrlAsync<TResponse>(pollingUrl, ct);
167+
return await _mindeeApi.ReqGetResultFromUrlAsync<TResponse>(resultUrl, ct);
169168
}
170169

171170
/// <summary>
@@ -180,7 +179,7 @@ public async Task<TResponse> GetResultFromUrlAsync<TResponse>(string pollingUrl,
180179
public async Task<TResponse> GetResultAsync<TResponse>(string jobId, CancellationToken ct = default)
181180
where TResponse : BaseResponse, new()
182181
{
183-
_logger?.LogInformation("Polling: {}", jobId);
182+
_logger?.LogInformation("Getting result with ID: {}", jobId);
184183

185184
if (string.IsNullOrWhiteSpace(jobId))
186185
{
@@ -200,7 +199,7 @@ public async Task<TResponse> GetResultAsync<TResponse>(string jobId, Cancellatio
200199
/// </returns>
201200
public async Task<JobResponse> GetJobAsync(string jobId, CancellationToken ct = default)
202201
{
203-
_logger?.LogInformation("Getting job {}", jobId);
202+
_logger?.LogInformation("Getting job ID: {}", jobId);
204203

205204
if (string.IsNullOrWhiteSpace(jobId))
206205
{
@@ -234,20 +233,6 @@ InputSource inputSource
234233
, CancellationToken ct = default)
235234
where TResponse : BaseResponse, new()
236235
{
237-
switch (inputSource)
238-
{
239-
case LocalInputSource:
240-
_logger?.LogInformation("Enqueuing: local source");
241-
break;
242-
case UrlInputSource:
243-
_logger?.LogInformation("Enqueuing: URL source");
244-
break;
245-
case null:
246-
throw new ArgumentNullException(nameof(inputSource));
247-
default:
248-
throw new MindeeInputException($"Unsupported input source {inputSource.GetType().Name}");
249-
}
250-
251236
pollingOptions ??= new PollingOptions();
252237

253238
var enqueueResponse = await EnqueueAsync(
@@ -264,7 +249,8 @@ InputSource inputSource
264249
/// <param name="modelType">Model type filter.</param>
265250
/// <param name="ct">Cancellation token.</param>
266251
/// <returns></returns>
267-
public async Task<SearchResponse> SearchModels(string name = null, string modelType = null, CancellationToken ct = default)
252+
public async Task<SearchResponse> SearchModels(
253+
string name = null, string modelType = null, CancellationToken ct = default)
268254
{
269255
return await _mindeeApi.SearchModels(name, modelType, ct);
270256
}

0 commit comments

Comments
 (0)