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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#nullable enable

namespace ResembleAI
{
public partial interface IMusicDetectionClient
{
/// <summary>
/// Authorize using bearer authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingBearer(
string apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
#nullable enable

namespace ResembleAI
{
public partial interface IMusicDetectionClient
{
/// <summary>
/// Detect AI-generated music<br/>
/// Analyze a song or music track and classify it as AI-generated or human-produced.<br/>
/// Supply audio via one of three intake methods:<br/>
/// - **Direct file upload**: `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller.<br/>
/// - **Public URL**: `application/json` with a `url` field. Resemble downloads and stores the file before analysis.<br/>
/// - **Secure upload token**: `application/json` with a `media_token` field obtained from `POST /secure_uploads`.<br/>
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. Only audio files are<br/>
/// accepted.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`.<br/>
/// Music detections are standard detections, so you can poll<br/>
/// [`GET /detect/{uuid}`](/api-reference/deepfake-detection/get-detection) or supply a `callback_url` to<br/>
/// be notified. Send the `Prefer: wait` header to block until the verdict is available and receive the<br/>
/// completed item in the same response. Allow a generous client timeout when waiting, since the first<br/>
/// request after a period of inactivity can take several minutes while the model warms up.<br/>
/// Each successful analysis is billed as audio Deepfake Detection usage. Failed analyses are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <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::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.MusicDetectResponse> CreateMusicDetectionAsync(

global::ResembleAI.CreateMusicDetectionRequest request,
global::ResembleAI.DetectMusicPostParametersPrefer? prefer = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Detect AI-generated music<br/>
/// Analyze a song or music track and classify it as AI-generated or human-produced.<br/>
/// Supply audio via one of three intake methods:<br/>
/// - **Direct file upload**: `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller.<br/>
/// - **Public URL**: `application/json` with a `url` field. Resemble downloads and stores the file before analysis.<br/>
/// - **Secure upload token**: `application/json` with a `media_token` field obtained from `POST /secure_uploads`.<br/>
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. Only audio files are<br/>
/// accepted.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`.<br/>
/// Music detections are standard detections, so you can poll<br/>
/// [`GET /detect/{uuid}`](/api-reference/deepfake-detection/get-detection) or supply a `callback_url` to<br/>
/// be notified. Send the `Prefer: wait` header to block until the verdict is available and receive the<br/>
/// completed item in the same response. Allow a generous client timeout when waiting, since the first<br/>
/// request after a period of inactivity can take several minutes while the model warms up.<br/>
/// Each successful analysis is billed as audio Deepfake Detection usage. Failed analyses are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <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::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.AutoSDKHttpResponse<global::ResembleAI.MusicDetectResponse>> CreateMusicDetectionAsResponseAsync(

global::ResembleAI.CreateMusicDetectionRequest request,
global::ResembleAI.DetectMusicPostParametersPrefer? prefer = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Detect AI-generated music<br/>
/// Analyze a song or music track and classify it as AI-generated or human-produced.<br/>
/// Supply audio via one of three intake methods:<br/>
/// - **Direct file upload**: `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller.<br/>
/// - **Public URL**: `application/json` with a `url` field. Resemble downloads and stores the file before analysis.<br/>
/// - **Secure upload token**: `application/json` with a `media_token` field obtained from `POST /secure_uploads`.<br/>
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. Only audio files are<br/>
/// accepted.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`.<br/>
/// Music detections are standard detections, so you can poll<br/>
/// [`GET /detect/{uuid}`](/api-reference/deepfake-detection/get-detection) or supply a `callback_url` to<br/>
/// be notified. Send the `Prefer: wait` header to block until the verdict is available and receive the<br/>
/// completed item in the same response. Allow a generous client timeout when waiting, since the first<br/>
/// request after a period of inactivity can take several minutes while the model warms up.<br/>
/// Each successful analysis is billed as audio Deepfake Detection usage. Failed analyses are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="file">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="filename">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="name">
/// Display name for the detection. Defaults to the source filename.
/// </param>
/// <param name="callbackUrl">
/// POST destination for the result once processing finishes. The body matches the response of `GET /detect/{uuid}`.
/// </param>
/// <param name="visualize">
/// Return a base64-encoded heatmap image in `metrics.image`.<br/>
/// Default Value: false
/// </param>
/// <param name="startRegion">
/// Start of the segment to analyze, in seconds.
/// </param>
/// <param name="endRegion">
/// End of the segment to analyze, in seconds.
/// </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::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.MusicDetectResponse> CreateMusicDetectionAsync(
byte[] file,
string filename,
global::ResembleAI.DetectMusicPostParametersPrefer? prefer = default,
string? name = default,
string? callbackUrl = default,
bool? visualize = default,
double? startRegion = default,
double? endRegion = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Detect AI-generated music<br/>
/// Analyze a song or music track and classify it as AI-generated or human-produced.<br/>
/// Supply audio via one of three intake methods:<br/>
/// - **Direct file upload**: `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller.<br/>
/// - **Public URL**: `application/json` with a `url` field. Resemble downloads and stores the file before analysis.<br/>
/// - **Secure upload token**: `application/json` with a `media_token` field obtained from `POST /secure_uploads`.<br/>
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. Only audio files are<br/>
/// accepted.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`.<br/>
/// Music detections are standard detections, so you can poll<br/>
/// [`GET /detect/{uuid}`](/api-reference/deepfake-detection/get-detection) or supply a `callback_url` to<br/>
/// be notified. Send the `Prefer: wait` header to block until the verdict is available and receive the<br/>
/// completed item in the same response. Allow a generous client timeout when waiting, since the first<br/>
/// request after a period of inactivity can take several minutes while the model warms up.<br/>
/// Each successful analysis is billed as audio Deepfake Detection usage. Failed analyses are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="file">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="filename">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="name">
/// Display name for the detection. Defaults to the source filename.
/// </param>
/// <param name="callbackUrl">
/// POST destination for the result once processing finishes. The body matches the response of `GET /detect/{uuid}`.
/// </param>
/// <param name="visualize">
/// Return a base64-encoded heatmap image in `metrics.image`.<br/>
/// Default Value: false
/// </param>
/// <param name="startRegion">
/// Start of the segment to analyze, in seconds.
/// </param>
/// <param name="endRegion">
/// End of the segment to analyze, in seconds.
/// </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::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.MusicDetectResponse> CreateMusicDetectionAsync(
global::System.IO.Stream file,
string filename,
global::ResembleAI.DetectMusicPostParametersPrefer? prefer = default,
string? name = default,
string? callbackUrl = default,
bool? visualize = default,
double? startRegion = default,
double? endRegion = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Detect AI-generated music<br/>
/// Analyze a song or music track and classify it as AI-generated or human-produced.<br/>
/// Supply audio via one of three intake methods:<br/>
/// - **Direct file upload**: `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller.<br/>
/// - **Public URL**: `application/json` with a `url` field. Resemble downloads and stores the file before analysis.<br/>
/// - **Secure upload token**: `application/json` with a `media_token` field obtained from `POST /secure_uploads`.<br/>
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. Only audio files are<br/>
/// accepted.<br/>
/// Processing is asynchronous by default: the response returns immediately with `status: processing`.<br/>
/// Music detections are standard detections, so you can poll<br/>
/// [`GET /detect/{uuid}`](/api-reference/deepfake-detection/get-detection) or supply a `callback_url` to<br/>
/// be notified. Send the `Prefer: wait` header to block until the verdict is available and receive the<br/>
/// completed item in the same response. Allow a generous client timeout when waiting, since the first<br/>
/// request after a period of inactivity can take several minutes while the model warms up.<br/>
/// Each successful analysis is billed as audio Deepfake Detection usage. Failed analyses are not billed.
/// </summary>
/// <param name="prefer"></param>
/// <param name="file">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="filename">
/// The audio file to analyze. Must be 150 MB or smaller.
/// </param>
/// <param name="name">
/// Display name for the detection. Defaults to the source filename.
/// </param>
/// <param name="callbackUrl">
/// POST destination for the result once processing finishes. The body matches the response of `GET /detect/{uuid}`.
/// </param>
/// <param name="visualize">
/// Return a base64-encoded heatmap image in `metrics.image`.<br/>
/// Default Value: false
/// </param>
/// <param name="startRegion">
/// Start of the segment to analyze, in seconds.
/// </param>
/// <param name="endRegion">
/// End of the segment to analyze, in seconds.
/// </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::ResembleAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::ResembleAI.AutoSDKHttpResponse<global::ResembleAI.MusicDetectResponse>> CreateMusicDetectionAsResponseAsync(
global::System.IO.Stream file,
string filename,
global::ResembleAI.DetectMusicPostParametersPrefer? prefer = default,
string? name = default,
string? callbackUrl = default,
bool? visualize = default,
double? startRegion = default,
double? endRegion = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#nullable enable

namespace ResembleAI
{
/// <summary>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public partial interface IMusicDetectionClient : global::System.IDisposable
{
/// <summary>
/// The HttpClient instance.
/// </summary>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <summary>
/// The base URL for the API.
/// </summary>
public System.Uri? BaseUri { get; }

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
public global::System.Collections.Generic.List<global::ResembleAI.EndPointAuthorization> Authorizations { get; }

/// <summary>
/// Gets or sets a value indicating whether the response content should be read as a string.
/// True by default in debug builds, false otherwise.
/// When false, successful responses are deserialized directly from the response stream for better performance.
/// Error responses are always read as strings regardless of this setting,
/// ensuring <see cref="ApiException.ResponseBody"/> is populated.
/// </summary>
public bool ReadResponseAsString { get; set; }
/// <summary>
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// </summary>
public global::ResembleAI.AutoSDKClientOptions Options { get; }


/// <summary>
///
/// </summary>
global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ public partial interface IResembleAIClient : global::System.IDisposable
/// </summary>
public IntelligenceClient Intelligence { get; }

/// <summary>
///
/// </summary>
public MusicDetectionClient MusicDetection { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace ResembleAI.JsonConverters
{
/// <inheritdoc />
public sealed class DetectMusicPostParametersPreferJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::ResembleAI.DetectMusicPostParametersPrefer>
{
/// <inheritdoc />
public override global::ResembleAI.DetectMusicPostParametersPrefer Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::ResembleAI.DetectMusicPostParametersPreferExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::ResembleAI.DetectMusicPostParametersPrefer)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::ResembleAI.DetectMusicPostParametersPrefer);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::ResembleAI.DetectMusicPostParametersPrefer value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::ResembleAI.DetectMusicPostParametersPreferExtensions.ToValueString(value));
}
}
}
Loading
Loading