Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions src/libs/Sightengine/Generated/Sightengine.AutoSDKHttpResponse.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

#nullable enable

namespace Sightengine
{
/// <summary>
/// Represents a successful HTTP response with status code and headers.
/// </summary>
public partial class AutoSDKHttpResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers)
: this(
statusCode: statusCode,
headers: headers,
requestUri: null)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
global::System.Uri? requestUri)
{
StatusCode = statusCode;
Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers));
RequestUri = requestUri;
}

/// <summary>
/// Gets the HTTP status code.
/// </summary>
public global::System.Net.HttpStatusCode StatusCode { get; }
/// <summary>
/// Gets the response headers.
/// </summary>
public global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> Headers { get; }
/// <summary>
/// Gets the final request URI associated with the response.
/// </summary>
public global::System.Uri? RequestUri { get; }

internal static global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> CreateHeaders(
global::System.Net.Http.HttpResponseMessage response)
{
response = response ?? throw new global::System.ArgumentNullException(nameof(response));

var headers = global::System.Linq.Enumerable.ToDictionary(
response.Headers,
static header => header.Key,
static header => (global::System.Collections.Generic.IEnumerable<string>)global::System.Linq.Enumerable.ToArray(header.Value),
global::System.StringComparer.OrdinalIgnoreCase);

if (response.Content?.Headers == null)
{
return headers;
}

foreach (var header in response.Content.Headers)
{
if (headers.TryGetValue(header.Key, out var existingValues))
{
headers[header.Key] = global::System.Linq.Enumerable.ToArray(
global::System.Linq.Enumerable.Concat(existingValues, header.Value));
}
else
{
headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value);
}
}

return headers;
}
}

/// <summary>
/// Represents a successful HTTP response with status code, headers, and body.
/// </summary>
public partial class AutoSDKHttpResponse<T> : AutoSDKHttpResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse{T}"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
T body)
: this(
statusCode: statusCode,
headers: headers,
requestUri: null,
body: body)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse{T}"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
global::System.Uri? requestUri,
T body)
: base(statusCode, headers, requestUri)
{
Body = body;
}

