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
Expand Up @@ -43,13 +43,22 @@ public partial interface ISubpackageSpeechToTextClient
/// <param name="query">
/// Optional intelligence question to evaluate after transcription
/// </param>
/// <param name="callbackUrl">
/// Public HTTPS URL that receives a POST with the result when processing finishes. Private, loopback, link-local, and non-HTTPS URLs are rejected. Required when zero_retention_mode is true.
/// </param>
/// <param name="zeroRetentionMode">
/// Enable zero retention. The uploaded media and any temporary processing copies are permanently deleted after transcription, and the transcript content is purged after one delivery to callback_url (which is mandatory in this mode). privacy_mode is accepted as an alias. Plan feature — requests are rejected with 402 if not included in your plan.<br/>
/// Default Value: false
/// </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.SpeechToTextCreateTranscriptResponse200> CreateTranscriptAsync(
byte[]? file = default,
string? filename = default,
string? query = default,
string? callbackUrl = default,
bool? zeroRetentionMode = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ public sealed partial class CreateTranscriptRequest
[global::System.Text.Json.Serialization.JsonPropertyName("query")]
public string? Query { get; set; }

/// <summary>
/// Public HTTPS URL that receives a POST with the result when processing finishes. Private, loopback, link-local, and non-HTTPS URLs are rejected. Required when zero_retention_mode is true.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("callback_url")]
public string? CallbackUrl { get; set; }

/// <summary>
/// Enable zero retention. The uploaded media and any temporary processing copies are permanently deleted after transcription, and the transcript content is purged after one delivery to callback_url (which is mandatory in this mode). privacy_mode is accepted as an alias. Plan feature — requests are rejected with 402 if not included in your plan.<br/>
/// Default Value: false
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("zero_retention_mode")]
public bool? ZeroRetentionMode { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -44,17 +57,28 @@ public sealed partial class CreateTranscriptRequest
/// <param name="query">
/// Optional intelligence question to evaluate after transcription
/// </param>
/// <param name="callbackUrl">
/// Public HTTPS URL that receives a POST with the result when processing finishes. Private, loopback, link-local, and non-HTTPS URLs are rejected. Required when zero_retention_mode is true.
/// </param>
/// <param name="zeroRetentionMode">
/// Enable zero retention. The uploaded media and any temporary processing copies are permanently deleted after transcription, and the transcript content is purged after one delivery to callback_url (which is mandatory in this mode). privacy_mode is accepted as an alias. Plan feature — requests are rejected with 402 if not included in your plan.<br/>
/// Default Value: false
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public CreateTranscriptRequest(
byte[]? file,
string? filename,
string? query)
string? query,
string? callbackUrl,
bool? zeroRetentionMode)
{
this.File = file;
this.Filename = filename;
this.Query = query;
this.CallbackUrl = callbackUrl;
this.ZeroRetentionMode = zeroRetentionMode;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public sealed partial class SpeechToTextPostResponsesContentApplicationJsonSchem
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::ResembleAI.JsonConverters.SpeechToTextPostResponsesContentApplicationJsonSchemaItemStatusJsonConverter))]
public global::ResembleAI.SpeechToTextPostResponsesContentApplicationJsonSchemaItemStatus? Status { get; set; }

/// <summary>
/// Whether the transcript was created with zero retention
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("privacy_mode")]
public bool? PrivacyMode { get; set; }

/// <summary>
///
/// </summary>
Expand All @@ -44,6 +50,9 @@ public sealed partial class SpeechToTextPostResponsesContentApplicationJsonSchem
/// </summary>
/// <param name="uuid"></param>
/// <param name="status"></param>
/// <param name="privacyMode">
/// Whether the transcript was created with zero retention
/// </param>
/// <param name="createdAt"></param>
/// <param name="updatedAt"></param>
#if NET7_0_OR_GREATER
Expand All @@ -52,11 +61,13 @@ public sealed partial class SpeechToTextPostResponsesContentApplicationJsonSchem
public SpeechToTextPostResponsesContentApplicationJsonSchemaItem(
global::System.Guid? uuid,
global::ResembleAI.SpeechToTextPostResponsesContentApplicationJsonSchemaItemStatus? status,
bool? privacyMode,
global::System.DateTime? createdAt,
global::System.DateTime? updatedAt)
{
this.Uuid = uuid;
this.Status = status;
this.PrivacyMode = privacyMode;
this.CreatedAt = createdAt;
this.UpdatedAt = updatedAt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed partial class SpeechToTextUuidGetResponsesContentApplicationJsonSc
public global::ResembleAI.SpeechToTextUuidGetResponsesContentApplicationJsonSchemaItemStatus? Status { get; set; }

/// <summary>
///
/// Absent for zero-retention transcripts after the content purge
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("text")]
public string? Text { get; set; }
Expand All @@ -40,7 +40,7 @@ public sealed partial class SpeechToTextUuidGetResponsesContentApplicationJsonSc
public double? DurationSeconds { get; set; }

/// <summary>
///
/// Absent once the media has been deleted (zero retention)
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("file_url")]
public string? FileUrl { get; set; }
Expand All @@ -57,6 +57,24 @@ public sealed partial class SpeechToTextUuidGetResponsesContentApplicationJsonSc
[global::System.Text.Json.Serialization.JsonPropertyName("answer")]
public string? Answer { get; set; }

