73 lines
1.9 KiB
C#
73 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace FinlyticCore.Dtos.Yahoo;
|
|
|
|
/// <summary>
|
|
/// Root DTO response returned by https://query2.finance.yahoo.com/v1/finance/search
|
|
/// </summary>
|
|
public class YahooSearchResponseDto
|
|
{
|
|
[JsonPropertyName("count")]
|
|
public int Count { get; set; }
|
|
|
|
[JsonPropertyName("quotes")]
|
|
public List<YahooSearchQuoteDto> Quotes { get; set; } = new();
|
|
|
|
[JsonPropertyName("totalTime")]
|
|
public int TotalTime { get; set; }
|
|
|
|
[JsonPropertyName("timeTakenForQuotes")]
|
|
public int TimeTakenForQuotes { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents an individual quote item returned within the Yahoo Finance search results.
|
|
/// </summary>
|
|
public class YahooSearchQuoteDto
|
|
{
|
|
[JsonPropertyName("symbol")]
|
|
public string Symbol { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("shortname")]
|
|
public string? ShortName { get; set; }
|
|
|
|
[JsonPropertyName("longname")]
|
|
public string? LongName { get; set; }
|
|
|
|
[JsonPropertyName("exchange")]
|
|
public string? Exchange { get; set; }
|
|
|
|
[JsonPropertyName("exchDisp")]
|
|
public string? ExchDisp { get; set; }
|
|
|
|
[JsonPropertyName("quoteType")]
|
|
public string? QuoteType { get; set; }
|
|
|
|
[JsonPropertyName("typeDisp")]
|
|
public string? TypeDisp { get; set; }
|
|
|
|
[JsonPropertyName("index")]
|
|
public string? Index { get; set; }
|
|
|
|
[JsonPropertyName("score")]
|
|
public double Score { get; set; }
|
|
|
|
[JsonPropertyName("sector")]
|
|
public string? Sector { get; set; }
|
|
|
|
[JsonPropertyName("sectorDisp")]
|
|
public string? SectorDisp { get; set; }
|
|
|
|
[JsonPropertyName("industry")]
|
|
public string? Industry { get; set; }
|
|
|
|
[JsonPropertyName("industryDisp")]
|
|
public string? IndustryDisp { get; set; }
|
|
|
|
[JsonPropertyName("dispSecIndFlag")]
|
|
public bool DispSecIndFlag { get; set; }
|
|
|
|
[JsonPropertyName("isYahooFinance")]
|
|
public bool IsYahooFinance { get; set; }
|
|
} |