mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	dev: removed some unused code
This commit is contained in:
		@@ -1,13 +0,0 @@
 | 
			
		||||
#nullable disable
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Searches;
 | 
			
		||||
 | 
			
		||||
public class FinnHubSearchResponse
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("count")]
 | 
			
		||||
    public int Count { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("result")]
 | 
			
		||||
    public List<FinnHubSearchResult> Result { get; set; }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
#nullable disable
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Searches;
 | 
			
		||||
 | 
			
		||||
public class FinnHubSearchResult
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("description")]
 | 
			
		||||
    public string Description { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("displaySymbol")]
 | 
			
		||||
    public string DisplaySymbol { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("symbol")]
 | 
			
		||||
    public string Symbol { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("type")]
 | 
			
		||||
    public string Type { get; set; }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,55 +0,0 @@
 | 
			
		||||
// using System.Net.Http.Json;
 | 
			
		||||
//
 | 
			
		||||
// namespace NadekoBot.Modules.Searches;
 | 
			
		||||
//
 | 
			
		||||
// public sealed class PolygonApiClient : IDisposable
 | 
			
		||||
// {
 | 
			
		||||
//     private const string BASE_URL = "https://api.polygon.io/v3";
 | 
			
		||||
//     
 | 
			
		||||
//     private readonly HttpClient _httpClient;
 | 
			
		||||
//     private readonly string _apiKey;
 | 
			
		||||
//
 | 
			
		||||
//     public PolygonApiClient(HttpClient httpClient, string apiKey)
 | 
			
		||||
//     {
 | 
			
		||||
//         _httpClient = httpClient;
 | 
			
		||||
//         _apiKey = apiKey;
 | 
			
		||||
//     }
 | 
			
		||||
//     
 | 
			
		||||
//     public async Task<IReadOnlyCollection<PolygonTickerData>> TickersAsync(string? ticker = null, string? query = null)
 | 
			
		||||
//     {
 | 
			
		||||
//         if (string.IsNullOrWhiteSpace(query))
 | 
			
		||||
//             query = null; 
 | 
			
		||||
//         
 | 
			
		||||
//         if(query is not null)
 | 
			
		||||
//             query = Uri.EscapeDataString(query);
 | 
			
		||||
//         
 | 
			
		||||
//         var requestString = $"{BASE_URL}/reference/tickers"
 | 
			
		||||
//                             + "?type=CS"
 | 
			
		||||
//                             + "&active=true"
 | 
			
		||||
//                             + "&order=asc"
 | 
			
		||||
//                             + "&limit=1000"
 | 
			
		||||
//                             + $"&apiKey={_apiKey}";
 | 
			
		||||
//
 | 
			
		||||
//         if (!string.IsNullOrWhiteSpace(ticker))
 | 
			
		||||
//             requestString += $"&ticker={ticker}";
 | 
			
		||||
//         
 | 
			
		||||
//         if (!string.IsNullOrWhiteSpace(query))
 | 
			
		||||
//             requestString += $"&search={query}";
 | 
			
		||||
//
 | 
			
		||||
//
 | 
			
		||||
//         var response = await _httpClient.GetFromJsonAsync<PolygonTickerResponse>(requestString);
 | 
			
		||||
//
 | 
			
		||||
//         if (response is null)
 | 
			
		||||
//             return Array.Empty<PolygonTickerData>();
 | 
			
		||||
//
 | 
			
		||||
//         return response.Results;
 | 
			
		||||
//     }
 | 
			
		||||
//
 | 
			
		||||
//     // public async Task<PolygonTickerDetailsV3> TickerDetailsV3Async(string ticker)
 | 
			
		||||
//     // {
 | 
			
		||||
//     //     return new();
 | 
			
		||||
//     // }
 | 
			
		||||
//
 | 
			
		||||
//     public void Dispose()
 | 
			
		||||
//         => _httpClient.Dispose();
 | 
			
		||||
// }
 | 
			
		||||
@@ -1,26 +0,0 @@
 | 
			
		||||
// namespace NadekoBot.Modules.Searches;
 | 
			
		||||
//
 | 
			
		||||
// public sealed class PolygonStockDataService : IStockDataService
 | 
			
		||||
// {
 | 
			
		||||
//     private readonly IHttpClientFactory _httpClientFactory;
 | 
			
		||||
//     private readonly IBotCredsProvider _credsProvider;
 | 
			
		||||
//
 | 
			
		||||
//     public PolygonStockDataService(IHttpClientFactory httpClientFactory, IBotCredsProvider credsProvider)
 | 
			
		||||
//     {
 | 
			
		||||
//         _httpClientFactory = httpClientFactory;
 | 
			
		||||
//         _credsProvider = credsProvider;
 | 
			
		||||
//     }
 | 
			
		||||
//
 | 
			
		||||
//     public async Task<IReadOnlyCollection<StockData>> GetStockDataAsync(string? query = null)
 | 
			
		||||
//     {
 | 
			
		||||
//         using var httpClient = _httpClientFactory.CreateClient();
 | 
			
		||||
//         using var client = new PolygonApiClient(httpClient, string.Empty);
 | 
			
		||||
//         var data = await client.TickersAsync(query: query);
 | 
			
		||||
//
 | 
			
		||||
//         return data.Map(static x => new StockData()
 | 
			
		||||
//         {
 | 
			
		||||
//             Name = x.Name,
 | 
			
		||||
//             Ticker = x.Ticker,
 | 
			
		||||
//         });
 | 
			
		||||
//     }
 | 
			
		||||
// }
 | 
			
		||||
@@ -1,43 +0,0 @@
 | 
			
		||||
#nullable disable
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Searches;
 | 
			
		||||
 | 
			
		||||
public class PolygonTickerData
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("ticker")]
 | 
			
		||||
    public string Ticker { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("name")]
 | 
			
		||||
    public string Name { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("market")]
 | 
			
		||||
    public string Market { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("locale")]
 | 
			
		||||
    public string Locale { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("primary_exchange")]
 | 
			
		||||
    public string PrimaryExchange { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("type")]
 | 
			
		||||
    public string Type { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("active")]
 | 
			
		||||
    public bool Active { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("currency_name")]
 | 
			
		||||
    public string CurrencyName { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("cik")]
 | 
			
		||||
    public string Cik { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("composite_figi")]
 | 
			
		||||
    public string CompositeFigi { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("share_class_figi")]
 | 
			
		||||
    public string ShareClassFigi { get; set; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("last_updated_utc")]
 | 
			
		||||
    public DateTime LastUpdatedUtc { get; set; }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
#nullable disable
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Searches;
 | 
			
		||||
 | 
			
		||||
public class PolygonTickerResponse
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("status")]
 | 
			
		||||
    public string Status { get; set; }
 | 
			
		||||
    
 | 
			
		||||
    [JsonPropertyName("results")]
 | 
			
		||||
    public List<PolygonTickerData> Results { get; set; }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user