openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
OpenAI/src/Generated/CollectionResults/AudioClientGetVoiceConsentsAsyncCollectionResult.cs
43lines · modecode
| 1 | // <auto-generated/> |
| 2 | |
| 3 | #nullable disable |
| 4 | |
| 5 | using System.ClientModel; |
| 6 | using System.ClientModel.Primitives; |
| 7 | using System.Collections.Generic; |
| 8 | using System.Threading.Tasks; |
| 9 | |
| 10 | namespace OpenAI.Audio |
| 11 | { |
| 12 | internal partial class AudioClientGetVoiceConsentsAsyncCollectionResult : AsyncCollectionResult |
| 13 | { |
| 14 | private readonly AudioClient _client; |
| 15 | private readonly string _after; |
| 16 | private readonly int? _limit; |
| 17 | private readonly RequestOptions _options; |
| 18 | |
| 19 | public AudioClientGetVoiceConsentsAsyncCollectionResult(AudioClient client, string after, int? limit, RequestOptions options) |
| 20 | { |
| 21 | _client = client; |
| 22 | _after = after; |
| 23 | _limit = limit; |
| 24 | _options = options; |
| 25 | } |
| 26 | |
| 27 | public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync() |
| 28 | { |
| 29 | PipelineMessage message = _client.CreateGetVoiceConsentsRequest(_after, _limit, _options); |
| 30 | yield return await GetNextResponseAsync(message).ConfigureAwait(false); |
| 31 | } |
| 32 | |
| 33 | public override ContinuationToken GetContinuationToken(ClientResult page) |
| 34 | { |
| 35 | return null; |
| 36 | } |
| 37 | |
| 38 | private async ValueTask<ClientResult> GetNextResponseAsync(PipelineMessage message) |
| 39 | { |
| 40 | return ClientResult.FromResponse(await _client.Pipeline.ProcessMessageAsync(message, _options).ConfigureAwait(false)); |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |