Skip to content

Commit

Permalink
Rename WaitUntilReady to WaitUntilReadyAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Sep 4, 2024
1 parent 329bb8c commit 1e12733
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AssemblyAI.IntegrationTests/TranscriptsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public async Task Should_Wait_Until_Ready()
using var stream = File.OpenRead(testFilePath);

var transcript = await client.Transcripts.SubmitAsync(stream).ConfigureAwait(false);
transcript = await client.Transcripts.WaitUntilReady(transcript.Id).ConfigureAwait(false);
transcript = await client.Transcripts.WaitUntilReadyAsync(transcript.Id).ConfigureAwait(false);

Assert.That(transcript, Is.Not.Null);
Assert.Multiple(() =>
Expand Down
15 changes: 12 additions & 3 deletions src/AssemblyAI/Transcripts/ExtendedTranscriptsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,20 @@ public async Task<Transcript> TranscribeAsync(
)
{
var transcript = await SubmitAsync(transcriptParams, options, cancellationToken).ConfigureAwait(false);
transcript = await WaitUntilReady(transcript.Id, null, null, options, cancellationToken)
transcript = await WaitUntilReadyAsync(transcript.Id, null, null, options, cancellationToken)
.ConfigureAwait(false);
return transcript;
}

[Obsolete("Use `WaitUntilReadyAsync` instead.")]
public Task<Transcript> WaitUntilReady(
string id,
TimeSpan? pollingInterval = null,
TimeSpan? pollingTimeout = null,
RequestOptions? options = null,
CancellationToken cancellationToken = default
) => WaitUntilReadyAsync(id, pollingInterval, pollingTimeout, options, cancellationToken);

/// <summary>
/// Wait until the transcript status is either "completed" or "error".
/// </summary>
Expand All @@ -385,7 +394,7 @@ public async Task<Transcript> TranscribeAsync(
/// <param name="options">HTTP request options</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>The transcript with status "completed" or "error"</returns>
public async Task<Transcript> WaitUntilReady(
public async Task<Transcript> WaitUntilReadyAsync(
string id,
TimeSpan? pollingInterval = null,
TimeSpan? pollingTimeout = null,
Expand Down Expand Up @@ -445,7 +454,7 @@ private static TranscriptParams CreateParams(string audioFileUrl, TranscriptOpti
/// <returns>A list of transcripts you created</returns>
public Task<TranscriptList> ListAsync(RequestOptions? options = null, CancellationToken cancellationToken = default)
=> ListAsync(new ListTranscriptParams(), options, cancellationToken);

/// <summary>
/// Retrieve a list of transcripts you created.
/// Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
Expand Down

0 comments on commit 1e12733

Please sign in to comment.