Struct WithRawResponseStream<T>
- Namespace
- Auth0.ManagementApi
- Assembly
- Auth0.ManagementApi.dll
A streaming wrapper that provides dual-mode access to a streaming endpoint:
- Direct
await foreachiterates the parsed stream values (zero-allocation path for common case) .WithRawResponse()yields the underlying WithRawResponse<T> exposing both the stream and raw response metadata
public readonly struct WithRawResponseStream<T> : IAsyncEnumerable<T>
Type Parameters
TThe element type of the parsed stream.
- Implements
- Inherited Members
Constructors
WithRawResponseStream(Task<WithRawResponse<IAsyncEnumerable<T>>>, CancellationToken)
Creates a new WithRawResponseStream wrapping the given task that opens the underlying HTTP response.
public WithRawResponseStream(Task<WithRawResponse<IAsyncEnumerable<T>>> task, CancellationToken cancellationToken = default)
Parameters
taskTask<WithRawResponse<IAsyncEnumerable<T>>>The task opening the HTTP response and producing the parsed stream.
cancellationTokenCancellationTokenThe cancellation token supplied at the SDK call site. Linked with any token supplied via
.WithCancellation(...)on the enumerator so both cancel the inner reads.
Methods
GetAsyncEnumerator(CancellationToken)
Returns an enumerator that iterates the parsed stream values. Awaits the underlying HTTP response, then yields each parsed element from the body stream.
public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
WithRawResponse()
Returns the underlying task that yields both the stream and raw response metadata once headers are received.
public Task<WithRawResponse<IAsyncEnumerable<T>>> WithRawResponse()