Table of Contents

Struct WithRawResponseStream<T>

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll

A streaming wrapper that provides dual-mode access to a streaming endpoint:

  • Direct await foreach iterates 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

T

The 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

task Task<WithRawResponse<IAsyncEnumerable<T>>>

The task opening the HTTP response and producing the parsed stream.

cancellationToken CancellationToken

The 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

cancellationToken CancellationToken

Returns

IAsyncEnumerator<T>

WithRawResponse()

Returns the underlying task that yields both the stream and raw response metadata once headers are received.

public Task<WithRawResponse<IAsyncEnumerable<T>>> WithRawResponse()

Returns

Task<WithRawResponse<IAsyncEnumerable<T>>>