forked from alpacahq/alpaca-trade-api-csharp
/
IHistoricalQuotesClient.cs
67 lines (65 loc) · 3.6 KB
/
IHistoricalQuotesClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
namespace Alpaca.Markets;
/// <summary>
/// Provides unified type-safe access for Alpaca Crypto Data API via HTTP/REST.
/// </summary>
[CLSCompliant(false)]
public interface IHistoricalQuotesClient<in TRequest>
where TRequest : IHistoricalRequest<TRequest, IQuote>
{
/// <summary>
/// Gets historical quotes list for single asset from Alpaca REST API endpoint.
/// </summary>
/// <param name="request">Historical quotes request parameters.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <exception cref="RequestValidationException">
/// The <paramref name="request"/> argument contains invalid data or some required data is missing, unable to create a valid HTTP request.
/// </exception>
/// <exception cref="HttpRequestException">
/// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.
/// </exception>
/// <exception cref="RestClientErrorException">
/// The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.
/// </exception>
/// <exception cref="SocketException">
/// The initial TPC socket connection failed due to an underlying low-level network connectivity issue.
/// </exception>
/// <exception cref="TaskCanceledException">
/// .NET Core and .NET 5 and later only: The request failed due to timeout.
/// </exception>
/// <exception cref="ArgumentNullException">
/// The <paramref name="request"/> argument is <c>null</c>.
/// </exception>
/// <returns>Read-only list of historical quotes for specified asset (with pagination data).</returns>
[UsedImplicitly]
Task<IPage<IQuote>> ListHistoricalQuotesAsync(
TRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets historical quotes dictionary for several assets from Alpaca REST API endpoint.
/// </summary>
/// <param name="request">Historical quotes request parameters.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <exception cref="RequestValidationException">
/// The <paramref name="request"/> argument contains invalid data or some required data is missing, unable to create a valid HTTP request.
/// </exception>
/// <exception cref="HttpRequestException">
/// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.
/// </exception>
/// <exception cref="RestClientErrorException">
/// The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.
/// </exception>
/// <exception cref="SocketException">
/// The initial TPC socket connection failed due to an underlying low-level network connectivity issue.
/// </exception>
/// <exception cref="TaskCanceledException">
/// .NET Core and .NET 5 and later only: The request failed due to timeout.
/// </exception>
/// <exception cref="ArgumentNullException">
/// The <paramref name="request"/> argument is <c>null</c>.
/// </exception>
/// <returns>Read-only dictionary of historical quotes for specified assets (with pagination data).</returns>
[UsedImplicitly]
Task<IMultiPage<IQuote>> GetHistoricalQuotesAsync(
TRequest request,
CancellationToken cancellationToken = default);
}