/// <summary>
/// Gets the response body.
/// </summary>
public T Body { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ public partial interface ISightengineClient
/// self-harm, scam detection, face analysis, text-in-image (OCR), QR codes,<br/>
/// AI-generated image detection, image type, and quality assessment.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.ImageCheckResponse>> CheckImageByUploadAsResponseAsync(

global::Sightengine.CheckImageByUploadRequest request,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Image (Upload)<br/>
/// Moderate an uploaded image using one or more detection models.<br/>
/// Supports nudity, violence, gore, weapons, drugs, alcohol, offensive content,<br/>
/// self-harm, scam detection, face analysis, text-in-image (OCR), QR codes,<br/>
/// AI-generated image detection, image type, and quality assessment.
/// </summary>
/// <param name="media">
/// The image file to analyze.
/// </param>
Expand All @@ -48,5 +64,62 @@ public partial interface ISightengineClient
string models,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Check Image (Upload)<br/>
/// Moderate an uploaded image using one or more detection models.<br/>
/// Supports nudity, violence, gore, weapons, drugs, alcohol, offensive content,<br/>
/// self-harm, scam detection, face analysis, text-in-image (OCR), QR codes,<br/>
/// AI-generated image detection, image type, and quality assessment.
/// </summary>
/// <param name="media">
/// The image file to analyze.
/// </param>
/// <param name="medianame">
/// The image file to analyze.
/// </param>
/// <param name="models">
/// Comma-separated list of detection models to apply.<br/>
/// Available models: nudity-2.1, gore-2.0, weapon, drugs, violence,<br/>
/// alcohol, offensive, self-harm, scam, face-attributes, text-content,<br/>
/// qr-content, genai, type, quality.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.ImageCheckResponse> CheckImageByUploadAsync(
global::System.IO.Stream media,
string medianame,
string models,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Image (Upload)<br/>
/// Moderate an uploaded image using one or more detection models.<br/>
/// Supports nudity, violence, gore, weapons, drugs, alcohol, offensive content,<br/>
/// self-harm, scam detection, face analysis, text-in-image (OCR), QR codes,<br/>
/// AI-generated image detection, image type, and quality assessment.
/// </summary>
/// <param name="media">
/// The image file to analyze.
/// </param>
/// <param name="medianame">
/// The image file to analyze.
/// </param>
/// <param name="models">
/// Comma-separated list of detection models to apply.<br/>
/// Available models: nudity-2.1, gore-2.0, weapon, drugs, violence,<br/>
/// alcohol, offensive, self-harm, scam, face-attributes, text-content,<br/>
/// qr-content, genai, type, quality.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.ImageCheckResponse>> CheckImageByUploadAsResponseAsync(
global::System.IO.Stream media,
string medianame,
string models,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,22 @@ public partial interface ISightengineClient
string models,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Image (URL)<br/>
/// Moderate an image by URL using one or more detection models.<br/>
/// Supports nudity, violence, gore, weapons, drugs, alcohol, offensive content,<br/>
/// self-harm, scam detection, face analysis, text-in-image (OCR), QR codes,<br/>
/// AI-generated image detection, image type, and quality assessment.
/// </summary>
/// <param name="url"></param>
/// <param name="models"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.ImageCheckResponse>> CheckImageByUrlAsResponseAsync(
string url,
string models,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ public partial interface ISightengineClient
/// Supports rule-based mode for content filtering and username mode<br/>
/// for validating usernames.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.TextCheckResponse>> CheckTextAsResponseAsync(

global::Sightengine.CheckTextRequest request,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Text<br/>
/// Moderate text content for profanity, personal information (emails,<br/>
/// phone numbers, usernames, IP addresses, SSNs), and links.<br/>
/// Supports rule-based mode for content filtering and username mode<br/>
/// for validating usernames.
/// </summary>
/// <param name="text">
/// UTF-8 formatted text to moderate.
/// </param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ public partial interface ISightengineClient
/// Supports videos longer than 60 seconds and live streams<br/>
/// (HLS, RTMP, RTMPS, RTSP, RTP, MPEG-DASH).
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.VideoCheckAsyncResponse>> CheckVideoAsyncAsResponseAsync(

global::Sightengine.CheckVideoAsyncRequest request,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Video (Asynchronous)<br/>
/// Start asynchronous video or live stream moderation.<br/>
/// Results are delivered via the callback URL.<br/>
/// Supports videos longer than 60 seconds and live streams<br/>
/// (HLS, RTMP, RTMPS, RTSP, RTP, MPEG-DASH).
/// </summary>
/// <param name="media">
/// The video file to analyze (use this OR stream_url).
/// </param>
Expand Down Expand Up @@ -55,5 +71,76 @@ public partial interface ISightengineClient
string? callbackUrl = default,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Check Video (Asynchronous)<br/>
/// Start asynchronous video or live stream moderation.<br/>
/// Results are delivered via the callback URL.<br/>
/// Supports videos longer than 60 seconds and live streams<br/>
/// (HLS, RTMP, RTMPS, RTSP, RTP, MPEG-DASH).
/// </summary>
/// <param name="media">
/// The video file to analyze (use this OR stream_url).
/// </param>
/// <param name="medianame">
/// The video file to analyze (use this OR stream_url).
/// </param>
/// <param name="streamUrl">
/// Public URL of the video or live stream.
/// </param>
/// <param name="callbackUrl">
/// Webhook URL to receive moderation results.
/// </param>
/// <param name="models">
/// Comma-separated list of detection models.<br/>
/// Available: nudity-2.1, gore-2.0, weapon, drugs, violence,<br/>
/// alcohol, offensive, self-harm, scam.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.VideoCheckAsyncResponse> CheckVideoAsyncAsync(
string models,
global::System.IO.Stream? media = default,
string? medianame = default,
string? streamUrl = default,
string? callbackUrl = default,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Check Video (Asynchronous)<br/>
/// Start asynchronous video or live stream moderation.<br/>
/// Results are delivered via the callback URL.<br/>
/// Supports videos longer than 60 seconds and live streams<br/>
/// (HLS, RTMP, RTMPS, RTSP, RTP, MPEG-DASH).
/// </summary>
/// <param name="media">
/// The video file to analyze (use this OR stream_url).
/// </param>
/// <param name="medianame">
/// The video file to analyze (use this OR stream_url).
/// </param>
/// <param name="streamUrl">
/// Public URL of the video or live stream.
/// </param>
/// <param name="callbackUrl">
/// Webhook URL to receive moderation results.
/// </param>
/// <param name="models">
/// Comma-separated list of detection models.<br/>
/// Available: nudity-2.1, gore-2.0, weapon, drugs, violence,<br/>
/// alcohol, offensive, self-harm, scam.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Sightengine.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Sightengine.AutoSDKHttpResponse<global::Sightengine.VideoCheckAsyncResponse>> CheckVideoAsyncAsResponseAsync(
string models,
global::System.IO.Stream? media = default,
string? medianame = default,
string? streamUrl = default,
string? callbackUrl = default,
global::Sightengine.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Loading