Class AlphaVantageResponse<T>
- Namespace
- Tudormobile.AlphaVantage.Entities
- Assembly
- Tudormobile.AlphaVantageAPI.dll
Represents a generic response wrapper for Alpha Vantage API calls. Provides a standardized way to handle both successful responses and error conditions.
public class AlphaVantageResponse<T> where T : IEntity
Type Parameters
TThe type of the data returned by the API call. Must be a reference type.
- Inheritance
-
AlphaVantageResponse<T>
- Inherited Members
Constructors
AlphaVantageResponse()
public AlphaVantageResponse()
Properties
ErrorMessage
Gets or sets the error message if the API call failed. This will be null or empty for successful API calls.
public string? ErrorMessage { get; init; }
Property Value
- string
A string containing the error message, or null if the call was successful.
IsSuccess
Gets a value indicating whether the API call was successful. A call is considered successful if there is no error message and the result is not null.
public bool IsSuccess { get; }
Property Value
- bool
true if the API call was successful; otherwise, false.
Result
Gets or sets the result data from the API call. This will be null if the API call failed or returned no data.
public T? Result { get; init; }
Property Value
- T
An instance of type T containing the API response data, or null if unsuccessful.