/// <summary>
/// Whether the transcript was created with zero retention
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("privacy_mode")]
public bool? PrivacyMode { get; set; }

/// <summary>
/// When the uploaded media was permanently deleted (zero retention)
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("file_deleted_at")]
public global::System.DateTime? FileDeletedAt { get; set; }

/// <summary>
/// When the transcript content was permanently purged (zero retention)
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("content_deleted_at")]
public global::System.DateTime? ContentDeletedAt { get; set; }

/// <summary>
///
/// </summary>
Expand All @@ -80,12 +98,25 @@ public sealed partial class SpeechToTextUuidGetResponsesContentApplicationJsonSc
/// </summary>
/// <param name="uuid"></param>
/// <param name="status"></param>
/// <param name="text"></param>
/// <param name="text">
/// Absent for zero-retention transcripts after the content purge
/// </param>
/// <param name="words"></param>
/// <param name="durationSeconds"></param>
/// <param name="fileUrl"></param>
/// <param name="fileUrl">
/// Absent once the media has been deleted (zero retention)
/// </param>
/// <param name="query"></param>
/// <param name="answer"></param>
/// <param name="privacyMode">
/// Whether the transcript was created with zero retention
/// </param>
/// <param name="fileDeletedAt">
/// When the uploaded media was permanently deleted (zero retention)
/// </param>
/// <param name="contentDeletedAt">
/// When the transcript content was permanently purged (zero retention)
/// </param>
/// <param name="createdAt"></param>
/// <param name="updatedAt"></param>
#if NET7_0_OR_GREATER
Expand All @@ -100,6 +131,9 @@ public SpeechToTextUuidGetResponsesContentApplicationJsonSchemaItem(
string? fileUrl,
string? query,
string? answer,
bool? privacyMode,
global::System.DateTime? fileDeletedAt,
global::System.DateTime? contentDeletedAt,
global::System.DateTime? createdAt,
global::System.DateTime? updatedAt)
{
Expand All @@ -111,6 +145,9 @@ public SpeechToTextUuidGetResponsesContentApplicationJsonSchemaItem(
this.FileUrl = fileUrl;
this.Query = query;
this.Answer = answer;
this.PrivacyMode = privacyMode;
this.FileDeletedAt = fileDeletedAt;
this.ContentDeletedAt = contentDeletedAt;
this.CreatedAt = createdAt;
this.UpdatedAt = updatedAt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,43 @@ partial void ProcessAskTranscriptQuestionResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Missing query, transcript not yet processed, or the transcript was created with zero retention and its content has been purged
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
global::System.Exception? __exception_400 = null;
global::ResembleAI.Error? __value_400 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_400 = __ex;
}


throw global::ResembleAI.ApiException<global::ResembleAI.Error>.Create(
statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
responseBody: __content_400,
responseObject: __value_400,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}

if (__effectiveReadResponseAsString)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,22 @@ request.Filename is null
content: new global::System.Net.Http.StringContent(request.Query ?? string.Empty),
name: "\"query\"");

}
if (request.CallbackUrl != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty),
name: "\"callback_url\"");

}
if (request.ZeroRetentionMode != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"zero_retention_mode\"");

}

__httpRequest.Content = __httpRequestContent;
Expand Down Expand Up @@ -386,7 +402,7 @@ request.Filename is null
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad request
// Bad request (missing input, invalid callback_url, or zero retention requested without a callback_url)
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
Expand Down Expand Up @@ -423,6 +439,43 @@ request.Filename is null
h => h.Key,
h => h.Value));
}
// Zero retention is not included in the team's plan or subscription
if ((int)__response.StatusCode == 402)
{
string? __content_402 = null;
global::System.Exception? __exception_402 = null;
global::ResembleAI.Error? __value_402 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext);
}
else
{
__content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_402 = __ex;
}


throw global::ResembleAI.ApiException<global::ResembleAI.Error>.Create(
statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
responseBody: __content_402,
responseObject: __value_402,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}

if (__effectiveReadResponseAsString)
{
Expand Down Expand Up @@ -532,13 +585,22 @@ request.Filename is null
/// <param name="query">
/// Optional intelligence question to evaluate after transcription
/// </param>
/// <param name="callbackUrl">
/// Public HTTPS URL that receives a POST with the result when processing finishes. Private, loopback, link-local, and non-HTTPS URLs are rejected. Required when zero_retention_mode is true.
/// </param>
/// <param name="zeroRetentionMode">
/// Enable zero retention. The uploaded media and any temporary processing copies are permanently deleted after transcription, and the transcript content is purged after one delivery to callback_url (which is mandatory in this mode). privacy_mode is accepted as an alias. Plan feature — requests are rejected with 402 if not included in your plan.<br/>
/// Default Value: false
/// </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>
public async global::System.Threading.Tasks.Task<global::ResembleAI.SpeechToTextCreateTranscriptResponse200> CreateTranscriptAsync(
byte[]? file = default,
string? filename = default,
string? query = default,
string? callbackUrl = default,
bool? zeroRetentionMode = default,
global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -547,6 +609,8 @@ request.Filename is null
File = file,
Filename = filename,
Query = query,
CallbackUrl = callbackUrl,
ZeroRetentionMode = zeroRetentionMode,
};

return await CreateTranscriptAsync(
Expand Down
Loading
Loading