Show / Hide Table of Contents

Class AlpacaDataClientExtensions

Set of extension methods for the IAlpacaDataClient interface.

Inheritance
System.Object
AlpacaDataClientExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Alpaca.Markets.Extensions
Assembly: Alpaca.Markets.Extensions.dll
Syntax
public static class AlpacaDataClientExtensions

Methods

| Improve this Doc View Source

GetHistoricalAuctionsAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<IAuction> GetHistoricalAuctionsAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IAuction>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<IAuction> GetHistoricalAuctionsAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<IAuction>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsDictionaryOfAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.GetHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of dictionary of the interface instances) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IReadOnlyDictionary<String, IAsyncEnumerable<IAuction>> GetHistoricalAuctionsDictionaryOfAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

Returns
Type Description
IReadOnlyDictionary<String, IAsyncEnumerable<IAuction>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsDictionaryOfAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.GetHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of dictionary of the interface instances) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IReadOnlyDictionary<String, IAsyncEnumerable<IAuction>> GetHistoricalAuctionsDictionaryOfAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IReadOnlyDictionary<String, IAsyncEnumerable<IAuction>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsMultiPagesAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.GetHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<IAuction>>> GetHistoricalAuctionsMultiPagesAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<IAuction>>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsMultiPagesAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.GetHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<IAuction>>> GetHistoricalAuctionsMultiPagesAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<IReadOnlyDictionary<String, IReadOnlyList<IAuction>>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsPagesAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<IAuction>> GetHistoricalAuctionsPagesAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<IAuction>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetHistoricalAuctionsPagesAsAsyncEnumerable(IAlpacaDataClient, HistoricalAuctionsRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListHistoricalAuctionsAsync(Alpaca.Markets.HistoricalAuctionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<IAuction>> GetHistoricalAuctionsPagesAsAsyncEnumerable(this IAlpacaDataClient client, HistoricalAuctionsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

HistoricalAuctionsRequest request

Original historical auctions request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<IAuction>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetNewsArticlesAsAsyncEnumerable(IAlpacaDataClient, NewsArticlesRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListNewsArticlesAsync(Alpaca.Markets.NewsArticlesRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<INewsArticle> GetNewsArticlesAsAsyncEnumerable(this IAlpacaDataClient client, NewsArticlesRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

NewsArticlesRequest request

Original historical minute bars request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<INewsArticle>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetNewsArticlesAsAsyncEnumerable(IAlpacaDataClient, NewsArticlesRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListNewsArticlesAsync(Alpaca.Markets.NewsArticlesRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<INewsArticle> GetNewsArticlesAsAsyncEnumerable(this IAlpacaDataClient client, NewsArticlesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

NewsArticlesRequest request

Original historical minute bars request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation. The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request. The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. The initial TPC socket connection failed due to an underlying low-level network connectivity issue. .NET Core and .NET 5 and later only: The request failed due to timeout.

Returns
Type Description
IAsyncEnumerable<INewsArticle>
| Improve this Doc View Source

GetNewsArticlesPagesAsAsyncEnumerable(IAlpacaDataClient, NewsArticlesRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListNewsArticlesAsync(Alpaca.Markets.NewsArticlesRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<INewsArticle>> GetNewsArticlesPagesAsAsyncEnumerable(this IAlpacaDataClient client, NewsArticlesRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

NewsArticlesRequest request

Original historical news articles request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<INewsArticle>>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

GetNewsArticlesPagesAsAsyncEnumerable(IAlpacaDataClient, NewsArticlesRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListNewsArticlesAsync(Alpaca.Markets.NewsArticlesRequest,System.Threading.CancellationToken) in pagination mode as single stream of response pages with items so they can be consumed by the await foreach statement on the caller side as sequence of 'batches' instead of sequence of items itself.

Declaration
public static IAsyncEnumerable<IReadOnlyList<INewsArticle>> GetNewsArticlesPagesAsAsyncEnumerable(this IAlpacaDataClient client, NewsArticlesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

NewsArticlesRequest request

Original historical news articles request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation. The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request. The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. The initial TPC socket connection failed due to an underlying low-level network connectivity issue. .NET Core and .NET 5 and later only: The request failed due to timeout.

Returns
Type Description
IAsyncEnumerable<IReadOnlyList<INewsArticle>>
| Improve this Doc View Source

ListCorporateActionsAsAsyncEnumerable(IAlpacaDataClient, CorporateActionsRequest)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListCorporateActionsAsync(Alpaca.Markets.CorporateActionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<ICorporateActionsResponse> ListCorporateActionsAsAsyncEnumerable(this IAlpacaDataClient client, CorporateActionsRequest request)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

CorporateActionsRequest request

Original historical minute bars request (with empty next page token).

Returns
Type Description
IAsyncEnumerable<ICorporateActionsResponse>
Exceptions
Type Condition
RequestValidationException

The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

ListCorporateActionsAsAsyncEnumerable(IAlpacaDataClient, CorporateActionsRequest, CancellationToken)

Gets all items provided by Alpaca.Markets.IAlpacaDataClient.ListCorporateActionsAsync(Alpaca.Markets.CorporateActionsRequest,System.Threading.CancellationToken) in pagination mode as single stream of items (in form of interface) so they can be consumed by the await foreach statement on the caller side.

Declaration
public static IAsyncEnumerable<ICorporateActionsResponse> ListCorporateActionsAsAsyncEnumerable(this IAlpacaDataClient client, CorporateActionsRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
IAlpacaDataClient client

Target instance of the IAlpacaDataClient interface.

CorporateActionsRequest request

Original historical minute bars request (with empty next page token).

CancellationToken cancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation. The request argument contains invalid data or some required data is missing, unable to create a valid HTTP request. The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. The initial TPC socket connection failed due to an underlying low-level network connectivity issue. .NET Core and .NET 5 and later only: The request failed due to timeout.

Returns
Type Description
IAsyncEnumerable<ICorporateActionsResponse>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX