Skip to content
Open
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
@@ -0,0 +1,65 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;

namespace SampleTypeSpec
{
internal partial class SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResult : AsyncCollectionResult
{
private readonly SampleTypeSpecClient _client;
private readonly string _marker;
private readonly RequestOptions _options;

/// <summary> Initializes a new instance of SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResult, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The SampleTypeSpecClient client used to send requests. </param>
/// <param name="marker"></param>
/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResult(SampleTypeSpecClient client, string marker, RequestOptions options)
{
_client = client;
_marker = marker;
_options = options;
}

/// <summary> Gets the raw pages of the collection. </summary>
/// <returns> The raw pages of the collection. </returns>
public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
PipelineMessage message = _client.CreateXmlListWithContinuationTokenRequest(_marker, _options);
string nextToken = null;
while (true)
{
ClientResult result = ClientResult.FromResponse(await _client.Pipeline.ProcessMessageAsync(message, _options).ConfigureAwait(false));
yield return result;

nextToken = ((PageList)result).NextMarker;
if (string.IsNullOrEmpty(nextToken))
{
yield break;
}
message = _client.CreateXmlListWithContinuationTokenRequest(nextToken, _options);
}
}

/// <summary> Gets the continuation token from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The continuation token for the specified page. </returns>
public override ContinuationToken GetContinuationToken(ClientResult page)
{
string nextPage = ((PageList)page).NextMarker;
if (!string.IsNullOrEmpty(nextPage))
{
return ContinuationToken.FromBytes(BinaryData.FromString(nextPage));
}
else
{
return null;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SampleTypeSpec
{
internal partial class SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResultOfT : AsyncCollectionResult<PageRange>
{
private readonly SampleTypeSpecClient _client;
private readonly string _marker;
private readonly RequestOptions _options;

/// <summary> Initializes a new instance of SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The SampleTypeSpecClient client used to send requests. </param>
/// <param name="marker"></param>
/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public SampleTypeSpecClientXmlListWithContinuationTokenAsyncCollectionResultOfT(SampleTypeSpecClient client, string marker, RequestOptions options)
{
_client = client;
_marker = marker;
_options = options;
}

/// <summary> Gets the raw pages of the collection. </summary>
/// <returns> The raw pages of the collection. </returns>
public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
PipelineMessage message = _client.CreateXmlListWithContinuationTokenRequest(_marker, _options);
string nextToken = null;
while (true)
{
ClientResult result = ClientResult.FromResponse(await _client.Pipeline.ProcessMessageAsync(message, _options).ConfigureAwait(false));
yield return result;

nextToken = ((PageList)result).NextMarker;
if (string.IsNullOrEmpty(nextToken))
{
yield break;
}
message = _client.CreateXmlListWithContinuationTokenRequest(nextToken, _options);
}
}

/// <summary> Gets the continuation token from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The continuation token for the specified page. </returns>
public override ContinuationToken GetContinuationToken(ClientResult page)
{
string nextPage = ((PageList)page).NextMarker;
if (!string.IsNullOrEmpty(nextPage))
{
return ContinuationToken.FromBytes(BinaryData.FromString(nextPage));
}
else
{
return null;
}
}

/// <summary> Gets the values from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The values from the specified page. </returns>
protected override async IAsyncEnumerable<PageRange> GetValuesFromPageAsync(ClientResult page)
{
foreach (PageRange item in ((PageList)page).PageRange)
{
yield return item;
await Task.Yield();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;

namespace SampleTypeSpec
{
internal partial class SampleTypeSpecClientXmlListWithContinuationTokenCollectionResult : CollectionResult
{
private readonly SampleTypeSpecClient _client;
private readonly string _marker;
private readonly RequestOptions _options;

/// <summary> Initializes a new instance of SampleTypeSpecClientXmlListWithContinuationTokenCollectionResult, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The SampleTypeSpecClient client used to send requests. </param>
/// <param name="marker"></param>
/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public SampleTypeSpecClientXmlListWithContinuationTokenCollectionResult(SampleTypeSpecClient client, string marker, RequestOptions options)
{
_client = client;
_marker = marker;
_options = options;
}

/// <summary> Gets the raw pages of the collection. </summary>
/// <returns> The raw pages of the collection. </returns>
public override IEnumerable<ClientResult> GetRawPages()
{
PipelineMessage message = _client.CreateXmlListWithContinuationTokenRequest(_marker, _options);
string nextToken = null;
while (true)
{
ClientResult result = ClientResult.FromResponse(_client.Pipeline.ProcessMessage(message, _options));
yield return result;

nextToken = ((PageList)result).NextMarker;
if (string.IsNullOrEmpty(nextToken))
{
yield break;
}
message = _client.CreateXmlListWithContinuationTokenRequest(nextToken, _options);
}
}

/// <summary> Gets the continuation token from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The continuation token for the specified page. </returns>
public override ContinuationToken GetContinuationToken(ClientResult page)
{
string nextPage = ((PageList)page).NextMarker;
if (!string.IsNullOrEmpty(nextPage))
{
return ContinuationToken.FromBytes(BinaryData.FromString(nextPage));
}
else
{
return null;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;

namespace SampleTypeSpec
{
internal partial class SampleTypeSpecClientXmlListWithContinuationTokenCollectionResultOfT : CollectionResult<PageRange>
{
private readonly SampleTypeSpecClient _client;
private readonly string _marker;
private readonly RequestOptions _options;

/// <summary> Initializes a new instance of SampleTypeSpecClientXmlListWithContinuationTokenCollectionResultOfT, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The SampleTypeSpecClient client used to send requests. </param>
/// <param name="marker"></param>
/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public SampleTypeSpecClientXmlListWithContinuationTokenCollectionResultOfT(SampleTypeSpecClient client, string marker, RequestOptions options)
{
_client = client;
_marker = marker;
_options = options;
}

/// <summary> Gets the raw pages of the collection. </summary>
/// <returns> The raw pages of the collection. </returns>
public override IEnumerable<ClientResult> GetRawPages()
{
PipelineMessage message = _client.CreateXmlListWithContinuationTokenRequest(_marker, _options);
string nextToken = null;
while (true)
{
ClientResult result = ClientResult.FromResponse(_client.Pipeline.ProcessMessage(message, _options));
yield return result;

nextToken = ((PageList)result).NextMarker;
if (string.IsNullOrEmpty(nextToken))
{
yield break;
}
message = _client.CreateXmlListWithContinuationTokenRequest(nextToken, _options);
}
}

/// <summary> Gets the continuation token from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The continuation token for the specified page. </returns>
public override ContinuationToken GetContinuationToken(ClientResult page)
{
string nextPage = ((PageList)page).NextMarker;
if (!string.IsNullOrEmpty(nextPage))
{
return ContinuationToken.FromBytes(BinaryData.FromString(nextPage));
}
else
{
return null;
}
}

/// <summary> Gets the values from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The values from the specified page. </returns>
protected override IEnumerable<PageRange> GetValuesFromPage(ClientResult page)
{
return ((PageList)page).PageRange;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;

namespace SampleTypeSpec
{
internal partial class SampleTypeSpecClientXmlListWithNextLinkAsyncCollectionResult : AsyncCollectionResult
{
private readonly SampleTypeSpecClient _client;
private readonly RequestOptions _options;

/// <summary> Initializes a new instance of SampleTypeSpecClientXmlListWithNextLinkAsyncCollectionResult, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The SampleTypeSpecClient client used to send requests. </param>
/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public SampleTypeSpecClientXmlListWithNextLinkAsyncCollectionResult(SampleTypeSpecClient client, RequestOptions options)
{
_client = client;
_options = options;
}

/// <summary> Gets the raw pages of the collection. </summary>
/// <returns> The raw pages of the collection. </returns>
public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
PipelineMessage message = _client.CreateXmlListWithNextLinkRequest(_options);
Uri nextPageUri = null;
while (true)
{
ClientResult result = ClientResult.FromResponse(await _client.Pipeline.ProcessMessageAsync(message, _options).ConfigureAwait(false));
yield return result;

nextPageUri = ((XmlListWithNextLinkResponse)result).Next;
if (nextPageUri == null)
{
yield break;
}
message = _client.CreateNextXmlListWithNextLinkRequest(nextPageUri, _options);
}
}

/// <summary> Gets the continuation token from the specified page. </summary>
/// <param name="page"></param>
/// <returns> The continuation token for the specified page. </returns>
public override ContinuationToken GetContinuationToken(ClientResult page)
{
Uri nextPage = ((XmlListWithNextLinkResponse)page).Next;
if (nextPage != null)
{
return ContinuationToken.FromBytes(BinaryData.FromString(nextPage.AbsoluteUri));
}
else
{
return null;
}
}
}
}
Loading
Loading