Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiePrentice authored Dec 13, 2020
1 parent 4a0ddef commit 9d6809d
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
using System;

namespace IEXSharp.Model.CoreData.StockFundamentals.Response
{
public class AdvancedFundamentalsResponse
{
public decimal? accountsPayable { get; set; }
public decimal? accountsPayableTurnover { get; set; }
public decimal? accountsReceivable { get; set; }
public decimal? accountsReceivableTurnover { get; set; }
public string asOfDate { get; set; }
public decimal? assetsCurrentCash { get; set; }
public decimal? assetsCurrentCashRestricted { get; set; }
public decimal? assetsCurrentDeferredCompensation { get; set; }
public decimal? assetsCurrentDeferredTax { get; set; }
public decimal? assetsCurrentDiscontinuedOperations { get; set; }
public decimal? assetsCurrentInvestments { get; set; }
public decimal? assetsCurrentLeasesOperating { get; set; }
public decimal? assetsCurrentLoansNet { get; set; }
public decimal? assetsCurrentOther { get; set; }
public decimal? assetsCurrentSeparateAccounts { get; set; }
public decimal? assetsCurrentUnadjusted { get; set; }
public decimal? assetsFixed { get; set; }
public decimal? assetsFixedDeferredCompensation { get; set; }
public decimal? assetsFixedDeferredTax { get; set; }
public decimal? assetsFixedDiscontinuedOperations { get; set; }
public decimal? assetsFixedLeasesOperating { get; set; }
public decimal? assetsFixedOperatingDiscontinuedOperations { get; set; }
public decimal? assetsFixedOperatingSubsidiaryUnconsolidated { get; set; }
public decimal? assetsFixedOreo { get; set; }
public decimal? assetsFixedOther { get; set; }
public decimal? assetsFixedUnconsolidated { get; set; }
public decimal? assetsUnadjusted { get; set; }
public decimal? capex { get; set; }
public decimal? capexAcquisition { get; set; }
public decimal? capexMaintenance { get; set; }
public decimal? cashConversionCycle { get; set; }
public decimal? cashFlowFinancing { get; set; }
public decimal? cashFlowInvesting { get; set; }
public decimal? cashFlowOperating { get; set; }
public decimal? cashFlowShareRepurchase { get; set; }
public decimal? cashLongTerm { get; set; }
public decimal? cashOperating { get; set; }
public decimal? cashPaidForIncomeTaxes { get; set; }
public decimal? cashPaidForInterest { get; set; }
public decimal? cashRestricted { get; set; }
public decimal? chargeAfterTax { get; set; }
public decimal? chargeAfterTaxDiscontinuedOperations { get; set; }
public decimal? chargesAfterTaxOther { get; set; }
public string cik { get; set; }
public decimal? creditLossProvision { get; set; }
public DateTime dataGenerationDate { get; set; }
public decimal? daysInAccountsPayable { get; set; }
public decimal? daysInInventory { get; set; }
public decimal? daysInRevenueDeferred { get; set; }
public decimal? daysRevenueOutstanding { get; set; }
public decimal? debtFinancial { get; set; }
public decimal? debtShortTerm { get; set; }
public decimal? depreciationAndAmortizationAccumulated { get; set; }
public decimal? depreciationAndAmortizationCashFlow { get; set; }
public decimal? dividendsPreferred { get; set; }
public decimal? dividendsPreferredRedeemableMandatorily { get; set; }
public decimal? earningsRetained { get; set; }
public decimal? ebitReported { get; set; }
public decimal? ebitdaReported { get; set; }
public decimal? equityShareholder { get; set; }
public decimal? equityShareholderOther { get; set; }
public decimal? equityShareholderOtherDeferredCompensation { get; set; }
public decimal? equityShareholderOtherEquity { get; set; }
public decimal? equityShareholderOtherMezzanine { get; set; }
public decimal? expenses { get; set; }
public decimal? expensesAcquisitionMerger { get; set; }
public decimal? expensesCompensation { get; set; }
public decimal? expensesDepreciationAndAmortization { get; set; }
public decimal? expensesDerivative { get; set; }
public decimal? expensesDiscontinuedOperations { get; set; }
public decimal? expensesDiscontinuedOperationsReits { get; set; }
public decimal? expensesEnergy { get; set; }
public decimal? expensesForeignCurrency { get; set; }
public decimal? expensesInterest { get; set; }
public decimal? expensesInterestFinancials { get; set; }
public decimal? expensesInterestMinority { get; set; }
public decimal? expensesLegalRegulatoryInsurance { get; set; }
public decimal? expensesNonOperatingCompanyDefinedOther { get; set; }
public decimal? expensesNonOperatingOther { get; set; }
public decimal? expensesNonOperatingSubsidiaryUnconsolidated { get; set; }
public decimal? expensesNonRecurringOther { get; set; }
public decimal? expensesOperating { get; set; }
public decimal? expensesOperatingOther { get; set; }
public decimal? expensesOperatingSubsidiaryUnconsolidated { get; set; }
public decimal? expensesOreo { get; set; }
public decimal? expensesOreoReits { get; set; }
public decimal? expensesOtherFinancing { get; set; }
public decimal? expensesRestructuring { get; set; }
public decimal? expensesSga { get; set; }
public decimal? expensesStockCompensation { get; set; }
public decimal? expensesWriteDown { get; set; }
public decimal? ffo { get; set; }
public string figi { get; set; }
public DateTime filingDate { get; set; }
public string filingType { get; set; }
public int fiscalQuarter { get; set; }
public int fiscalYear { get; set; }
public decimal? goodwillAmortizationCashFlow { get; set; }
public decimal? goodwillAmortizationIncomeStatement { get; set; }
public decimal? goodwillAndIntangiblesNetOther { get; set; }
public decimal? goodwillNet { get; set; }
public decimal? incomeFromOperations { get; set; }
public decimal? incomeNet { get; set; }
public decimal? incomeNetPerRevenue { get; set; }
public decimal? incomeNetPerWabso { get; set; }
public decimal? incomeNetPerWabsoSplitAdjusted { get; set; }
public decimal? incomeNetPerWabsoSplitAdjustedYoyDeltaPercent { get; set; }
public decimal? incomeNetPerWadso { get; set; }
public decimal? incomeNetPerWadsoSplitAdjusted { get; set; }
public decimal? incomeNetPerWadsoSplitAdjustedYoyDeltaPercent { get; set; }
public decimal? incomeNetPreTax { get; set; }
public decimal? incomeNetYoyDelta { get; set; }
public decimal? incomeOperating { get; set; }
public decimal? incomeOperatingDiscontinuedOperations { get; set; }
public decimal? incomeOperatingOther { get; set; }
public decimal? incomeOperatingSubsidiaryUnconsolidated { get; set; }
public decimal? incomeOperatingSubsidiaryUnconsolidatedAfterTax { get; set; }
public decimal? incomeTax { get; set; }
public decimal? incomeTaxCurrent { get; set; }
public decimal? incomeTaxDeferred { get; set; }
public decimal? incomeTaxDiscontinuedOperations { get; set; }
public decimal? incomeTaxOther { get; set; }
public decimal? incomeTaxRate { get; set; }
public decimal? interestMinority { get; set; }
public decimal? inventory { get; set; }
public decimal? inventoryTurnover { get; set; }
public decimal? liabilities { get; set; }
public decimal? liabilitiesCurrent { get; set; }
public decimal? liabilitiesNonCurrentAndInterestMinorityTotal { get; set; }
public decimal? liabilitiesNonCurrentDebt { get; set; }
public decimal? liabilitiesNonCurrentDeferredCompensation { get; set; }
public decimal? liabilitiesNonCurrentDeferredTax { get; set; }
public decimal? liabilitiesNonCurrentDiscontinuedOperations { get; set; }
public decimal? liabilitiesNonCurrentLeasesOperating { get; set; }
public decimal? liabilitiesNonCurrentLongTerm { get; set; }
public decimal? liabilitiesNonCurrentOperatingDiscontinuedOperations { get; set; }
public decimal? liabilitiesNonCurrentOther { get; set; }
public decimal? nibclDeferredCompensation { get; set; }
public decimal? nibclDeferredTax { get; set; }
public decimal? nibclDiscontinuedOperations { get; set; }
public decimal? nibclLeasesOperating { get; set; }
public decimal? nibclOther { get; set; }
public decimal? nibclRestructuring { get; set; }
public decimal? nibclRevenueDeferred { get; set; }
public decimal? nibclRevenueDeferredTurnover { get; set; }
public decimal? nibclSeparateAccounts { get; set; }
public decimal? oci { get; set; }
public DateTime periodEndDate { get; set; }
public decimal? ppAndENet { get; set; }
public decimal? pricePerEarnings { get; set; }
public decimal? pricePerEarningsPerRevenueYoyDeltaPercent { get; set; }
public decimal? profitGross { get; set; }
public decimal? profitGrossPerRevenue { get; set; }
public decimal? researchAndDevelopmentExpense { get; set; }
public decimal? reserves { get; set; }
public decimal? reservesInventory { get; set; }
public decimal? reservesLifo { get; set; }
public decimal? reservesLoanLoss { get; set; }
public decimal? revenue { get; set; }
public decimal? revenueCostOther { get; set; }
public decimal? revenueIncomeInterest { get; set; }
public decimal? revenueOther { get; set; }
public decimal? revenueSubsidiaryUnconsolidated { get; set; }
public decimal? salesCost { get; set; }
public decimal? sharesIssued { get; set; }
public decimal? sharesOutstandingPeDateBs { get; set; }
public decimal? sharesTreasury { get; set; }
public decimal? stockCommon { get; set; }
public decimal? stockPreferred { get; set; }
public decimal? stockPreferredEquity { get; set; }
public decimal? stockPreferredMezzanine { get; set; }
public decimal? stockTreasury { get; set; }
public string symbol { get; set; }
public decimal? wabso { get; set; }
public decimal? wabsoSplitAdjusted { get; set; }
public decimal? wadso { get; set; }
public decimal? wadsoSplitAdjusted { get; set; }
public string id { get; set; }
public string key { get; set; }
public string subkey { get; set; }
public long date { get; set; }
public long updated { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ namespace IEXSharp.Service.Cloud.CoreData.StockFundamentals
{
public interface IStockFundamentalsService
{
/// <summary>
/// <see cref="https://iexcloud.io/docs/api/#advanced-fundamentals"/>
/// Only included with paid subscription plans.
/// Financial information is limited for some financial firms.
/// </summary>
/// <param name="symbol"></param>
/// <param name="period"></param>
/// <returns></returns>
Task<IEXResponse<AdvancedFundamentalsResponse>> AdvancedFundamentalsAsync(string symbol, Period period = Period.Quarter);

/// <summary>
/// <see cref="https://iexcloud.io/docs/api/#balance-sheet"/>
/// Only included with paid subscription plans.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ internal StockFundamentalsService(ExecutorREST executor)
this.executor = executor;
}

public async Task<IEXResponse<AdvancedFundamentalsResponse>> AdvancedFundamentalsAsync(string symbol, Period period = Period.Quarter)
{
const string urlPattern = "time-series/fundamentals/[symbol]/[period]";

var qsb = new QueryStringBuilder();

var pathNvc = new NameValueCollection
{
{"symbol", symbol},
{"period", period.GetDescriptionFromEnum()}
};

return await executor.ExecuteAsync<AdvancedFundamentalsResponse>(urlPattern, pathNvc, qsb);
}

public async Task<IEXResponse<BalanceSheetResponse>> BalanceSheetAsync(string symbol, Period period = Period.Quarter,
int last = 1)
{
Expand Down
19 changes: 17 additions & 2 deletions IEXSharpTest/Cloud/CoreData/StockFundamentalsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,29 @@ public void Setup()
};
}

[Test]
[TestCase("BEDU", Period.Annual)]
[TestCase("BEDU", Period.Quarter)]
[TestCase("CCM", Period.Quarter)]
[TestCase("AAPL", Period.Quarter)]
[TestCase("FB", Period.Quarter)]
public async Task AdvancedFundamentalsAsyncTest(string symbol, Period period = Period.Quarter)
{
var response = await sandBoxClient.StockFundamentals.AdvancedFundamentalsAsync(symbol, period);

Assert.IsNull(response.ErrorMessage);
Assert.IsNotNull(response.Data);
Assert.IsNotNull(response.Data.accountsPayable);
}


[Test]
[TestCase("BEDU", Period.Annual, 1)]
[TestCase("BEDU", Period.Quarter, 1)]
[TestCase("CCM", Period.Quarter, 1)]
[TestCase("AAPL", Period.Quarter, 1)]
[TestCase("FB", Period.Quarter, 2)]
public async Task BalanceSheetAsyncTest(string symbol, Period period = Period.Quarter,
int last = 1)
public async Task BalanceSheetAsyncTest(string symbol, Period period = Period.Quarter, int last = 1)
{
var response = await sandBoxClient.StockFundamentals.BalanceSheetAsync(symbol, period, last);
Assert.IsNull(response.ErrorMessage);
Expand Down

0 comments on commit 9d6809d

Please sign in to comment.