From 209c57ecabbb61a9278fbcf4af122f89ff9efd27 Mon Sep 17 00:00:00 2001 From: Tri Date: Sat, 24 Jul 2021 19:05:02 +0700 Subject: [PATCH] release 1.1.2 --- .gitignore | 14 + .openapi-generator-ignore | 2 + .openapi-generator/FILES | 203 + .openapi-generator/VERSION | 2 +- .travis.yml | 12 +- README.md | 21 +- composer.json | 23 +- docs/Api/DefaultApi.md | 2249 ++-- docs/Model/AggregateIndicators.md | 8 +- docs/Model/BasicFinancials.md | 11 +- docs/Model/BreakdownItem.md | 10 + docs/Model/Company.md | 20 +- docs/Model/CompanyExecutive.md | 8 +- docs/Model/CompanyNewsStatistics.md | 10 +- docs/Model/CompanyProfile.md | 60 +- docs/Model/CompanyProfile2.md | 28 +- docs/Model/CountryMetadata.md | 18 +- docs/Model/CovidInfo.md | 12 +- docs/Model/CryptoCandles.md | 20 +- docs/Model/CryptoSymbol.md | 10 +- docs/Model/Development.md | 13 +- docs/Model/Dividends.md | 20 +- docs/Model/Dividends2Basic.md | 10 + docs/Model/ETFCountryExposureData.md | 10 + docs/Model/ETFHoldingsData.md | 15 + docs/Model/ETFProfileData.md | 26 + docs/Model/ETFSectorExposureData.md | 10 + docs/Model/ETFsCountryExposure.md | 8 +- docs/Model/ETFsHoldings.md | 10 +- docs/Model/ETFsProfile.md | 8 +- docs/Model/ETFsSectorExposure.md | 10 + docs/Model/EarningEstimate.md | 14 +- docs/Model/EarningRelease.md | 22 +- docs/Model/EarningResult.md | 16 +- docs/Model/EarningsCalendar.md | 6 +- docs/Model/EarningsCallTranscripts.md | 22 +- docs/Model/EarningsCallTranscriptsList.md | 8 +- docs/Model/EarningsEstimates.md | 10 +- docs/Model/EconomicCalendar.md | 6 +- docs/Model/EconomicCode.md | 12 +- docs/Model/EconomicData.md | 8 +- docs/Model/EconomicEvent.md | 20 +- docs/Model/Estimate.md | 14 +- docs/Model/FDAComitteeMeeting.md | 12 + docs/Model/Filing.md | 20 +- docs/Model/FilingSentiment.md | 17 + docs/Model/FinancialStatements.md | 8 +- docs/Model/FinancialsAsReported.md | 10 +- docs/Model/ForexCandles.md | 20 +- docs/Model/ForexSymbol.md | 10 +- docs/Model/Forexrates.md | 8 +- docs/Model/FundOwnership.md | 8 +- docs/Model/HistoricalNBBO.md | 20 + docs/Model/IPOCalendar.md | 6 +- docs/Model/IPOEvent.md | 20 +- docs/Model/IndexHistoricalConstituent.md | 10 +- docs/Model/Indicator.md | 10 +- docs/Model/IndicesConstituents.md | 8 +- docs/Model/IndicesHistoricalConstituents.md | 8 +- docs/Model/InsiderTransactions.md | 10 + docs/Model/InternationalFiling.md | 17 + docs/Model/InvestmentThemePortfolio.md | 9 + .../InvestmentThemesThematicInvesting.md | 10 + docs/Model/Investor.md | 12 +- docs/Model/KeyCustomersSuppliers.md | 12 + docs/Model/LastBidAsk.md | 14 +- docs/Model/MajorPressReleases.md | 10 + docs/Model/MutualFundCountryExposureData.md | 10 + docs/Model/MutualFundSectorExposure.md | 10 + docs/Model/MutualFundSectorExposureData.md | 10 + docs/Model/MutualFundsCountryExposure.md | 10 + docs/Model/MutualFundsHoldings.md | 12 + docs/Model/MutualFundsProfile.md | 10 + docs/Model/News.md | 22 +- docs/Model/NewsSentiment.md | 18 +- docs/Model/Ownership.md | 10 + docs/Model/PatternRecognition.md | 6 +- docs/Model/PriceTarget.md | 18 +- docs/Model/Quote.md | 18 +- docs/Model/RecommendationTrend.md | 20 +- docs/Model/RedditSentimentContent.md | 15 + docs/Model/Report.md | 26 +- docs/Model/RevenueBreakdown.md | 11 + docs/Model/RevenueEstimates.md | 10 +- docs/Model/SECSentimentAnalysis.md | 12 + docs/Model/Sentiment.md | 8 +- docs/Model/SimilarityIndex.md | 10 +- docs/Model/SocialSentiment.md | 11 + docs/Model/Split.md | 12 +- docs/Model/Stock.md | 13 +- docs/Model/StockCandles.md | 20 +- docs/Model/StockTranscripts.md | 14 +- docs/Model/SupplyChainRelationships.md | 10 + docs/Model/SupportResistance.md | 6 +- docs/Model/SymbolLookup.md | 10 + docs/Model/TechnicalAnalysis.md | 8 +- docs/Model/TickData.md | 21 +- docs/Model/Transactions.md | 15 + docs/Model/TranscriptContent.md | 9 +- docs/Model/TranscriptParticipant.md | 9 +- docs/Model/Trend.md | 8 +- docs/Model/TwitterSentimentContent.md | 15 + docs/Model/UpgradeDowngrade.md | 18 +- lib/Api/DefaultApi.php | 9867 ++++++++++++----- lib/ApiException.php | 19 +- lib/Configuration.php | 46 +- lib/HeaderSelector.php | 7 +- lib/Model/AggregateIndicators.php | 45 +- lib/Model/BasicFinancials.php | 79 +- lib/Model/BreakdownItem.php | 350 + lib/Model/Company.php | 65 +- lib/Model/CompanyExecutive.php | 45 +- lib/Model/CompanyNewsStatistics.php | 49 +- lib/Model/CompanyProfile.php | 149 +- lib/Model/CompanyProfile2.php | 85 +- lib/Model/CountryMetadata.php | 61 +- lib/Model/CovidInfo.php | 53 +- lib/Model/CryptoCandles.php | 65 +- lib/Model/CryptoSymbol.php | 49 +- lib/Model/Development.php | 93 +- lib/Model/Dividends.php | 69 +- lib/Model/Dividends2Basic.php | 350 + lib/Model/ETFCountryExposureData.php | 350 + lib/Model/ETFHoldingsData.php | 500 + lib/Model/ETFProfileData.php | 830 ++ lib/Model/ETFSectorExposureData.php | 350 + lib/Model/ETFsCountryExposure.php | 69 +- lib/Model/ETFsHoldings.php | 105 +- lib/Model/ETFsProfile.php | 53 +- lib/Model/ETFsSectorExposure.php | 350 + lib/Model/EarningEstimate.php | 59 +- lib/Model/EarningRelease.php | 75 +- lib/Model/EarningResult.php | 113 +- lib/Model/EarningsCalendar.php | 41 +- lib/Model/EarningsCallTranscripts.php | 73 +- lib/Model/EarningsCallTranscriptsList.php | 45 +- lib/Model/EarningsEstimates.php | 49 +- lib/Model/EconomicCalendar.php | 41 +- lib/Model/EconomicCode.php | 53 +- lib/Model/EconomicData.php | 45 +- lib/Model/EconomicEvent.php | 69 +- lib/Model/Estimate.php | 59 +- lib/Model/FDAComitteeMeeting.php | 410 + lib/Model/Filing.php | 69 +- lib/Model/FilingSentiment.php | 560 + lib/Model/FinancialStatements.php | 45 +- lib/Model/FinancialsAsReported.php | 49 +- lib/Model/ForexCandles.php | 65 +- lib/Model/ForexSymbol.php | 49 +- lib/Model/Forexrates.php | 45 +- lib/Model/FundOwnership.php | 45 +- lib/Model/HistoricalNBBO.php | 650 ++ lib/Model/IPOCalendar.php | 41 +- lib/Model/IPOEvent.php | 69 +- lib/Model/IndexHistoricalConstituent.php | 49 +- lib/Model/Indicator.php | 49 +- lib/Model/IndicesConstituents.php | 45 +- lib/Model/IndicesHistoricalConstituents.php | 45 +- lib/Model/InsiderTransactions.php | 350 + lib/Model/InternationalFiling.php | 560 + lib/Model/InvestmentThemePortfolio.php | 320 + .../InvestmentThemesThematicInvesting.php | 350 + lib/Model/Investor.php | 53 +- lib/Model/KeyCustomersSuppliers.php | 410 + lib/Model/LastBidAsk.php | 57 +- lib/Model/MajorPressReleases.php | 350 + lib/Model/ModelInterface.php | 5 +- lib/Model/MutualFundCountryExposureData.php | 350 + lib/Model/MutualFundSectorExposure.php | 350 + lib/Model/MutualFundSectorExposureData.php | 350 + lib/Model/MutualFundsCountryExposure.php | 350 + lib/Model/MutualFundsHoldings.php | 410 + lib/Model/MutualFundsProfile.php | 350 + lib/Model/News.php | 73 +- lib/Model/NewsSentiment.php | 61 +- lib/Model/Ownership.php | 350 + lib/Model/PatternRecognition.php | 41 +- lib/Model/PriceTarget.php | 61 +- lib/Model/Quote.php | 127 +- lib/Model/RecommendationTrend.php | 65 +- lib/Model/RedditSentimentContent.php | 500 + lib/Model/Report.php | 81 +- lib/Model/RevenueBreakdown.php | 380 + lib/Model/RevenueEstimates.php | 49 +- lib/Model/SECSentimentAnalysis.php | 410 + lib/Model/Sentiment.php | 45 +- lib/Model/SimilarityIndex.php | 49 +- lib/Model/SocialSentiment.php | 380 + lib/Model/Split.php | 53 +- lib/Model/Stock.php | 93 +- lib/Model/StockCandles.php | 65 +- lib/Model/StockTranscripts.php | 57 +- lib/Model/SupplyChainRelationships.php | 350 + lib/Model/SupportResistance.php | 41 +- lib/Model/SymbolLookup.php | 350 + lib/Model/TechnicalAnalysis.php | 45 +- lib/Model/TickData.php | 111 +- lib/Model/Transactions.php | 500 + lib/Model/TranscriptContent.php | 85 +- lib/Model/TranscriptParticipant.php | 85 +- lib/Model/Trend.php | 45 +- lib/Model/TwitterSentimentContent.php | 500 + lib/Model/UpgradeDowngrade.php | 61 +- lib/ObjectSerializer.php | 102 +- test/Model/BreakdownItemTest.php | 99 + test/Model/Dividends2BasicTest.php | 99 + test/Model/ETFCountryExposureDataTest.php | 99 + test/Model/ETFHoldingsDataTest.php | 144 + test/Model/ETFProfileDataTest.php | 243 + test/Model/ETFSectorExposureDataTest.php | 99 + test/Model/ETFsSectorExposureTest.php | 99 + test/Model/FDAComitteeMeetingTest.php | 117 + test/Model/FilingSentimentTest.php | 162 + test/Model/HistoricalNBBOTest.php | 189 + test/Model/InsiderTransactionsTest.php | 99 + test/Model/InternationalFilingTest.php | 162 + test/Model/InvestmentThemePortfolioTest.php | 90 + .../InvestmentThemesThematicInvestingTest.php | 99 + test/Model/KeyCustomersSuppliersTest.php | 117 + test/Model/MajorPressReleasesTest.php | 99 + .../MutualFundCountryExposureDataTest.php | 99 + .../MutualFundSectorExposureDataTest.php | 99 + test/Model/MutualFundSectorExposureTest.php | 99 + test/Model/MutualFundsCountryExposureTest.php | 99 + test/Model/MutualFundsHoldingsTest.php | 117 + test/Model/MutualFundsProfileTest.php | 99 + test/Model/OwnershipTest.php | 99 + test/Model/RedditSentimentContentTest.php | 144 + test/Model/RevenueBreakdownTest.php | 108 + test/Model/SECSentimentAnalysisTest.php | 117 + test/Model/SocialSentimentTest.php | 108 + test/Model/SupplyChainRelationshipsTest.php | 99 + test/Model/SymbolLookupTest.php | 99 + test/Model/TransactionsTest.php | 144 + test/Model/TwitterSentimentContentTest.php | 144 + 235 files changed, 28699 insertions(+), 5774 deletions(-) create mode 100644 .gitignore create mode 100644 .openapi-generator/FILES create mode 100644 docs/Model/BreakdownItem.md create mode 100644 docs/Model/Dividends2Basic.md create mode 100644 docs/Model/ETFCountryExposureData.md create mode 100644 docs/Model/ETFHoldingsData.md create mode 100644 docs/Model/ETFProfileData.md create mode 100644 docs/Model/ETFSectorExposureData.md create mode 100644 docs/Model/ETFsSectorExposure.md create mode 100644 docs/Model/FDAComitteeMeeting.md create mode 100644 docs/Model/FilingSentiment.md create mode 100644 docs/Model/HistoricalNBBO.md create mode 100644 docs/Model/InsiderTransactions.md create mode 100644 docs/Model/InternationalFiling.md create mode 100644 docs/Model/InvestmentThemePortfolio.md create mode 100644 docs/Model/InvestmentThemesThematicInvesting.md create mode 100644 docs/Model/KeyCustomersSuppliers.md create mode 100644 docs/Model/MajorPressReleases.md create mode 100644 docs/Model/MutualFundCountryExposureData.md create mode 100644 docs/Model/MutualFundSectorExposure.md create mode 100644 docs/Model/MutualFundSectorExposureData.md create mode 100644 docs/Model/MutualFundsCountryExposure.md create mode 100644 docs/Model/MutualFundsHoldings.md create mode 100644 docs/Model/MutualFundsProfile.md create mode 100644 docs/Model/Ownership.md create mode 100644 docs/Model/RedditSentimentContent.md create mode 100644 docs/Model/RevenueBreakdown.md create mode 100644 docs/Model/SECSentimentAnalysis.md create mode 100644 docs/Model/SocialSentiment.md create mode 100644 docs/Model/SupplyChainRelationships.md create mode 100644 docs/Model/SymbolLookup.md create mode 100644 docs/Model/Transactions.md create mode 100644 docs/Model/TwitterSentimentContent.md create mode 100644 lib/Model/BreakdownItem.php create mode 100644 lib/Model/Dividends2Basic.php create mode 100644 lib/Model/ETFCountryExposureData.php create mode 100644 lib/Model/ETFHoldingsData.php create mode 100644 lib/Model/ETFProfileData.php create mode 100644 lib/Model/ETFSectorExposureData.php create mode 100644 lib/Model/ETFsSectorExposure.php create mode 100644 lib/Model/FDAComitteeMeeting.php create mode 100644 lib/Model/FilingSentiment.php create mode 100644 lib/Model/HistoricalNBBO.php create mode 100644 lib/Model/InsiderTransactions.php create mode 100644 lib/Model/InternationalFiling.php create mode 100644 lib/Model/InvestmentThemePortfolio.php create mode 100644 lib/Model/InvestmentThemesThematicInvesting.php create mode 100644 lib/Model/KeyCustomersSuppliers.php create mode 100644 lib/Model/MajorPressReleases.php create mode 100644 lib/Model/MutualFundCountryExposureData.php create mode 100644 lib/Model/MutualFundSectorExposure.php create mode 100644 lib/Model/MutualFundSectorExposureData.php create mode 100644 lib/Model/MutualFundsCountryExposure.php create mode 100644 lib/Model/MutualFundsHoldings.php create mode 100644 lib/Model/MutualFundsProfile.php create mode 100644 lib/Model/Ownership.php create mode 100644 lib/Model/RedditSentimentContent.php create mode 100644 lib/Model/RevenueBreakdown.php create mode 100644 lib/Model/SECSentimentAnalysis.php create mode 100644 lib/Model/SocialSentiment.php create mode 100644 lib/Model/SupplyChainRelationships.php create mode 100644 lib/Model/SymbolLookup.php create mode 100644 lib/Model/Transactions.php create mode 100644 lib/Model/TwitterSentimentContent.php create mode 100644 test/Model/BreakdownItemTest.php create mode 100644 test/Model/Dividends2BasicTest.php create mode 100644 test/Model/ETFCountryExposureDataTest.php create mode 100644 test/Model/ETFHoldingsDataTest.php create mode 100644 test/Model/ETFProfileDataTest.php create mode 100644 test/Model/ETFSectorExposureDataTest.php create mode 100644 test/Model/ETFsSectorExposureTest.php create mode 100644 test/Model/FDAComitteeMeetingTest.php create mode 100644 test/Model/FilingSentimentTest.php create mode 100644 test/Model/HistoricalNBBOTest.php create mode 100644 test/Model/InsiderTransactionsTest.php create mode 100644 test/Model/InternationalFilingTest.php create mode 100644 test/Model/InvestmentThemePortfolioTest.php create mode 100644 test/Model/InvestmentThemesThematicInvestingTest.php create mode 100644 test/Model/KeyCustomersSuppliersTest.php create mode 100644 test/Model/MajorPressReleasesTest.php create mode 100644 test/Model/MutualFundCountryExposureDataTest.php create mode 100644 test/Model/MutualFundSectorExposureDataTest.php create mode 100644 test/Model/MutualFundSectorExposureTest.php create mode 100644 test/Model/MutualFundsCountryExposureTest.php create mode 100644 test/Model/MutualFundsHoldingsTest.php create mode 100644 test/Model/MutualFundsProfileTest.php create mode 100644 test/Model/OwnershipTest.php create mode 100644 test/Model/RedditSentimentContentTest.php create mode 100644 test/Model/RevenueBreakdownTest.php create mode 100644 test/Model/SECSentimentAnalysisTest.php create mode 100644 test/Model/SocialSentimentTest.php create mode 100644 test/Model/SupplyChainRelationshipsTest.php create mode 100644 test/Model/SymbolLookupTest.php create mode 100644 test/Model/TransactionsTest.php create mode 100644 test/Model/TwitterSentimentContentTest.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92f7fde --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 7484ee5..f73f479 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +README.md +.openapi-generator-ignore diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..7126d65 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,203 @@ +.gitignore +.php_cs +.travis.yml +composer.json +docs/Api/DefaultApi.md +docs/Model/AggregateIndicators.md +docs/Model/BasicFinancials.md +docs/Model/BreakdownItem.md +docs/Model/Company.md +docs/Model/CompanyExecutive.md +docs/Model/CompanyNewsStatistics.md +docs/Model/CompanyProfile.md +docs/Model/CompanyProfile2.md +docs/Model/CountryMetadata.md +docs/Model/CovidInfo.md +docs/Model/CryptoCandles.md +docs/Model/CryptoSymbol.md +docs/Model/Development.md +docs/Model/Dividends.md +docs/Model/Dividends2Basic.md +docs/Model/ETFCountryExposureData.md +docs/Model/ETFHoldingsData.md +docs/Model/ETFProfileData.md +docs/Model/ETFSectorExposureData.md +docs/Model/ETFsCountryExposure.md +docs/Model/ETFsHoldings.md +docs/Model/ETFsProfile.md +docs/Model/ETFsSectorExposure.md +docs/Model/EarningEstimate.md +docs/Model/EarningRelease.md +docs/Model/EarningResult.md +docs/Model/EarningsCalendar.md +docs/Model/EarningsCallTranscripts.md +docs/Model/EarningsCallTranscriptsList.md +docs/Model/EarningsEstimates.md +docs/Model/EconomicCalendar.md +docs/Model/EconomicCode.md +docs/Model/EconomicData.md +docs/Model/EconomicEvent.md +docs/Model/Estimate.md +docs/Model/FDAComitteeMeeting.md +docs/Model/Filing.md +docs/Model/FilingSentiment.md +docs/Model/FinancialStatements.md +docs/Model/FinancialsAsReported.md +docs/Model/ForexCandles.md +docs/Model/ForexSymbol.md +docs/Model/Forexrates.md +docs/Model/FundOwnership.md +docs/Model/HistoricalNBBO.md +docs/Model/IPOCalendar.md +docs/Model/IPOEvent.md +docs/Model/IndexHistoricalConstituent.md +docs/Model/Indicator.md +docs/Model/IndicesConstituents.md +docs/Model/IndicesHistoricalConstituents.md +docs/Model/InsiderTransactions.md +docs/Model/InternationalFiling.md +docs/Model/InvestmentThemePortfolio.md +docs/Model/InvestmentThemesThematicInvesting.md +docs/Model/Investor.md +docs/Model/KeyCustomersSuppliers.md +docs/Model/LastBidAsk.md +docs/Model/MajorPressReleases.md +docs/Model/MutualFundCountryExposureData.md +docs/Model/MutualFundSectorExposure.md +docs/Model/MutualFundSectorExposureData.md +docs/Model/MutualFundsCountryExposure.md +docs/Model/MutualFundsHoldings.md +docs/Model/MutualFundsProfile.md +docs/Model/News.md +docs/Model/NewsSentiment.md +docs/Model/Ownership.md +docs/Model/PatternRecognition.md +docs/Model/PriceTarget.md +docs/Model/Quote.md +docs/Model/RecommendationTrend.md +docs/Model/RedditSentimentContent.md +docs/Model/Report.md +docs/Model/RevenueBreakdown.md +docs/Model/RevenueEstimates.md +docs/Model/SECSentimentAnalysis.md +docs/Model/Sentiment.md +docs/Model/SimilarityIndex.md +docs/Model/SocialSentiment.md +docs/Model/Split.md +docs/Model/Stock.md +docs/Model/StockCandles.md +docs/Model/StockTranscripts.md +docs/Model/SupplyChainRelationships.md +docs/Model/SupportResistance.md +docs/Model/SymbolLookup.md +docs/Model/TechnicalAnalysis.md +docs/Model/TickData.md +docs/Model/Transactions.md +docs/Model/TranscriptContent.md +docs/Model/TranscriptParticipant.md +docs/Model/Trend.md +docs/Model/TwitterSentimentContent.md +docs/Model/UpgradeDowngrade.md +git_push.sh +lib/Api/DefaultApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/AggregateIndicators.php +lib/Model/BasicFinancials.php +lib/Model/BreakdownItem.php +lib/Model/Company.php +lib/Model/CompanyExecutive.php +lib/Model/CompanyNewsStatistics.php +lib/Model/CompanyProfile.php +lib/Model/CompanyProfile2.php +lib/Model/CountryMetadata.php +lib/Model/CovidInfo.php +lib/Model/CryptoCandles.php +lib/Model/CryptoSymbol.php +lib/Model/Development.php +lib/Model/Dividends.php +lib/Model/Dividends2Basic.php +lib/Model/ETFCountryExposureData.php +lib/Model/ETFHoldingsData.php +lib/Model/ETFProfileData.php +lib/Model/ETFSectorExposureData.php +lib/Model/ETFsCountryExposure.php +lib/Model/ETFsHoldings.php +lib/Model/ETFsProfile.php +lib/Model/ETFsSectorExposure.php +lib/Model/EarningEstimate.php +lib/Model/EarningRelease.php +lib/Model/EarningResult.php +lib/Model/EarningsCalendar.php +lib/Model/EarningsCallTranscripts.php +lib/Model/EarningsCallTranscriptsList.php +lib/Model/EarningsEstimates.php +lib/Model/EconomicCalendar.php +lib/Model/EconomicCode.php +lib/Model/EconomicData.php +lib/Model/EconomicEvent.php +lib/Model/Estimate.php +lib/Model/FDAComitteeMeeting.php +lib/Model/Filing.php +lib/Model/FilingSentiment.php +lib/Model/FinancialStatements.php +lib/Model/FinancialsAsReported.php +lib/Model/ForexCandles.php +lib/Model/ForexSymbol.php +lib/Model/Forexrates.php +lib/Model/FundOwnership.php +lib/Model/HistoricalNBBO.php +lib/Model/IPOCalendar.php +lib/Model/IPOEvent.php +lib/Model/IndexHistoricalConstituent.php +lib/Model/Indicator.php +lib/Model/IndicesConstituents.php +lib/Model/IndicesHistoricalConstituents.php +lib/Model/InsiderTransactions.php +lib/Model/InternationalFiling.php +lib/Model/InvestmentThemePortfolio.php +lib/Model/InvestmentThemesThematicInvesting.php +lib/Model/Investor.php +lib/Model/KeyCustomersSuppliers.php +lib/Model/LastBidAsk.php +lib/Model/MajorPressReleases.php +lib/Model/ModelInterface.php +lib/Model/MutualFundCountryExposureData.php +lib/Model/MutualFundSectorExposure.php +lib/Model/MutualFundSectorExposureData.php +lib/Model/MutualFundsCountryExposure.php +lib/Model/MutualFundsHoldings.php +lib/Model/MutualFundsProfile.php +lib/Model/News.php +lib/Model/NewsSentiment.php +lib/Model/Ownership.php +lib/Model/PatternRecognition.php +lib/Model/PriceTarget.php +lib/Model/Quote.php +lib/Model/RecommendationTrend.php +lib/Model/RedditSentimentContent.php +lib/Model/Report.php +lib/Model/RevenueBreakdown.php +lib/Model/RevenueEstimates.php +lib/Model/SECSentimentAnalysis.php +lib/Model/Sentiment.php +lib/Model/SimilarityIndex.php +lib/Model/SocialSentiment.php +lib/Model/Split.php +lib/Model/Stock.php +lib/Model/StockCandles.php +lib/Model/StockTranscripts.php +lib/Model/SupplyChainRelationships.php +lib/Model/SupportResistance.php +lib/Model/SymbolLookup.php +lib/Model/TechnicalAnalysis.php +lib/Model/TickData.php +lib/Model/Transactions.php +lib/Model/TranscriptContent.php +lib/Model/TranscriptParticipant.php +lib/Model/Trend.php +lib/Model/TwitterSentimentContent.php +lib/Model/UpgradeDowngrade.php +lib/ObjectSerializer.php +phpunit.xml.dist diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index ecedc98..7cbea07 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1 \ No newline at end of file +5.2.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d77f382..b4b1d0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: php -sudo: false +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 7.2 + - 7.3 + - 7.4 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index 3074e2a..7e77a46 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Finnhub - Finnhub php api clent - API version: 1.0.0 -- Package version: 1.1.0 +- Package version: 1.1.2 ## Requirements @@ -103,7 +103,7 @@ print_r($client->forexSymbols('OANDA')); print_r($client->fundOwnership('AMZN', 5)); // General news -print_r($client->generalNews('forex', 0)); +print_r($client->marketNews('forex', 0)); // Investors ownership print_r($client->investorsOwnership('AAPL', 5)); @@ -112,7 +112,7 @@ print_r($client->investorsOwnership('AAPL', 5)); print_r($client->ipoCalendar("2020-05-01", "2020-06-01")); // Major developments -print_r($client->majorDevelopments('AAPL', "2020-01-01", "2020-12-31")); +print_r($client->pressReleases('AAPL', "2020-01-01", "2020-12-31")); // News sentiment print_r($client->newsSentiment('AAPL')); @@ -186,10 +186,23 @@ print_r($client->etfsProfile('SPY')) print_r($client->etfsHoldings('SPY')) // ETFs Industry Exposure -print_r($client->etfsIndustryExposure('SPY')) +print_r($client->etfsSectorExposure('SPY')) // ETFs Country Exposure print_r($client->etfsCountryExposure('SPY')) + +// Mutual Fund Profile +print_r($client->mutualFundProfile('VTSAX')) + +// Mutual Fund Holdings +print_r($client->mutualFundHoldings('VTSAX')) + +// Mutual Fund Sector Exposure +print_r($client->mutualFundSectorExposure('VTSAX')) + +// Mutual Fund Country Exposure +print_r($client->mutualFundCountryExposure('VTSAX')) + ?> ``` diff --git a/composer.json b/composer.json index d39a651..b3d5671 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "finnhub/client", - "version": "1.1.0", - "description": "Finnhub PHP api client", + "name": "GIT_USER_ID/GIT_REPO_ID", + "version": "1.1.2", + "description": "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)", "keywords": [ "openapitools", "openapi-generator", @@ -11,30 +11,29 @@ "rest", "api" ], - "homepage": "https://finnhub.io/", - "license": "Apache-2.0", + "homepage": "https://openapi-generator.tech", + "license": "unlicense", "authors": [ { - "name": "Finnhub", - "homepage": "https://finnhub.io/" + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^6.2" }, "require-dev": { - "phpunit/phpunit": "^7.4", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.12" + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12" }, "autoload": { "psr-4": { "Finnhub\\" : "lib/" } }, "autoload-dev": { - "psr-4": { "Finnhub\\" : "test/" } + "psr-4": { "Finnhub\\Test\\" : "test/" } } } diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index 2ae2db0..bdff85a 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -1,68 +1,84 @@ # Finnhub\DefaultApi -All URIs are relative to *https://finnhub.io/api/v1* +All URIs are relative to https://finnhub.io/api/v1. Method | HTTP request | Description ------------- | ------------- | ------------- -[**aggregateIndicator**](DefaultApi.md#aggregateIndicator) | **GET** /scan/technical-indicator | Aggregate Indicators -[**companyBasicFinancials**](DefaultApi.md#companyBasicFinancials) | **GET** /stock/metric | Basic Financials -[**companyEarnings**](DefaultApi.md#companyEarnings) | **GET** /stock/earnings | Earnings Surprises -[**companyEpsEstimates**](DefaultApi.md#companyEpsEstimates) | **GET** /stock/eps-estimate | Earnings Estimates -[**companyExecutive**](DefaultApi.md#companyExecutive) | **GET** /stock/executive | Company Executive -[**companyNews**](DefaultApi.md#companyNews) | **GET** /company-news | Company News -[**companyPeers**](DefaultApi.md#companyPeers) | **GET** /stock/peers | Peers -[**companyProfile**](DefaultApi.md#companyProfile) | **GET** /stock/profile | Company Profile -[**companyProfile2**](DefaultApi.md#companyProfile2) | **GET** /stock/profile2 | Company Profile 2 -[**companyRevenueEstimates**](DefaultApi.md#companyRevenueEstimates) | **GET** /stock/revenue-estimate | Revenue Estimates -[**country**](DefaultApi.md#country) | **GET** /country | Country Metadata -[**covid19**](DefaultApi.md#covid19) | **GET** /covid19/us | COVID-19 -[**cryptoCandles**](DefaultApi.md#cryptoCandles) | **GET** /crypto/candle | Crypto Candles -[**cryptoExchanges**](DefaultApi.md#cryptoExchanges) | **GET** /crypto/exchange | Crypto Exchanges -[**cryptoSymbols**](DefaultApi.md#cryptoSymbols) | **GET** /crypto/symbol | Crypto Symbol -[**earningsCalendar**](DefaultApi.md#earningsCalendar) | **GET** /calendar/earnings | Earnings Calendar -[**economicCode**](DefaultApi.md#economicCode) | **GET** /economic/code | Economic Code -[**economicData**](DefaultApi.md#economicData) | **GET** /economic | Economic Data -[**etfsCountryExposure**](DefaultApi.md#etfsCountryExposure) | **GET** /etf/country | ETFs Country Exposure -[**etfsHoldings**](DefaultApi.md#etfsHoldings) | **GET** /etf/holdings | ETFs Holdings -[**etfsIndustryExposure**](DefaultApi.md#etfsIndustryExposure) | **GET** /etf/sector | ETFs Industry Exposure -[**etfsProfile**](DefaultApi.md#etfsProfile) | **GET** /etf/profile | ETFs Profile -[**filings**](DefaultApi.md#filings) | **GET** /stock/filings | Filings -[**financials**](DefaultApi.md#financials) | **GET** /stock/financials | Financial Statements -[**financialsReported**](DefaultApi.md#financialsReported) | **GET** /stock/financials-reported | Financials As Reported -[**forexCandles**](DefaultApi.md#forexCandles) | **GET** /forex/candle | Forex Candles -[**forexExchanges**](DefaultApi.md#forexExchanges) | **GET** /forex/exchange | Forex Exchanges -[**forexRates**](DefaultApi.md#forexRates) | **GET** /forex/rates | Forex rates -[**forexSymbols**](DefaultApi.md#forexSymbols) | **GET** /forex/symbol | Forex Symbol -[**fundOwnership**](DefaultApi.md#fundOwnership) | **GET** /stock/fund-ownership | Fund Ownership -[**generalNews**](DefaultApi.md#generalNews) | **GET** /news | General News -[**indicesConstituents**](DefaultApi.md#indicesConstituents) | **GET** /index/constituents | Indices Constituents -[**indicesHistoricalConstituents**](DefaultApi.md#indicesHistoricalConstituents) | **GET** /index/historical-constituents | Indices Historical Constituents -[**investorsOwnership**](DefaultApi.md#investorsOwnership) | **GET** /stock/investor-ownership | Investors Ownership -[**ipoCalendar**](DefaultApi.md#ipoCalendar) | **GET** /calendar/ipo | IPO Calendar -[**majorDevelopments**](DefaultApi.md#majorDevelopments) | **GET** /major-development | Major Developments -[**newsSentiment**](DefaultApi.md#newsSentiment) | **GET** /news-sentiment | News Sentiment -[**patternRecognition**](DefaultApi.md#patternRecognition) | **GET** /scan/pattern | Pattern Recognition -[**priceTarget**](DefaultApi.md#priceTarget) | **GET** /stock/price-target | Price Target -[**quote**](DefaultApi.md#quote) | **GET** /quote | Quote -[**recommendationTrends**](DefaultApi.md#recommendationTrends) | **GET** /stock/recommendation | Recommendation Trends -[**similarityIndex**](DefaultApi.md#similarityIndex) | **GET** /stock/similarity-index | Similarity Index -[**stockBidask**](DefaultApi.md#stockBidask) | **GET** /stock/bidask | Last Bid-Ask -[**stockCandles**](DefaultApi.md#stockCandles) | **GET** /stock/candle | Stock Candles -[**stockDividends**](DefaultApi.md#stockDividends) | **GET** /stock/dividend | Dividends -[**stockSplits**](DefaultApi.md#stockSplits) | **GET** /stock/split | Splits -[**stockSymbols**](DefaultApi.md#stockSymbols) | **GET** /stock/symbol | Stock Symbol -[**stockTick**](DefaultApi.md#stockTick) | **GET** /stock/tick | Tick Data -[**supportResistance**](DefaultApi.md#supportResistance) | **GET** /scan/support-resistance | Support/Resistance -[**technicalIndicator**](DefaultApi.md#technicalIndicator) | **POST** /indicator | Technical Indicators -[**transcripts**](DefaultApi.md#transcripts) | **GET** /stock/transcripts | Earnings Call Transcripts -[**transcriptsList**](DefaultApi.md#transcriptsList) | **GET** /stock/transcripts/list | Earnings Call Transcripts List -[**upgradeDowngrade**](DefaultApi.md#upgradeDowngrade) | **GET** /stock/upgrade-downgrade | Stock Upgrade/Downgrade - - - -## aggregateIndicator - -> \Finnhub\Model\AggregateIndicators aggregateIndicator($symbol, $resolution) +[**aggregateIndicator()**](DefaultApi.md#aggregateIndicator) | **GET** /scan/technical-indicator | Aggregate Indicators +[**companyBasicFinancials()**](DefaultApi.md#companyBasicFinancials) | **GET** /stock/metric | Basic Financials +[**companyEarnings()**](DefaultApi.md#companyEarnings) | **GET** /stock/earnings | Earnings Surprises +[**companyEpsEstimates()**](DefaultApi.md#companyEpsEstimates) | **GET** /stock/eps-estimate | Earnings Estimates +[**companyExecutive()**](DefaultApi.md#companyExecutive) | **GET** /stock/executive | Company Executive +[**companyNews()**](DefaultApi.md#companyNews) | **GET** /company-news | Company News +[**companyPeers()**](DefaultApi.md#companyPeers) | **GET** /stock/peers | Peers +[**companyProfile()**](DefaultApi.md#companyProfile) | **GET** /stock/profile | Company Profile +[**companyProfile2()**](DefaultApi.md#companyProfile2) | **GET** /stock/profile2 | Company Profile 2 +[**companyRevenueEstimates()**](DefaultApi.md#companyRevenueEstimates) | **GET** /stock/revenue-estimate | Revenue Estimates +[**country()**](DefaultApi.md#country) | **GET** /country | Country Metadata +[**covid19()**](DefaultApi.md#covid19) | **GET** /covid19/us | COVID-19 +[**cryptoCandles()**](DefaultApi.md#cryptoCandles) | **GET** /crypto/candle | Crypto Candles +[**cryptoExchanges()**](DefaultApi.md#cryptoExchanges) | **GET** /crypto/exchange | Crypto Exchanges +[**cryptoSymbols()**](DefaultApi.md#cryptoSymbols) | **GET** /crypto/symbol | Crypto Symbol +[**earningsCalendar()**](DefaultApi.md#earningsCalendar) | **GET** /calendar/earnings | Earnings Calendar +[**earningsCallTranscriptsApi()**](DefaultApi.md#earningsCallTranscriptsApi) | **GET** /stock/transcripts | Earnings Call Transcripts +[**economicCode()**](DefaultApi.md#economicCode) | **GET** /economic/code | Economic Code +[**economicData()**](DefaultApi.md#economicData) | **GET** /economic | Economic Data +[**etfsCountryExposure()**](DefaultApi.md#etfsCountryExposure) | **GET** /etf/country | ETFs Country Exposure +[**etfsHoldings()**](DefaultApi.md#etfsHoldings) | **GET** /etf/holdings | ETFs Holdings +[**etfsProfile()**](DefaultApi.md#etfsProfile) | **GET** /etf/profile | ETFs Profile +[**etfsSectorExposure()**](DefaultApi.md#etfsSectorExposure) | **GET** /etf/sector | ETFs Sector Exposure +[**fdaCommitteeMeetingCalendar()**](DefaultApi.md#fdaCommitteeMeetingCalendar) | **GET** /fda-advisory-committee-calendar | FDA Committee Meeting Calendar +[**filings()**](DefaultApi.md#filings) | **GET** /stock/filings | SEC Filings +[**filingsSentiment()**](DefaultApi.md#filingsSentiment) | **GET** /stock/filings-sentiment | SEC Sentiment Analysis +[**financials()**](DefaultApi.md#financials) | **GET** /stock/financials | Financial Statements +[**financialsReported()**](DefaultApi.md#financialsReported) | **GET** /stock/financials-reported | Financials As Reported +[**forexCandles()**](DefaultApi.md#forexCandles) | **GET** /forex/candle | Forex Candles +[**forexExchanges()**](DefaultApi.md#forexExchanges) | **GET** /forex/exchange | Forex Exchanges +[**forexRates()**](DefaultApi.md#forexRates) | **GET** /forex/rates | Forex rates +[**forexSymbols()**](DefaultApi.md#forexSymbols) | **GET** /forex/symbol | Forex Symbol +[**fundOwnership()**](DefaultApi.md#fundOwnership) | **GET** /stock/fund-ownership | Fund Ownership +[**indicesConstituents()**](DefaultApi.md#indicesConstituents) | **GET** /index/constituents | Indices Constituents +[**indicesHistoricalConstituents()**](DefaultApi.md#indicesHistoricalConstituents) | **GET** /index/historical-constituents | Indices Historical Constituents +[**insiderTransactions()**](DefaultApi.md#insiderTransactions) | **GET** /stock/insider-transactions | Insider Transactions +[**internationalFilings()**](DefaultApi.md#internationalFilings) | **GET** /stock/international-filings | International Filings +[**investmentThemesThematicInvesting()**](DefaultApi.md#investmentThemesThematicInvesting) | **GET** /stock/investment-theme | Investment Themes (Thematic Investing) +[**ipoCalendar()**](DefaultApi.md#ipoCalendar) | **GET** /calendar/ipo | IPO Calendar +[**marketNews()**](DefaultApi.md#marketNews) | **GET** /news | Market News +[**mutualFundCountryExposure()**](DefaultApi.md#mutualFundCountryExposure) | **GET** /mutual-fund/country | Mutual Funds Country Exposure +[**mutualFundHoldings()**](DefaultApi.md#mutualFundHoldings) | **GET** /mutual-fund/holdings | Mutual Funds Holdings +[**mutualFundProfile()**](DefaultApi.md#mutualFundProfile) | **GET** /mutual-fund/profile | Mutual Funds Profile +[**mutualFundSectorExposure()**](DefaultApi.md#mutualFundSectorExposure) | **GET** /mutual-fund/sector | Mutual-fund Sector Exposure +[**newsSentiment()**](DefaultApi.md#newsSentiment) | **GET** /news-sentiment | News Sentiment +[**ownership()**](DefaultApi.md#ownership) | **GET** /stock/ownership | Ownership +[**patternRecognition()**](DefaultApi.md#patternRecognition) | **GET** /scan/pattern | Pattern Recognition +[**pressReleases()**](DefaultApi.md#pressReleases) | **GET** /press-releases | Major Press Releases +[**priceTarget()**](DefaultApi.md#priceTarget) | **GET** /stock/price-target | Price Target +[**quote()**](DefaultApi.md#quote) | **GET** /quote | Quote +[**recommendationTrends()**](DefaultApi.md#recommendationTrends) | **GET** /stock/recommendation | Recommendation Trends +[**revenueBreakdown()**](DefaultApi.md#revenueBreakdown) | **GET** /stock/revenue-breakdown | Revenue Breakdown +[**similarityIndex()**](DefaultApi.md#similarityIndex) | **GET** /stock/similarity-index | Similarity Index +[**socialSentiment()**](DefaultApi.md#socialSentiment) | **GET** /stock/social-sentiment | Social Sentiment +[**stockBasicDividends()**](DefaultApi.md#stockBasicDividends) | **GET** /stock/dividend2 | Dividends 2 (Basic) +[**stockBidask()**](DefaultApi.md#stockBidask) | **GET** /stock/bidask | Last Bid-Ask +[**stockCandles()**](DefaultApi.md#stockCandles) | **GET** /stock/candle | Stock Candles +[**stockDividends()**](DefaultApi.md#stockDividends) | **GET** /stock/dividend | Dividends +[**stockNbbo()**](DefaultApi.md#stockNbbo) | **GET** /stock/bbo | Historical NBBO +[**stockSplits()**](DefaultApi.md#stockSplits) | **GET** /stock/split | Splits +[**stockSymbols()**](DefaultApi.md#stockSymbols) | **GET** /stock/symbol | Stock Symbol +[**stockTick()**](DefaultApi.md#stockTick) | **GET** /stock/tick | Tick Data +[**supplyChainRelationships()**](DefaultApi.md#supplyChainRelationships) | **GET** /stock/supply-chain | Supply Chain Relationships +[**supportResistance()**](DefaultApi.md#supportResistance) | **GET** /scan/support-resistance | Support/Resistance +[**symbolSearch()**](DefaultApi.md#symbolSearch) | **GET** /search | Symbol Lookup +[**technicalIndicator()**](DefaultApi.md#technicalIndicator) | **POST** /indicator | Technical Indicators +[**transcriptsList()**](DefaultApi.md#transcriptsList) | **GET** /stock/transcripts/list | Earnings Call Transcripts List +[**upgradeDowngrade()**](DefaultApi.md#upgradeDowngrade) | **GET** /stock/upgrade-downgrade | Stock Upgrade/Downgrade + + +## `aggregateIndicator()` + +```php +aggregateIndicator($symbol, $resolution): \Finnhub\Model\AggregateIndicators +``` Aggregate Indicators @@ -96,12 +112,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->aggregateIndicator: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| symbol | @@ -118,16 +132,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyBasicFinancials()` -## companyBasicFinancials - -> \Finnhub\Model\BasicFinancials companyBasicFinancials($symbol, $metric) +```php +companyBasicFinancials($symbol, $metric): \Finnhub\Model\BasicFinancials +``` Basic Financials @@ -153,7 +168,7 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | Symbol of the company: AAPL. -$metric = 'metric_example'; // string | Metric type. Can be 1 of the following values all, price, valuation, margin +$metric = 'metric_example'; // string | Metric type. Can be 1 of the following values all try { $result = $apiInstance->companyBasicFinancials($symbol, $metric); @@ -161,16 +176,14 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyBasicFinancials: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | - **metric** | **string**| Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> | + **metric** | **string**| Metric type. Can be 1 of the following values <code>all</code> | ### Return type @@ -183,16 +196,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyEarnings()` -## companyEarnings - -> \Finnhub\Model\EarningResult[] companyEarnings($symbol, $limit) +```php +companyEarnings($symbol, $limit): \Finnhub\Model\EarningResult[] +``` Earnings Surprises @@ -226,12 +240,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyEarnings: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -248,16 +260,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyEpsEstimates()` -## companyEpsEstimates - -> \Finnhub\Model\EarningsEstimates companyEpsEstimates($symbol, $freq) +```php +companyEpsEstimates($symbol, $freq): \Finnhub\Model\EarningsEstimates +``` Earnings Estimates @@ -291,12 +304,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyEpsEstimates: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -313,16 +324,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyExecutive()` -## companyExecutive - -> \Finnhub\Model\CompanyExecutive companyExecutive($symbol) +```php +companyExecutive($symbol): \Finnhub\Model\CompanyExecutive +``` Company Executive @@ -355,12 +367,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyExecutive: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -376,16 +386,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyNews()` -## companyNews - -> \Finnhub\Model\News[] companyNews($symbol, $from, $to) +```php +companyNews($symbol, $from, $to): \Finnhub\Model\News[] +``` Company News @@ -420,12 +431,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyNews: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Company symbol. | @@ -443,16 +452,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyPeers()` -## companyPeers - -> string[] companyPeers($symbol) +```php +companyPeers($symbol): string[] +``` Peers @@ -485,12 +495,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyPeers: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -506,16 +514,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyProfile()` -## companyProfile - -> \Finnhub\Model\CompanyProfile companyProfile($symbol, $isin, $cusip) +```php +companyProfile($symbol, $isin, $cusip): \Finnhub\Model\CompanyProfile +``` Company Profile @@ -550,12 +559,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyProfile: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL e.g. | [optional] @@ -573,16 +580,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyProfile2()` -## companyProfile2 - -> \Finnhub\Model\CompanyProfile2 companyProfile2($symbol, $isin, $cusip) +```php +companyProfile2($symbol, $isin, $cusip): \Finnhub\Model\CompanyProfile2 +``` Company Profile 2 @@ -617,12 +625,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyProfile2: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL e.g. | [optional] @@ -640,16 +646,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `companyRevenueEstimates()` -## companyRevenueEstimates - -> \Finnhub\Model\RevenueEstimates companyRevenueEstimates($symbol, $freq) +```php +companyRevenueEstimates($symbol, $freq): \Finnhub\Model\RevenueEstimates +``` Revenue Estimates @@ -683,12 +690,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->companyRevenueEstimates: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -705,16 +710,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `country()` -## country - -> \Finnhub\Model\CountryMetadata[] country() +```php +country(): \Finnhub\Model\CountryMetadata[] +``` Country Metadata @@ -746,7 +752,6 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->country: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -764,16 +769,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `covid19()` -## covid19 - -> \Finnhub\Model\CovidInfo[] covid19() +```php +covid19(): \Finnhub\Model\CovidInfo[] +``` COVID-19 @@ -805,7 +811,6 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->covid19: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -823,16 +828,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `cryptoCandles()` -## cryptoCandles - -> \Finnhub\Model\CryptoCandles cryptoCandles($symbol, $resolution, $from, $to) +```php +cryptoCandles($symbol, $resolution, $from, $to): \Finnhub\Model\CryptoCandles +``` Crypto Candles @@ -868,12 +874,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->cryptoCandles: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Use symbol returned in <code>/crypto/symbol</code> endpoint for this field. | @@ -892,16 +896,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `cryptoExchanges()` -## cryptoExchanges - -> string[] cryptoExchanges() +```php +cryptoExchanges(): string[] +``` Crypto Exchanges @@ -933,7 +938,6 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->cryptoExchanges: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -951,16 +955,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `cryptoSymbols()` -## cryptoSymbols - -> \Finnhub\Model\CryptoSymbol[] cryptoSymbols($exchange) +```php +cryptoSymbols($exchange): \Finnhub\Model\CryptoSymbol[] +``` Crypto Symbol @@ -993,12 +998,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->cryptoSymbols: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **exchange** | **string**| Exchange you want to get the list of symbols from. | @@ -1014,20 +1017,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `earningsCalendar()` -## earningsCalendar - -> \Finnhub\Model\EarningsCalendar earningsCalendar($from, $to, $symbol, $international) +```php +earningsCalendar($from, $to, $symbol, $international): \Finnhub\Model\EarningsCalendar +``` Earnings Calendar -Get historical and coming earnings release dating back to 2003. You can setup webhook to receive real-time earnings update. +Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts. ### Example @@ -1059,12 +1063,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->earningsCalendar: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **\DateTime**| From date: 2020-03-15. | [optional] @@ -1083,16 +1085,79 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `earningsCallTranscriptsApi()` + +```php +earningsCallTranscriptsApi($id): \Finnhub\Model\EarningsCallTranscripts +``` + +Earnings Call Transcripts + +

Get earnings call transcripts, audio and participants' list. This endpoint is only available for US, UK, and Candian companies.

15+ years of data is available with 220,000+ audio which add up to 7TB in size.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Transcript's id obtained with Transcripts List endpoint. + +try { + $result = $apiInstance->earningsCallTranscriptsApi($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->earningsCallTranscriptsApi: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. | + +### Return type + +[**\Finnhub\Model\EarningsCallTranscripts**](../Model/EarningsCallTranscripts.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -## economicCode +## `economicCode()` -> \Finnhub\Model\EconomicCode[] economicCode() +```php +economicCode(): \Finnhub\Model\EconomicCode[] +``` Economic Code @@ -1124,7 +1189,6 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->economicCode: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -1142,16 +1206,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `economicData()` -## economicData - -> \Finnhub\Model\EconomicData economicData($code) +```php +economicData($code): \Finnhub\Model\EconomicData +``` Economic Data @@ -1184,12 +1249,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->economicData: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **string**| Economic code. | @@ -1205,16 +1268,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `etfsCountryExposure()` -## etfsCountryExposure - -> \Finnhub\Model\ETFsCountryExposure etfsCountryExposure($symbol) +```php +etfsCountryExposure($symbol): \Finnhub\Model\ETFsCountryExposure +``` ETFs Country Exposure @@ -1247,12 +1311,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->etfsCountryExposure: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| ETF symbol. | @@ -1268,20 +1330,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `etfsHoldings()` -## etfsHoldings - -> \Finnhub\Model\ETFsHoldings etfsHoldings($symbol) +```php +etfsHoldings($symbol, $isin, $skip): \Finnhub\Model\ETFsHoldings +``` ETFs Holdings -Get current ETF holdings. +Get full ETF holdings/constituents. This endpoint has global coverage. Widget only shows top 10 holdings. ### Example @@ -1303,22 +1366,24 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | ETF symbol. +$isin = 'isin_example'; // string | ETF isin. +$skip = 56; // int | Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. try { - $result = $apiInstance->etfsHoldings($symbol); + $result = $apiInstance->etfsHoldings($symbol, $isin, $skip); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->etfsHoldings: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| ETF symbol. | + **symbol** | **string**| ETF symbol. | [optional] + **isin** | **string**| ETF isin. | [optional] + **skip** | **int**| Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. | [optional] ### Return type @@ -1331,20 +1396,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `etfsProfile()` -## etfsIndustryExposure - -> \Finnhub\Model\ETFsIndustryExposure etfsIndustryExposure($symbol) +```php +etfsProfile($symbol, $isin): \Finnhub\Model\ETFsProfile +``` -ETFs Industry Exposure +ETFs Profile -Get ETF industry exposure data. +Get ETF profile information. This endpoint has global coverage. ### Example @@ -1366,26 +1432,26 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | ETF symbol. +$isin = 'isin_example'; // string | ETF isin. try { - $result = $apiInstance->etfsIndustryExposure($symbol); + $result = $apiInstance->etfsProfile($symbol, $isin); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->etfsIndustryExposure: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->etfsProfile: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| ETF symbol. | + **symbol** | **string**| ETF symbol. | [optional] + **isin** | **string**| ETF isin. | [optional] ### Return type -[**\Finnhub\Model\ETFsIndustryExposure**](../Model/ETFsIndustryExposure.md) +[**\Finnhub\Model\ETFsProfile**](../Model/ETFsProfile.md) ### Authorization @@ -1394,20 +1460,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `etfsSectorExposure()` -## etfsProfile - -> \Finnhub\Model\ETFsProfile etfsProfile($symbol) +```php +etfsSectorExposure($symbol): \Finnhub\Model\ETFsSectorExposure +``` -ETFs Profile +ETFs Sector Exposure -Get ETF profile information. Currently support all US ETFs. +Get ETF sector exposure data. ### Example @@ -1431,24 +1498,22 @@ $apiInstance = new Finnhub\Api\DefaultApi( $symbol = 'symbol_example'; // string | ETF symbol. try { - $result = $apiInstance->etfsProfile($symbol); + $result = $apiInstance->etfsSectorExposure($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->etfsProfile: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->etfsSectorExposure: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| ETF symbol. | ### Return type -[**\Finnhub\Model\ETFsProfile**](../Model/ETFsProfile.md) +[**\Finnhub\Model\ETFsSectorExposure**](../Model/ETFsSectorExposure.md) ### Authorization @@ -1457,18 +1522,78 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fdaCommitteeMeetingCalendar()` + +```php +fdaCommitteeMeetingCalendar(): \Finnhub\Model\FDAComitteeMeeting[] +``` + +FDA Committee Meeting Calendar + +FDA's advisory committees are established to provide functions which support the agency's mission of protecting and promoting the public health, while meeting the requirements set forth in the Federal Advisory Committee Act. Committees are either mandated by statute or established at the discretion of the Department of Health and Human Services. Each committee is subject to renewal at two-year intervals unless the committee charter states otherwise. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->fdaCommitteeMeetingCalendar(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->fdaCommitteeMeetingCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Finnhub\Model\FDAComitteeMeeting[]**](../Model/FDAComitteeMeeting.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -## filings +## `filings()` -> \Finnhub\Model\Filing[] filings($symbol, $cik, $access_number, $form, $from, $to) +```php +filings($symbol, $cik, $access_number, $form, $from, $to): \Finnhub\Model\Filing[] +``` -Filings +SEC Filings List company's filing. Limit to 250 documents at a time. This data is available for bulk download on Kaggle SEC Filings database. @@ -1504,12 +1629,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->filings: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. | [optional] @@ -1530,20 +1653,83 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `filingsSentiment()` + +```php +filingsSentiment($access_number): \Finnhub\Model\SECSentimentAnalysis +``` + +SEC Sentiment Analysis + +Get sentiment analysis of 10-K and 10-Q filings from SEC. An abnormal increase in the number of positive/negative words in filings can signal a significant change in the company's stock price in the upcoming 4 quarters. We make use of Loughran and McDonald Sentiment Word Lists to calculate the sentiment for each filing. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$access_number = 'access_number_example'; // string | Access number of a specific report you want to retrieve data from. + +try { + $result = $apiInstance->filingsSentiment($access_number); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->filingsSentiment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **access_number** | **string**| Access number of a specific report you want to retrieve data from. | + +### Return type + +[**\Finnhub\Model\SECSentimentAnalysis**](../Model/SECSentimentAnalysis.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -## financials +## `financials()` -> \Finnhub\Model\FinancialStatements financials($symbol, $statement, $freq) +```php +financials($symbol, $statement, $freq): \Finnhub\Model\FinancialStatements +``` Financial Statements -Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years. +

Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years. Data is sourced from original filings most of which made available through SEC Filings and International Filings endpoints.

Wondering why our standardized data is different from Bloomberg, Reuters, Factset, S&P or Yahoo Finance ? Check out our FAQ page to learn more

### Example @@ -1574,12 +1760,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->financials: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -1597,16 +1781,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `financialsReported()` -## financialsReported - -> \Finnhub\Model\FinancialsAsReported financialsReported($symbol, $cik, $access_number, $freq) +```php +financialsReported($symbol, $cik, $access_number, $freq): \Finnhub\Model\FinancialsAsReported +``` Financials As Reported @@ -1642,12 +1827,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->financialsReported: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol. | [optional] @@ -1666,16 +1849,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `forexCandles()` -## forexCandles - -> \Finnhub\Model\ForexCandles forexCandles($symbol, $resolution, $from, $to) +```php +forexCandles($symbol, $resolution, $from, $to): \Finnhub\Model\ForexCandles +``` Forex Candles @@ -1711,12 +1895,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->forexCandles: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Use symbol returned in <code>/forex/symbol</code> endpoint for this field. | @@ -1735,16 +1917,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `forexExchanges()` -## forexExchanges - -> string[] forexExchanges() +```php +forexExchanges(): string[] +``` Forex Exchanges @@ -1776,7 +1959,6 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->forexExchanges: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters @@ -1794,16 +1976,17 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `forexRates()` -## forexRates - -> \Finnhub\Model\Forexrates forexRates($base) +```php +forexRates($base): \Finnhub\Model\Forexrates +``` Forex rates @@ -1836,12 +2019,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->forexRates: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **base** | **string**| Base currency. Default to EUR. | [optional] @@ -1857,16 +2038,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `forexSymbols()` -## forexSymbols - -> \Finnhub\Model\ForexSymbol[] forexSymbols($exchange) +```php +forexSymbols($exchange): \Finnhub\Model\ForexSymbol[] +``` Forex Symbol @@ -1899,12 +2081,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->forexSymbols: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **exchange** | **string**| Exchange you want to get the list of symbols from. | @@ -1920,20 +2100,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `fundOwnership()` -## fundOwnership - -> \Finnhub\Model\FundOwnership fundOwnership($symbol, $limit) +```php +fundOwnership($symbol, $limit): \Finnhub\Model\FundOwnership +``` Fund Ownership -Get a full list fund and institutional investors of a company in descending order of the number of shares held. +Get a full list fund and institutional investors of a company in descending order of the number of shares held. Data is sourced from 13F form, Schedule 13D and 13G for US market, UK Share Register for UK market, SEDI for Canadian market and equivalent filings for other international markets. ### Example @@ -1963,12 +2144,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->fundOwnership: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. | @@ -1985,20 +2164,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `indicesConstituents()` -## generalNews - -> \Finnhub\Model\News[] generalNews($category, $min_id) +```php +indicesConstituents($symbol): \Finnhub\Model\IndicesConstituents +``` -General News +Indices Constituents -Get latest market news. +Get a list of index's constituents. A list of supported indices for this endpoint can be found here. ### Example @@ -2019,29 +2199,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$category = 'category_example'; // string | This parameter can be 1 of the following values general, forex, crypto, merger. -$min_id = 'min_id_example'; // string | Use this field to get only news after this ID. Default to 0 +$symbol = 'symbol_example'; // string | symbol try { - $result = $apiInstance->generalNews($category, $min_id); + $result = $apiInstance->indicesConstituents($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->generalNews: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->indicesConstituents: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **category** | **string**| This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. | - **min_id** | **string**| Use this field to get only news after this ID. Default to 0 | [optional] + **symbol** | **string**| symbol | ### Return type -[**\Finnhub\Model\News[]**](../Model/News.md) +[**\Finnhub\Model\IndicesConstituents**](../Model/IndicesConstituents.md) ### Authorization @@ -2050,20 +2226,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `indicesHistoricalConstituents()` -## indicesConstituents - -> \Finnhub\Model\IndicesConstituents indicesConstituents($symbol) +```php +indicesHistoricalConstituents($symbol): \Finnhub\Model\IndicesHistoricalConstituents +``` -Indices Constituents +Indices Historical Constituents -Get a list of index's constituents. Currently support ^GSPC (S&P 500), ^NDX (Nasdaq 100), ^DJI (Dow Jones) +Get full history of index's constituents including symbols and dates of joining and leaving the Index. Currently support ^GSPC (S&P 500), ^NDX (Nasdaq 100), ^DJI (Dow Jones) ### Example @@ -2087,24 +2264,22 @@ $apiInstance = new Finnhub\Api\DefaultApi( $symbol = 'symbol_example'; // string | symbol try { - $result = $apiInstance->indicesConstituents($symbol); + $result = $apiInstance->indicesHistoricalConstituents($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->indicesConstituents: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->indicesHistoricalConstituents: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| symbol | ### Return type -[**\Finnhub\Model\IndicesConstituents**](../Model/IndicesConstituents.md) +[**\Finnhub\Model\IndicesHistoricalConstituents**](../Model/IndicesHistoricalConstituents.md) ### Authorization @@ -2113,20 +2288,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `insiderTransactions()` -## indicesHistoricalConstituents - -> \Finnhub\Model\IndicesHistoricalConstituents indicesHistoricalConstituents($symbol) +```php +insiderTransactions($symbol, $from, $to): \Finnhub\Model\InsiderTransactions +``` -Indices Historical Constituents +Insider Transactions -Get full history of index's constituents including symbols and dates of joining and leaving the Index. Currently support ^GSPC (S&P 500), ^NDX (Nasdaq 100), ^DJI (Dow Jones) +Company insider transactions data sourced from Form 3,4,5. This endpoint only covers US companies at the moment. Limit to 100 transactions per API call. ### Example @@ -2147,27 +2323,29 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | symbol +$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From date: 2020-03-15. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To date: 2020-03-16. try { - $result = $apiInstance->indicesHistoricalConstituents($symbol); + $result = $apiInstance->insiderTransactions($symbol, $from, $to); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->indicesHistoricalConstituents: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->insiderTransactions: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| symbol | + **symbol** | **string**| Symbol of the company: AAPL. | + **from** | **\DateTime**| From date: 2020-03-15. | [optional] + **to** | **\DateTime**| To date: 2020-03-16. | [optional] ### Return type -[**\Finnhub\Model\IndicesHistoricalConstituents**](../Model/IndicesHistoricalConstituents.md) +[**\Finnhub\Model\InsiderTransactions**](../Model/InsiderTransactions.md) ### Authorization @@ -2176,20 +2354,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `internationalFilings()` -## investorsOwnership - -> \Finnhub\Model\InvestorsOwnership investorsOwnership($symbol, $limit) +```php +internationalFilings($symbol, $country): \Finnhub\Model\InternationalFiling[] +``` -Investors Ownership +International Filings -Get a full list of shareholders/investors of a company in descending order of the number of shares held. +List filings for international companies which covers 95%+ of global market cap. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. ### Example @@ -2210,29 +2389,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. -$limit = 56; // int | Limit number of results. Leave empty to get the full list. +$symbol = 'symbol_example'; // string | Symbol. Leave empty to list latest filings. +$country = 'country_example'; // string | Filter by country using country's 2-letter code. try { - $result = $apiInstance->investorsOwnership($symbol, $limit); + $result = $apiInstance->internationalFilings($symbol, $country); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->investorsOwnership: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->internationalFilings: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol of the company: AAPL. | - **limit** | **int**| Limit number of results. Leave empty to get the full list. | [optional] + **symbol** | **string**| Symbol. Leave empty to list latest filings. | [optional] + **country** | **string**| Filter by country using country's 2-letter code. | [optional] ### Return type -[**\Finnhub\Model\InvestorsOwnership**](../Model/InvestorsOwnership.md) +[**\Finnhub\Model\InternationalFiling[]**](../Model/InternationalFiling.md) ### Authorization @@ -2241,20 +2418,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `investmentThemesThematicInvesting()` -## ipoCalendar - -> \Finnhub\Model\IPOCalendar ipoCalendar($from, $to) +```php +investmentThemesThematicInvesting($theme): \Finnhub\Model\InvestmentThemesThematicInvesting +``` -IPO Calendar +Investment Themes (Thematic Investing) -Get recent and coming IPO. +

Thematic investing involves creating a portfolio (or portion of a portfolio) by gathering together a collection of companies involved in certain areas that you predict will generate above-market returns over the long term. Themes can be based on a concept such as ageing populations or a sub-sector such as robotics, and drones. Thematic investing focuses on predicted long-term trends rather than specific companies or sectors, enabling investors to access structural, one-off shifts that can change an entire industry.

This endpoint will help you get portfolios of different investment themes that are changing our life and are the way of the future.

A full list of themes supported can be found here. The theme coverage and portfolios are updated bi-weekly by our analysts. Our approach excludes penny, super-small cap and illiquid stocks.

### Example @@ -2275,29 +2453,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From date: 2020-03-15. -$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To date: 2020-03-16. +$theme = 'theme_example'; // string | Investment theme. A full list of themes supported can be found here. try { - $result = $apiInstance->ipoCalendar($from, $to); + $result = $apiInstance->investmentThemesThematicInvesting($theme); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->ipoCalendar: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->investmentThemesThematicInvesting: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **\DateTime**| From date: 2020-03-15. | - **to** | **\DateTime**| To date: 2020-03-16. | + **theme** | **string**| Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. | ### Return type -[**\Finnhub\Model\IPOCalendar**](../Model/IPOCalendar.md) +[**\Finnhub\Model\InvestmentThemesThematicInvesting**](../Model/InvestmentThemesThematicInvesting.md) ### Authorization @@ -2306,20 +2480,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `ipoCalendar()` -## majorDevelopments - -> \Finnhub\Model\MajorDevelopments majorDevelopments($symbol, $from, $to) +```php +ipoCalendar($from, $to): \Finnhub\Model\IPOCalendar +``` -Major Developments +IPO Calendar -List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events. +Get recent and upcoming IPO. ### Example @@ -2340,31 +2515,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Company symbol. -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From time: 2020-01-01. -$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To time: 2020-01-05. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From date: 2020-03-15. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To date: 2020-03-16. try { - $result = $apiInstance->majorDevelopments($symbol, $from, $to); + $result = $apiInstance->ipoCalendar($from, $to); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->majorDevelopments: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->ipoCalendar: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Company symbol. | - **from** | **\DateTime**| From time: 2020-01-01. | [optional] - **to** | **\DateTime**| To time: 2020-01-05. | [optional] + **from** | **\DateTime**| From date: 2020-03-15. | + **to** | **\DateTime**| To date: 2020-03-16. | ### Return type -[**\Finnhub\Model\MajorDevelopments**](../Model/MajorDevelopments.md) +[**\Finnhub\Model\IPOCalendar**](../Model/IPOCalendar.md) ### Authorization @@ -2373,20 +2544,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `marketNews()` -## newsSentiment - -> \Finnhub\Model\NewsSentiment newsSentiment($symbol) +```php +marketNews($category, $min_id): \Finnhub\Model\News[] +``` -News Sentiment +Market News -Get company's news sentiment and statistics. This endpoint is only available for US companies. +Get latest market news. ### Example @@ -2407,27 +2579,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Company symbol. +$category = 'category_example'; // string | This parameter can be 1 of the following values general, forex, crypto, merger. +$min_id = 'min_id_example'; // string | Use this field to get only news after this ID. Default to 0 try { - $result = $apiInstance->newsSentiment($symbol); + $result = $apiInstance->marketNews($category, $min_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->newsSentiment: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->marketNews: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Company symbol. | + **category** | **string**| This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. | + **min_id** | **string**| Use this field to get only news after this ID. Default to 0 | [optional] ### Return type -[**\Finnhub\Model\NewsSentiment**](../Model/NewsSentiment.md) +[**\Finnhub\Model\News[]**](../Model/News.md) ### Authorization @@ -2436,20 +2608,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `mutualFundCountryExposure()` -## patternRecognition - -> \Finnhub\Model\PatternRecognition patternRecognition($symbol, $resolution) +```php +mutualFundCountryExposure($symbol): \Finnhub\Model\MutualFundsCountryExposure +``` -Pattern Recognition +Mutual Funds Country Exposure -Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns. +Get Mutual Funds country exposure data. ### Example @@ -2470,29 +2643,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol -$resolution = 'resolution_example'; // string | Supported resolution includes 1, 5, 15, 30, 60, D, W, M .Some timeframes might not be available depending on the exchange. +$symbol = 'symbol_example'; // string | Symbol. try { - $result = $apiInstance->patternRecognition($symbol, $resolution); + $result = $apiInstance->mutualFundCountryExposure($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->patternRecognition: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->mutualFundCountryExposure: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol | - **resolution** | **string**| Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. | + **symbol** | **string**| Symbol. | ### Return type -[**\Finnhub\Model\PatternRecognition**](../Model/PatternRecognition.md) +[**\Finnhub\Model\MutualFundsCountryExposure**](../Model/MutualFundsCountryExposure.md) ### Authorization @@ -2501,20 +2670,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `mutualFundHoldings()` -## priceTarget - -> \Finnhub\Model\PriceTarget priceTarget($symbol) +```php +mutualFundHoldings($symbol, $isin, $skip): \Finnhub\Model\MutualFundsHoldings +``` -Price Target +Mutual Funds Holdings -Get latest price target consensus. +Get full Mutual Funds holdings/constituents. ### Example @@ -2535,27 +2705,29 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. +$symbol = 'symbol_example'; // string | Fund's symbol. +$isin = 'isin_example'; // string | Fund's isin. +$skip = 56; // int | Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. try { - $result = $apiInstance->priceTarget($symbol); + $result = $apiInstance->mutualFundHoldings($symbol, $isin, $skip); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->priceTarget: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->mutualFundHoldings: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol of the company: AAPL. | + **symbol** | **string**| Fund's symbol. | [optional] + **isin** | **string**| Fund's isin. | [optional] + **skip** | **int**| Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. | [optional] ### Return type -[**\Finnhub\Model\PriceTarget**](../Model/PriceTarget.md) +[**\Finnhub\Model\MutualFundsHoldings**](../Model/MutualFundsHoldings.md) ### Authorization @@ -2564,20 +2736,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `mutualFundProfile()` -## quote - -> \Finnhub\Model\Quote quote($symbol) +```php +mutualFundProfile($symbol, $isin): \Finnhub\Model\MutualFundsProfile +``` -Quote +Mutual Funds Profile -

Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time update.

Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. Contact Us to learn more.

+Get mutual funds profile information. This endpoint covers US mutual funds only. ### Example @@ -2598,27 +2771,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol +$symbol = 'symbol_example'; // string | Fund's symbol. +$isin = 'isin_example'; // string | Fund's isin. try { - $result = $apiInstance->quote($symbol); + $result = $apiInstance->mutualFundProfile($symbol, $isin); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->quote: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->mutualFundProfile: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol | + **symbol** | **string**| Fund's symbol. | [optional] + **isin** | **string**| Fund's isin. | [optional] ### Return type -[**\Finnhub\Model\Quote**](../Model/Quote.md) +[**\Finnhub\Model\MutualFundsProfile**](../Model/MutualFundsProfile.md) ### Authorization @@ -2627,20 +2800,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `mutualFundSectorExposure()` -## recommendationTrends - -> \Finnhub\Model\RecommendationTrend[] recommendationTrends($symbol) +```php +mutualFundSectorExposure($symbol): \Finnhub\Model\MutualFundSectorExposure +``` -Recommendation Trends +Mutual-fund Sector Exposure -Get latest analyst recommendation trends for a company. +Get Mutual Funds sector exposure data. ### Example @@ -2661,27 +2835,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. +$symbol = 'symbol_example'; // string | Mutual Fund symbol. try { - $result = $apiInstance->recommendationTrends($symbol); + $result = $apiInstance->mutualFundSectorExposure($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->recommendationTrends: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->mutualFundSectorExposure: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol of the company: AAPL. | + **symbol** | **string**| Mutual Fund symbol. | ### Return type -[**\Finnhub\Model\RecommendationTrend[]**](../Model/RecommendationTrend.md) +[**\Finnhub\Model\MutualFundSectorExposure**](../Model/MutualFundSectorExposure.md) ### Authorization @@ -2690,20 +2862,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `newsSentiment()` -## similarityIndex - -> \Finnhub\Model\SimilarityIndex similarityIndex($symbol, $cik, $freq) +```php +newsSentiment($symbol): \Finnhub\Model\NewsSentiment +``` -Similarity Index +News Sentiment -

Calculate the textual difference between a company's 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019's 10-K with 2018's 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company's stock price in the upcoming 4 quarters.

+Get company's news sentiment and statistics. This endpoint is only available for US companies. ### Example @@ -2724,31 +2897,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol. Required if cik is empty -$cik = 'cik_example'; // string | CIK. Required if symbol is empty -$freq = 'freq_example'; // string | annual or quarterly. Default to annual +$symbol = 'symbol_example'; // string | Company symbol. try { - $result = $apiInstance->similarityIndex($symbol, $cik, $freq); + $result = $apiInstance->newsSentiment($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->similarityIndex: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->newsSentiment: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol. Required if cik is empty | [optional] - **cik** | **string**| CIK. Required if symbol is empty | [optional] - **freq** | **string**| <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> | [optional] + **symbol** | **string**| Company symbol. | ### Return type -[**\Finnhub\Model\SimilarityIndex**](../Model/SimilarityIndex.md) +[**\Finnhub\Model\NewsSentiment**](../Model/NewsSentiment.md) ### Authorization @@ -2757,20 +2924,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `ownership()` -## stockBidask - -> \Finnhub\Model\LastBidAsk stockBidask($symbol) +```php +ownership($symbol, $limit): \Finnhub\Model\Ownership +``` -Last Bid-Ask +Ownership -Get last bid/ask data for US stocks. +Get a full list of shareholders of a company in descending order of the number of shares held. Data is sourced from 13F form, Schedule 13D and 13G for US market, UK Share Register for UK market, SEDI for Canadian market and equivalent filings for other international markets. ### Example @@ -2791,27 +2959,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol. +$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. +$limit = 56; // int | Limit number of results. Leave empty to get the full list. try { - $result = $apiInstance->stockBidask($symbol); + $result = $apiInstance->ownership($symbol, $limit); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->stockBidask: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->ownership: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol. | + **symbol** | **string**| Symbol of the company: AAPL. | + **limit** | **int**| Limit number of results. Leave empty to get the full list. | [optional] ### Return type -[**\Finnhub\Model\LastBidAsk**](../Model/LastBidAsk.md) +[**\Finnhub\Model\Ownership**](../Model/Ownership.md) ### Authorization @@ -2820,20 +2988,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `patternRecognition()` -## stockCandles - -> \Finnhub\Model\StockCandles stockCandles($symbol, $resolution, $from, $to, $adjusted) +```php +patternRecognition($symbol, $resolution): \Finnhub\Model\PatternRecognition +``` -Stock Candles +Pattern Recognition -

Get candlestick data for stocks going back 25 years for US stocks.

Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. Contact Us to learn more.

+Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns. ### Example @@ -2854,35 +3023,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol. +$symbol = 'symbol_example'; // string | Symbol $resolution = 'resolution_example'; // string | Supported resolution includes 1, 5, 15, 30, 60, D, W, M .Some timeframes might not be available depending on the exchange. -$from = 56; // int | UNIX timestamp. Interval initial value. -$to = 56; // int | UNIX timestamp. Interval end value. -$adjusted = 'adjusted_example'; // string | By default, adjusted=false. Use true to get adjusted data. try { - $result = $apiInstance->stockCandles($symbol, $resolution, $from, $to, $adjusted); + $result = $apiInstance->patternRecognition($symbol, $resolution); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->stockCandles: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->patternRecognition: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol. | + **symbol** | **string**| Symbol | **resolution** | **string**| Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. | - **from** | **int**| UNIX timestamp. Interval initial value. | - **to** | **int**| UNIX timestamp. Interval end value. | - **adjusted** | **string**| By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. | [optional] ### Return type -[**\Finnhub\Model\StockCandles**](../Model/StockCandles.md) +[**\Finnhub\Model\PatternRecognition**](../Model/PatternRecognition.md) ### Authorization @@ -2891,20 +3052,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `pressReleases()` -## stockDividends - -> \Finnhub\Model\Dividends[] stockDividends($symbol, $from, $to) +```php +pressReleases($symbol, $from, $to): \Finnhub\Model\MajorPressReleases +``` -Dividends +Major Press Releases -Get dividends data for common stocks going back 30 years. +Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire. ### Example @@ -2925,31 +3087,29 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol. -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. -$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. +$symbol = 'symbol_example'; // string | Company symbol. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From time: 2020-01-01. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To time: 2020-01-05. try { - $result = $apiInstance->stockDividends($symbol, $from, $to); + $result = $apiInstance->pressReleases($symbol, $from, $to); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->stockDividends: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->pressReleases: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol. | - **from** | **\DateTime**| YYYY-MM-DD. | - **to** | **\DateTime**| YYYY-MM-DD. | + **symbol** | **string**| Company symbol. | + **from** | **\DateTime**| From time: 2020-01-01. | [optional] + **to** | **\DateTime**| To time: 2020-01-05. | [optional] ### Return type -[**\Finnhub\Model\Dividends[]**](../Model/Dividends.md) +[**\Finnhub\Model\MajorPressReleases**](../Model/MajorPressReleases.md) ### Authorization @@ -2958,20 +3118,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `priceTarget()` -## stockSplits - -> \Finnhub\Model\Split[] stockSplits($symbol, $from, $to) +```php +priceTarget($symbol): \Finnhub\Model\PriceTarget +``` -Splits +Price Target -Get splits data for stocks. +Get latest price target consensus. ### Example @@ -2992,21 +3153,729 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | Symbol. -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. -$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. +$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. try { - $result = $apiInstance->stockSplits($symbol, $from, $to); + $result = $apiInstance->priceTarget($symbol); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->stockSplits: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->priceTarget: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol of the company: AAPL. | + +### Return type + +[**\Finnhub\Model\PriceTarget**](../Model/PriceTarget.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `quote()` + +```php +quote($symbol): \Finnhub\Model\Quote +``` + +Quote + +

Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time updates.

Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. Contact Us to learn more.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol + +try { + $result = $apiInstance->quote($symbol); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->quote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol | + +### Return type + +[**\Finnhub\Model\Quote**](../Model/Quote.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `recommendationTrends()` + +```php +recommendationTrends($symbol): \Finnhub\Model\RecommendationTrend[] +``` + +Recommendation Trends + +Get latest analyst recommendation trends for a company. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol of the company: AAPL. + +try { + $result = $apiInstance->recommendationTrends($symbol); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->recommendationTrends: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol of the company: AAPL. | + +### Return type + +[**\Finnhub\Model\RecommendationTrend[]**](../Model/RecommendationTrend.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `revenueBreakdown()` + +```php +revenueBreakdown($symbol, $cik): \Finnhub\Model\RevenueBreakdown +``` + +Revenue Breakdown + +Get revenue breakdown by product. This dataset is only available for US companies which disclose their revenue breakdown in the annual or quarterly reports. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. +$cik = 'cik_example'; // string | CIK. + +try { + $result = $apiInstance->revenueBreakdown($symbol, $cik); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->revenueBreakdown: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | [optional] + **cik** | **string**| CIK. | [optional] + +### Return type + +[**\Finnhub\Model\RevenueBreakdown**](../Model/RevenueBreakdown.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `similarityIndex()` + +```php +similarityIndex($symbol, $cik, $freq): \Finnhub\Model\SimilarityIndex +``` + +Similarity Index + +

Calculate the textual difference between a company's 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019's 10-K with 2018's 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company's stock price in the upcoming 4 quarters.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. Required if cik is empty +$cik = 'cik_example'; // string | CIK. Required if symbol is empty +$freq = 'freq_example'; // string | annual or quarterly. Default to annual + +try { + $result = $apiInstance->similarityIndex($symbol, $cik, $freq); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->similarityIndex: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. Required if cik is empty | [optional] + **cik** | **string**| CIK. Required if symbol is empty | [optional] + **freq** | **string**| <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> | [optional] + +### Return type + +[**\Finnhub\Model\SimilarityIndex**](../Model/SimilarityIndex.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `socialSentiment()` + +```php +socialSentiment($symbol, $from, $to): \Finnhub\Model\SocialSentiment +``` + +Social Sentiment + +

Get social sentiment for stocks on Reddit and Twitter. This endpoint is currently in Beta.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Company symbol. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | From date YYYY-MM-DD. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | To date YYYY-MM-DD. + +try { + $result = $apiInstance->socialSentiment($symbol, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->socialSentiment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Company symbol. | + **from** | **\DateTime**| From date <code>YYYY-MM-DD</code>. | [optional] + **to** | **\DateTime**| To date <code>YYYY-MM-DD</code>. | [optional] + +### Return type + +[**\Finnhub\Model\SocialSentiment**](../Model/SocialSentiment.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockBasicDividends()` + +```php +stockBasicDividends($symbol): \Finnhub\Model\Dividends2Basic +``` + +Dividends 2 (Basic) + +Get global dividends data. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. + +try { + $result = $apiInstance->stockBasicDividends($symbol); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockBasicDividends: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + +### Return type + +[**\Finnhub\Model\Dividends2Basic**](../Model/Dividends2Basic.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockBidask()` + +```php +stockBidask($symbol): \Finnhub\Model\LastBidAsk +``` + +Last Bid-Ask + +Get last bid/ask data for US stocks. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. + +try { + $result = $apiInstance->stockBidask($symbol); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockBidask: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + +### Return type + +[**\Finnhub\Model\LastBidAsk**](../Model/LastBidAsk.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockCandles()` + +```php +stockCandles($symbol, $resolution, $from, $to, $adjusted): \Finnhub\Model\StockCandles +``` + +Stock Candles + +

Get candlestick data (OHLCV) for stocks + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. +$resolution = 'resolution_example'; // string | Supported resolution includes 1, 5, 15, 30, 60, D, W, M .Some timeframes might not be available depending on the exchange. +$from = 56; // int | UNIX timestamp. Interval initial value. +$to = 56; // int | UNIX timestamp. Interval end value. +$adjusted = 'adjusted_example'; // string | DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. + +try { + $result = $apiInstance->stockCandles($symbol, $resolution, $from, $to, $adjusted); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockCandles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + **resolution** | **string**| Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. | + **from** | **int**| UNIX timestamp. Interval initial value. | + **to** | **int**| UNIX timestamp. Interval end value. | + **adjusted** | **string**| DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. | [optional] + +### Return type + +[**\Finnhub\Model\StockCandles**](../Model/StockCandles.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockDividends()` + +```php +stockDividends($symbol, $from, $to): \Finnhub\Model\Dividends[] +``` + +Dividends + +Get dividends data for common stocks going back 30 years. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. + +try { + $result = $apiInstance->stockDividends($symbol, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockDividends: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + **from** | **\DateTime**| YYYY-MM-DD. | + **to** | **\DateTime**| YYYY-MM-DD. | + +### Return type + +[**\Finnhub\Model\Dividends[]**](../Model/Dividends.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockNbbo()` + +```php +stockNbbo($symbol, $date, $limit, $skip): \Finnhub\Model\HistoricalNBBO +``` + +Historical NBBO + +

Get historical best bid and offer for US stocks, LSE, TSX, Euronext and Deutsche Borse.

For US market, this endpoint only serves historical NBBO from the beginning of 2020. To download more historical data, please visit our bulk download page in the Dashboard here.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. +$date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date: 2020-04-02. +$limit = 56; // int | Limit number of ticks returned. Maximum value: 25000 +$skip = 56; // int | Number of ticks to skip. Use this parameter to loop through the entire data. + +try { + $result = $apiInstance->stockNbbo($symbol, $date, $limit, $skip); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockNbbo: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + **date** | **\DateTime**| Date: 2020-04-02. | + **limit** | **int**| Limit number of ticks returned. Maximum value: <code>25000</code> | + **skip** | **int**| Number of ticks to skip. Use this parameter to loop through the entire data. | + +### Return type + +[**\Finnhub\Model\HistoricalNBBO**](../Model/HistoricalNBBO.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `stockSplits()` + +```php +stockSplits($symbol, $from, $to): \Finnhub\Model\Split[] +``` + +Splits + +Get splits data for stocks. + +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. +$to = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | YYYY-MM-DD. + +try { + $result = $apiInstance->stockSplits($symbol, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->stockSplits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -3025,20 +3894,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `stockSymbols()` -## stockSymbols - -> \Finnhub\Model\Stock[] stockSymbols($exchange) +```php +stockSymbols($exchange, $mic, $security_type, $currency): \Finnhub\Model\Stock[] +``` Stock Symbol -List supported stocks. A list of supported CFD Indices can be found here. +List supported stocks. We use the following symbology to identify stocks on Finnhub Exchange_Ticker.Exchange_Code. A list of supported exchange codes can be found here. A list of supported CFD Indices can be found here. ### Example @@ -3059,23 +3929,27 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$exchange = 'exchange_example'; // string | Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found here. +$exchange = 'exchange_example'; // string | Exchange you want to get the list of symbols from. List of exchange codes can be found here. +$mic = 'mic_example'; // string | Filter by MIC code. +$security_type = 'security_type_example'; // string | Filter by security type used by OpenFigi standard. +$currency = 'currency_example'; // string | Filter by currency. try { - $result = $apiInstance->stockSymbols($exchange); + $result = $apiInstance->stockSymbols($exchange, $mic, $security_type, $currency); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->stockSymbols: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **exchange** | **string**| Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. | + **exchange** | **string**| Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. | + **mic** | **string**| Filter by MIC code. | [optional] + **security_type** | **string**| Filter by security type used by OpenFigi standard. | [optional] + **currency** | **string**| Filter by currency. | [optional] ### Return type @@ -3088,20 +3962,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `stockTick()` -## stockTick - -> \Finnhub\Model\TickData stockTick($symbol, $date, $limit, $skip) +```php +stockTick($symbol, $date, $limit, $skip): \Finnhub\Model\TickData +``` Tick Data -

Get historical tick data for US stocks from all 13 exchanges. You can send the request directly to our tick server at https://tick.finnhub.io/ with the same path and parameters or get redirected there if you call our main server. Data is updated at the end of each trading day.

Tick data from 1985 is available for Enterprise clients. Contact us to learn more.

+

Get historical tick data for global exchanges. You can send the request directly to our tick server at https://tick.finnhub.io/ with the same path and parameters or get redirected there if you call our main server.

For US market, you can visit our bulk download page in the Dashboard here to speed up the download process.

Note that for Nasdaq Nordic and Baltic, you need to use ISIN instead of symbol to query tick data.

Exchange Segment Delay
US CTA/UTP Full SIP 15 minute
TSX
  • TSX
  • TSX Venture
  • Index
End-of-day
LSE
  • London Stock Exchange (L)
  • LSE International (L)
  • LSE European (L)
15 minute
Euronext
  • Euronext Paris (PA)
  • Euronext Amsterdam (AS)
  • Euronext Lisbon (LS)
  • Euronext Brussels (BR)
  • Euronext Oslo (OL)
  • Euronext London (LN)
  • Euronext Dublin (IR)
  • Index
  • Warrant
End-of-day
Deutsche Börse
  • Frankfurt (F)
  • Xetra (DE)
  • Duesseldorf (DU)
  • Hamburg (HM)
  • Berlin (BE)
  • Hanover (HA)
  • Stoxx (SX)
  • TradeGate (TG)
  • Zertifikate (SC)
  • Index
  • Warrant
End-of-day
Nasdaq Nordic & Baltic
  • Copenhagen (CO)
  • Stockholm (ST)
  • Helsinki (HE)
  • Iceland (IC)
  • Riga (RG)
  • Tallinn (TL)
  • Vilnius(VS)
  • Fixed Income
  • Derivatives
  • Commodities
End-of-day
### Example @@ -3133,12 +4008,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->stockTick: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol. | @@ -3157,16 +4030,79 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `supplyChainRelationships()` + +```php +supplyChainRelationships($symbol): \Finnhub\Model\SupplyChainRelationships +``` + +Supply Chain Relationships + +

This endpoint provides an overall map of public companies' key customers and suppliers. The data offers a deeper look into a company's supply chain and how products are created. The data will help investors manage risk, limit exposure or generate alpha-generating ideas and trading insights.

We currently cover data for S&P500 and Nasdaq 100 companies.

+ +### Example + +```php +setApiKey('token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Finnhub\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); + + +$apiInstance = new Finnhub\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$symbol = 'symbol_example'; // string | Symbol. + +try { + $result = $apiInstance->supplyChainRelationships($symbol); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->supplyChainRelationships: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **string**| Symbol. | + +### Return type + +[**\Finnhub\Model\SupplyChainRelationships**](../Model/SupplyChainRelationships.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -## supportResistance +## `supportResistance()` -> \Finnhub\Model\SupportResistance supportResistance($symbol, $resolution) +```php +supportResistance($symbol, $resolution): \Finnhub\Model\SupportResistance +``` Support/Resistance @@ -3200,12 +4136,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->supportResistance: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol | @@ -3222,20 +4156,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `symbolSearch()` -## technicalIndicator - -> object technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields) +```php +symbolSearch($q): \Finnhub\Model\SymbolLookup +``` -Technical Indicators +Symbol Lookup -Return technical indicator with price data. List of supported indicators can be found here. +Search for best-matching symbols based on your query. You can input anything from symbol, security's name to ISIN and Cusip. ### Example @@ -3256,37 +4191,25 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$symbol = 'symbol_example'; // string | symbol -$resolution = 'resolution_example'; // string | Supported resolution includes 1, 5, 15, 30, 60, D, W, M .Some timeframes might not be available depending on the exchange. -$from = 56; // int | UNIX timestamp. Interval initial value. -$to = 56; // int | UNIX timestamp. Interval end value. -$indicator = 'indicator_example'; // string | Indicator name. Full list can be found here. -$indicator_fields = new \stdClass; // object | Check out this page to see which indicators and params are supported. +$q = 'q_example'; // string | Query text can be symbol, name, isin, or cusip. try { - $result = $apiInstance->technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields); + $result = $apiInstance->symbolSearch($q); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->technicalIndicator: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->symbolSearch: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| symbol | - **resolution** | **string**| Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. | - **from** | **int**| UNIX timestamp. Interval initial value. | - **to** | **int**| UNIX timestamp. Interval end value. | - **indicator** | **string**| Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. | - **indicator_fields** | **object**| Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. | [optional] + **q** | **string**| Query text can be symbol, name, isin, or cusip. | ### Return type -**object** +[**\Finnhub\Model\SymbolLookup**](../Model/SymbolLookup.md) ### Authorization @@ -3294,21 +4217,22 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `technicalIndicator()` -## transcripts - -> \Finnhub\Model\EarningsCallTranscripts transcripts($id) +```php +technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields): object +``` -Earnings Call Transcripts +Technical Indicators -

Get earnings call transcripts, audio and participants' list. This endpoint is only available for US companies.

17+ years of data is available with 170,000+ audio which add up to 6TB in size.

+Return technical indicator with price data. List of supported indicators can be found here. ### Example @@ -3329,27 +4253,35 @@ $apiInstance = new Finnhub\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$id = 'id_example'; // string | Transcript's id obtained with Transcripts List endpoint. +$symbol = 'symbol_example'; // string | symbol +$resolution = 'resolution_example'; // string | Supported resolution includes 1, 5, 15, 30, 60, D, W, M .Some timeframes might not be available depending on the exchange. +$from = 56; // int | UNIX timestamp. Interval initial value. +$to = 56; // int | UNIX timestamp. Interval end value. +$indicator = 'indicator_example'; // string | Indicator name. Full list can be found here. +$indicator_fields = new \stdClass; // object | Check out this page to see which indicators and params are supported. try { - $result = $apiInstance->transcripts($id); + $result = $apiInstance->technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->transcripts: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->technicalIndicator: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. | + **symbol** | **string**| symbol | + **resolution** | **string**| Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. | + **from** | **int**| UNIX timestamp. Interval initial value. | + **to** | **int**| UNIX timestamp. Interval end value. | + **indicator** | **string**| Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. | + **indicator_fields** | **object**| Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. | [optional] ### Return type -[**\Finnhub\Model\EarningsCallTranscripts**](../Model/EarningsCallTranscripts.md) +**object** ### Authorization @@ -3357,21 +4289,22 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `transcriptsList()` -## transcriptsList - -> \Finnhub\Model\EarningsCallTranscriptsList transcriptsList($symbol) +```php +transcriptsList($symbol): \Finnhub\Model\EarningsCallTranscriptsList +``` Earnings Call Transcripts List -List earnings call transcripts' metadata. This endpoint is only available for US companies. +List earnings call transcripts' metadata. This endpoint is available for US, UK and Canadian companies. ### Example @@ -3400,12 +4333,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->transcriptsList: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Company symbol: AAPL. Leave empty to list the latest transcripts | @@ -3421,16 +4352,17 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `upgradeDowngrade()` -## upgradeDowngrade - -> \Finnhub\Model\UpgradeDowngrade[] upgradeDowngrade($symbol, $from, $to) +```php +upgradeDowngrade($symbol, $from, $to): \Finnhub\Model\UpgradeDowngrade[] +``` Stock Upgrade/Downgrade @@ -3465,12 +4397,10 @@ try { } catch (Exception $e) { echo 'Exception when calling DefaultApi->upgradeDowngrade: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **symbol** | **string**| Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades. | [optional] @@ -3488,9 +4418,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) - diff --git a/docs/Model/AggregateIndicators.md b/docs/Model/AggregateIndicators.md index 490e564..a78c4b0 100644 --- a/docs/Model/AggregateIndicators.md +++ b/docs/Model/AggregateIndicators.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**technical_analysis** | [**\Finnhub\Model\TechnicalAnalysis**](TechnicalAnalysis.md) | | [optional] -**trend** | [**\Finnhub\Model\Trend**](Trend.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**technical_analysis** | [**\Finnhub\Model\TechnicalAnalysis**](TechnicalAnalysis.md) | | [optional] +**trend** | [**\Finnhub\Model\Trend**](Trend.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicFinancials.md b/docs/Model/BasicFinancials.md index bce4f91..43e3a3b 100644 --- a/docs/Model/BasicFinancials.md +++ b/docs/Model/BasicFinancials.md @@ -4,10 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol of the company. | [optional] -**metric_type** | **string** | Metric type. | [optional] -**metric** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol of the company. | [optional] +**metric_type** | **string** | Metric type. | [optional] +**series** | **object** | | [optional] +**metric** | **object** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BreakdownItem.md b/docs/Model/BreakdownItem.md new file mode 100644 index 0000000..2309fd9 --- /dev/null +++ b/docs/Model/BreakdownItem.md @@ -0,0 +1,10 @@ +# # BreakdownItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_number** | **string** | Access number of the report from which the data is sourced. | [optional] +**breakdown** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Company.md b/docs/Model/Company.md index 2528a56..40bcb38 100644 --- a/docs/Model/Company.md +++ b/docs/Model/Company.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Executive name | [optional] -**age** | **int** | Age | [optional] -**title** | **string** | Title | [optional] -**since** | **string** | Year appointed | [optional] -**sex** | **string** | Sex | [optional] -**compensation** | **int** | Total compensation | [optional] -**currency** | **string** | Compensation currency | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**name** | **string** | Executive name | [optional] +**age** | **int** | Age | [optional] +**title** | **string** | Title | [optional] +**since** | **string** | Year appointed | [optional] +**sex** | **string** | Sex | [optional] +**compensation** | **int** | Total compensation | [optional] +**currency** | **string** | Compensation currency | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CompanyExecutive.md b/docs/Model/CompanyExecutive.md index 6faf5b9..3020098 100644 --- a/docs/Model/CompanyExecutive.md +++ b/docs/Model/CompanyExecutive.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**executive** | **object[]** | Array of company's executives and members of the Board. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Company symbol. | [optional] +**executive** | **object[]** | Array of company's executives and members of the Board. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CompanyNewsStatistics.md b/docs/Model/CompanyNewsStatistics.md index a79441d..0f06f25 100644 --- a/docs/Model/CompanyNewsStatistics.md +++ b/docs/Model/CompanyNewsStatistics.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**articles_in_last_week** | **int** | | [optional] -**buzz** | **float** | | [optional] -**weekly_average** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**articles_in_last_week** | **int** | | [optional] +**buzz** | **float** | | [optional] +**weekly_average** | **float** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CompanyProfile.md b/docs/Model/CompanyProfile.md index 70cd4e9..2215112 100644 --- a/docs/Model/CompanyProfile.md +++ b/docs/Model/CompanyProfile.md @@ -4,35 +4,33 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**address** | **string** | Address of company's headquarter. | [optional] -**city** | **string** | City of company's headquarter. | [optional] -**country** | **string** | Country of company's headquarter. | [optional] -**currency** | **string** | Currency used in company filings. | [optional] -**cusip** | **string** | CUSIP number. | [optional] -**sedol** | **string** | Sedol number. | [optional] -**description** | **string** | Company business summary. | [optional] -**exchange** | **string** | Listed exchange. | [optional] -**ggroup** | **string** | GICS industry group. | [optional] -**gind** | **string** | GICS industry. | [optional] -**gsector** | **string** | GICS sector. | [optional] -**gsubind** | **string** | GICS sub-industry. | [optional] -**isin** | **string** | ISIN number. | [optional] -**naics_national_industry** | **string** | NAICS national industry. | [optional] -**naics** | **string** | NAICS industry. | [optional] -**naics_sector** | **string** | NAICS sector. | [optional] -**naics_subsector** | **string** | NAICS subsector. | [optional] -**name** | **string** | Company name. | [optional] -**phone** | **string** | Company phone number. | [optional] -**state** | **string** | State of company's headquarter. | [optional] -**ticker** | **string** | Company symbol/ticker as used on the listed exchange. | [optional] -**weburl** | **string** | Company website. | [optional] -**ipo** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] -**market_capitalization** | **float** | Market Capitalization. | [optional] -**share_outstanding** | **float** | Number of oustanding shares. | [optional] -**employee_total** | **int** | Number of employee. | [optional] -**logo** | **string** | Logo image. | [optional] -**finnhub_industry** | **string** | Finnhub industry classification. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**address** | **string** | Address of company's headquarter. | [optional] +**city** | **string** | City of company's headquarter. | [optional] +**country** | **string** | Country of company's headquarter. | [optional] +**currency** | **string** | Currency used in company filings. | [optional] +**cusip** | **string** | CUSIP number. | [optional] +**sedol** | **string** | Sedol number. | [optional] +**description** | **string** | Company business summary. | [optional] +**exchange** | **string** | Listed exchange. | [optional] +**ggroup** | **string** | GICS industry group. | [optional] +**gind** | **string** | GICS industry. | [optional] +**gsector** | **string** | GICS sector. | [optional] +**gsubind** | **string** | GICS sub-industry. | [optional] +**isin** | **string** | ISIN number. | [optional] +**naics_national_industry** | **string** | NAICS national industry. | [optional] +**naics** | **string** | NAICS industry. | [optional] +**naics_sector** | **string** | NAICS sector. | [optional] +**naics_subsector** | **string** | NAICS subsector. | [optional] +**name** | **string** | Company name. | [optional] +**phone** | **string** | Company phone number. | [optional] +**state** | **string** | State of company's headquarter. | [optional] +**ticker** | **string** | Company symbol/ticker as used on the listed exchange. | [optional] +**weburl** | **string** | Company website. | [optional] +**ipo** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] +**market_capitalization** | **float** | Market Capitalization. | [optional] +**share_outstanding** | **float** | Number of oustanding shares. | [optional] +**employee_total** | **int** | Number of employee. | [optional] +**logo** | **string** | Logo image. | [optional] +**finnhub_industry** | **string** | Finnhub industry classification. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CompanyProfile2.md b/docs/Model/CompanyProfile2.md index e0b91ac..99aa416 100644 --- a/docs/Model/CompanyProfile2.md +++ b/docs/Model/CompanyProfile2.md @@ -4,19 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **string** | Country of company's headquarter. | [optional] -**currency** | **string** | Currency used in company filings. | [optional] -**exchange** | **string** | Listed exchange. | [optional] -**name** | **string** | Company name. | [optional] -**ticker** | **string** | Company symbol/ticker as used on the listed exchange. | [optional] -**ipo** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] -**market_capitalization** | **float** | Market Capitalization. | [optional] -**share_outstanding** | **float** | Number of oustanding shares. | [optional] -**logo** | **string** | Logo image. | [optional] -**phone** | **string** | Company phone number. | [optional] -**weburl** | **string** | Company website. | [optional] -**finnhub_industry** | **string** | Finnhub industry classification. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**country** | **string** | Country of company's headquarter. | [optional] +**currency** | **string** | Currency used in company filings. | [optional] +**exchange** | **string** | Listed exchange. | [optional] +**name** | **string** | Company name. | [optional] +**ticker** | **string** | Company symbol/ticker as used on the listed exchange. | [optional] +**ipo** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] +**market_capitalization** | **float** | Market Capitalization. | [optional] +**share_outstanding** | **float** | Number of oustanding shares. | [optional] +**logo** | **string** | Logo image. | [optional] +**phone** | **string** | Company phone number. | [optional] +**weburl** | **string** | Company website. | [optional] +**finnhub_industry** | **string** | Finnhub industry classification. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CountryMetadata.md b/docs/Model/CountryMetadata.md index f6f09ec..379820d 100644 --- a/docs/Model/CountryMetadata.md +++ b/docs/Model/CountryMetadata.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **string** | Country name | [optional] -**code2** | **string** | Alpha 2 code | [optional] -**code3** | **string** | Alpha 3 code | [optional] -**code_no** | **string** | UN code | [optional] -**currency** | **string** | Currency name | [optional] -**currency_code** | **string** | Currency code | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**country** | **string** | Country name | [optional] +**code2** | **string** | Alpha 2 code | [optional] +**code3** | **string** | Alpha 3 code | [optional] +**code_no** | **string** | UN code | [optional] +**currency** | **string** | Currency name | [optional] +**currency_code** | **string** | Currency code | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CovidInfo.md b/docs/Model/CovidInfo.md index 7037c3d..f444aaf 100644 --- a/docs/Model/CovidInfo.md +++ b/docs/Model/CovidInfo.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**state** | **string** | State. | [optional] -**case** | **float** | Number of confirmed cases. | [optional] -**death** | **float** | Number of confirmed deaths. | [optional] -**updated** | [**\DateTime**](\DateTime.md) | Updated time. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**state** | **string** | State. | [optional] +**case** | **float** | Number of confirmed cases. | [optional] +**death** | **float** | Number of confirmed deaths. | [optional] +**updated** | [**\DateTime**](\DateTime.md) | Updated time. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoCandles.md b/docs/Model/CryptoCandles.md index fd93666..ca66594 100644 --- a/docs/Model/CryptoCandles.md +++ b/docs/Model/CryptoCandles.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**o** | **float[]** | List of open prices for returned candles. | [optional] -**h** | **float[]** | List of high prices for returned candles. | [optional] -**l** | **float[]** | List of low prices for returned candles. | [optional] -**c** | **float[]** | List of close prices for returned candles. | [optional] -**v** | **float[]** | List of volume data for returned candles. | [optional] -**t** | **int[]** | List of timestamp for returned candles. | [optional] -**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**o** | **float[]** | List of open prices for returned candles. | [optional] +**h** | **float[]** | List of high prices for returned candles. | [optional] +**l** | **float[]** | List of low prices for returned candles. | [optional] +**c** | **float[]** | List of close prices for returned candles. | [optional] +**v** | **float[]** | List of volume data for returned candles. | [optional] +**t** | **int[]** | List of timestamp for returned candles. | [optional] +**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CryptoSymbol.md b/docs/Model/CryptoSymbol.md index 5b0b289..b435b7c 100644 --- a/docs/Model/CryptoSymbol.md +++ b/docs/Model/CryptoSymbol.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Symbol description | [optional] -**display_symbol** | **string** | Display symbol name. | [optional] -**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/crypto/candle</code> endpoint. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**description** | **string** | Symbol description | [optional] +**display_symbol** | **string** | Display symbol name. | [optional] +**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/crypto/candle</code> endpoint. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Development.md b/docs/Model/Development.md index a92f3e7..c946e91 100644 --- a/docs/Model/Development.md +++ b/docs/Model/Development.md @@ -4,11 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**datetime** | [**\DateTime**](\DateTime.md) | Published time in <code>YYYY-MM-DD HH:MM:SS</code> format. | [optional] -**headline** | **string** | Development headline. | [optional] -**description** | **string** | Development description. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Company symbol. | [optional] +**datetime** | [**\DateTime**](\DateTime.md) | Published time in <code>YYYY-MM-DD HH:MM:SS</code> format. | [optional] +**headline** | **string** | Development headline. | [optional] +**description** | **string** | Development description. | [optional] +**url** | **string** | URL. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Dividends.md b/docs/Model/Dividends.md index 00812b7..aaed7e9 100644 --- a/docs/Model/Dividends.md +++ b/docs/Model/Dividends.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol. | [optional] -**date** | [**\DateTime**](\DateTime.md) | Ex-Dividend date. | [optional] -**amount** | **float** | Amount in local currency. | [optional] -**adjusted_amount** | **float** | Adjusted dividend. | [optional] -**pay_date** | [**\DateTime**](\DateTime.md) | Pay date. | [optional] -**record_date** | [**\DateTime**](\DateTime.md) | Record date. | [optional] -**declaration_date** | [**\DateTime**](\DateTime.md) | Declaration date. | [optional] -**currency** | **string** | Currency. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**date** | [**\DateTime**](\DateTime.md) | Ex-Dividend date. | [optional] +**amount** | **float** | Amount in local currency. | [optional] +**adjusted_amount** | **float** | Adjusted dividend. | [optional] +**pay_date** | [**\DateTime**](\DateTime.md) | Pay date. | [optional] +**record_date** | [**\DateTime**](\DateTime.md) | Record date. | [optional] +**declaration_date** | [**\DateTime**](\DateTime.md) | Declaration date. | [optional] +**currency** | **string** | Currency. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Dividends2Basic.md b/docs/Model/Dividends2Basic.md new file mode 100644 index 0000000..6048308 --- /dev/null +++ b/docs/Model/Dividends2Basic.md @@ -0,0 +1,10 @@ +# # Dividends2Basic + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol | [optional] +**data** | **object[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFCountryExposureData.md b/docs/Model/ETFCountryExposureData.md new file mode 100644 index 0000000..7787568 --- /dev/null +++ b/docs/Model/ETFCountryExposureData.md @@ -0,0 +1,10 @@ +# # ETFCountryExposureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **string** | Country | [optional] +**exposure** | **float** | Percent of exposure. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFHoldingsData.md b/docs/Model/ETFHoldingsData.md new file mode 100644 index 0000000..a35451f --- /dev/null +++ b/docs/Model/ETFHoldingsData.md @@ -0,0 +1,15 @@ +# # ETFHoldingsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol description | [optional] +**name** | **string** | Security name | [optional] +**isin** | **string** | ISIN. | [optional] +**cusip** | **string** | CUSIP. | [optional] +**share** | **float** | Number of shares owned by the ETF. | [optional] +**percent** | **float** | Portfolio's percent | [optional] +**value** | **float** | Market value | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFProfileData.md b/docs/Model/ETFProfileData.md new file mode 100644 index 0000000..69b545b --- /dev/null +++ b/docs/Model/ETFProfileData.md @@ -0,0 +1,26 @@ +# # ETFProfileData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name | [optional] +**asset_class** | **string** | Asset Class. | [optional] +**investment_segment** | **string** | Investment Segment. | [optional] +**aum** | **float** | AUM. | [optional] +**nav** | **float** | NAV. | [optional] +**nav_currency** | **string** | NAV currency. | [optional] +**expense_ratio** | **float** | Expense ratio. | [optional] +**tracking_index** | **string** | Tracking Index. | [optional] +**etf_company** | **string** | ETF issuer. | [optional] +**domicile** | **string** | ETF domicile. | [optional] +**inception_date** | [**\DateTime**](\DateTime.md) | Inception date. | [optional] +**website** | **string** | ETF's website. | [optional] +**isin** | **string** | ISIN. | [optional] +**cusip** | **string** | CUSIP. | [optional] +**price_to_earnings** | **float** | P/E. | [optional] +**price_to_book** | **float** | P/B. | [optional] +**avg_volume** | **float** | 30-day average volume. | [optional] +**description** | **string** | ETF's description. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFSectorExposureData.md b/docs/Model/ETFSectorExposureData.md new file mode 100644 index 0000000..1f882c0 --- /dev/null +++ b/docs/Model/ETFSectorExposureData.md @@ -0,0 +1,10 @@ +# # ETFSectorExposureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**industry** | **string** | Industry | [optional] +**exposure** | **float** | Percent of exposure. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFsCountryExposure.md b/docs/Model/ETFsCountryExposure.md index 198ced6..45576c8 100644 --- a/docs/Model/ETFsCountryExposure.md +++ b/docs/Model/ETFsCountryExposure.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | ETF symbol. | [optional] -**holdings** | **object[]** | Array of countries and and exposure levels. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | ETF symbol. | [optional] +**country_exposure** | **object[]** | Array of countries and and exposure levels. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFsHoldings.md b/docs/Model/ETFsHoldings.md index e6796a1..c64d219 100644 --- a/docs/Model/ETFsHoldings.md +++ b/docs/Model/ETFsHoldings.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | ETF symbol. | [optional] -**holdings** | **object[]** | Array of holdings. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | ETF symbol. | [optional] +**at_date** | [**\DateTime**](\DateTime.md) | Holdings update date. | [optional] +**number_of_holdings** | **int** | Number of holdings. | [optional] +**holdings** | **object[]** | Array of holdings. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFsProfile.md b/docs/Model/ETFsProfile.md index c22c70c..fd0ee17 100644 --- a/docs/Model/ETFsProfile.md +++ b/docs/Model/ETFsProfile.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Use symbol returned in <code>/forex/symbol</code> endpoint for this field. | [optional] -**profile** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**profile** | [**\Finnhub\Model\ETFProfileData**](ETFProfileData.md) | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ETFsSectorExposure.md b/docs/Model/ETFsSectorExposure.md new file mode 100644 index 0000000..3b6f966 --- /dev/null +++ b/docs/Model/ETFsSectorExposure.md @@ -0,0 +1,10 @@ +# # ETFsSectorExposure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | ETF symbol. | [optional] +**sector_exposure** | **object[]** | Array of industries and exposure levels. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningEstimate.md b/docs/Model/EarningEstimate.md index a903c45..2e6b0f2 100644 --- a/docs/Model/EarningEstimate.md +++ b/docs/Model/EarningEstimate.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**eps_avg** | **float** | Average EPS estimates. | [optional] -**eps_high** | **float** | Highest estimate. | [optional] -**eps_low** | **float** | Lowest estimate. | [optional] -**number_analysts** | **int** | Number of Analysts. | [optional] -**period** | [**\DateTime**](\DateTime.md) | Period. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**eps_avg** | **float** | Average EPS estimates including Finnhub's proprietary estimates. | [optional] +**eps_high** | **float** | Highest estimate. | [optional] +**eps_low** | **float** | Lowest estimate. | [optional] +**number_analysts** | **int** | Number of Analysts. | [optional] +**period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningRelease.md b/docs/Model/EarningRelease.md index d3599d8..f51edfe 100644 --- a/docs/Model/EarningRelease.md +++ b/docs/Model/EarningRelease.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol. | [optional] -**date** | [**\DateTime**](\DateTime.md) | Date. | [optional] -**hour** | **string** | Indicates whether the earnings is announced before market open(<code>bmo</code>), after market close(<code>amc</code>), or during market hour(<code>dmh</code>). | [optional] -**year** | **int** | Earnings year. | [optional] -**quarter** | **int** | Earnings quarter. | [optional] -**eps_estimate** | **float** | EPS estimate. | [optional] -**eps_actual** | **float** | EPS actual. | [optional] -**revenue_estimate** | **int** | Revenue estimate. | [optional] -**revenue_actual** | **int** | Revenue actual. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**date** | [**\DateTime**](\DateTime.md) | Date. | [optional] +**hour** | **string** | Indicates whether the earnings is announced before market open(<code>bmo</code>), after market close(<code>amc</code>), or during market hour(<code>dmh</code>). | [optional] +**year** | **int** | Earnings year. | [optional] +**quarter** | **int** | Earnings quarter. | [optional] +**eps_estimate** | **float** | EPS estimate. | [optional] +**eps_actual** | **float** | EPS actual. | [optional] +**revenue_estimate** | **int** | Revenue estimate including Finnhub's proprietary estimates. | [optional] +**revenue_actual** | **int** | Revenue actual. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningResult.md b/docs/Model/EarningResult.md index 227df39..765fc17 100644 --- a/docs/Model/EarningResult.md +++ b/docs/Model/EarningResult.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**actual** | **float** | Actual earning result. | [optional] -**estimate** | **float** | Estimated earning. | [optional] -**period** | [**\DateTime**](\DateTime.md) | Reported period. | [optional] -**symbol** | **string** | Company symbol. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**actual** | **float** | Actual earning result. | [optional] +**estimate** | **float** | Estimated earning. | [optional] +**surprise** | **float** | Surprise - The difference between actual and estimate. | [optional] +**surprise_percent** | **float** | Surprise percent. | [optional] +**period** | [**\DateTime**](\DateTime.md) | Reported period. | [optional] +**symbol** | **string** | Company symbol. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningsCalendar.md b/docs/Model/EarningsCalendar.md index d731b76..c0674c7 100644 --- a/docs/Model/EarningsCalendar.md +++ b/docs/Model/EarningsCalendar.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**earnings_calendar** | **object[]** | Array of earnings release. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**earnings_calendar** | **object[]** | Array of earnings release. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningsCallTranscripts.md b/docs/Model/EarningsCallTranscripts.md index c2e8572..91202dd 100644 --- a/docs/Model/EarningsCallTranscripts.md +++ b/docs/Model/EarningsCallTranscripts.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**transcript** | **object[]** | Transcript content. | [optional] -**participant** | **object[]** | Participant list | [optional] -**audio** | **string** | Audio link. | [optional] -**id** | **string** | Transcript's ID. | [optional] -**title** | **string** | Title. | [optional] -**time** | [**\DateTime**](\DateTime.md) | Time of the event. | [optional] -**year** | **int** | Year of earnings result in the case of earnings call transcript. | [optional] -**quarter** | **int** | Quarter of earnings result in the case of earnings call transcript. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Company symbol. | [optional] +**transcript** | **object[]** | Transcript content. | [optional] +**participant** | **object[]** | Participant list | [optional] +**audio** | **string** | Audio link. | [optional] +**id** | **string** | Transcript's ID. | [optional] +**title** | **string** | Title. | [optional] +**time** | [**\DateTime**](\DateTime.md) | Time of the event. | [optional] +**year** | **int** | Year of earnings result in the case of earnings call transcript. | [optional] +**quarter** | **int** | Quarter of earnings result in the case of earnings call transcript. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningsCallTranscriptsList.md b/docs/Model/EarningsCallTranscriptsList.md index 96d291d..f09f219 100644 --- a/docs/Model/EarningsCallTranscriptsList.md +++ b/docs/Model/EarningsCallTranscriptsList.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**transcripts** | **object[]** | Array of transcripts' metadata | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Company symbol. | [optional] +**transcripts** | **object[]** | Array of transcripts' metadata | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EarningsEstimates.md b/docs/Model/EarningsEstimates.md index 70a24f7..76e12d3 100644 --- a/docs/Model/EarningsEstimates.md +++ b/docs/Model/EarningsEstimates.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object[]** | List of estimates | [optional] -**freq** | **string** | Frequency: annual or quarterly. | [optional] -**symbol** | **string** | Company symbol. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | **object[]** | List of estimates | [optional] +**freq** | **string** | Frequency: annual or quarterly. | [optional] +**symbol** | **string** | Company symbol. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EconomicCalendar.md b/docs/Model/EconomicCalendar.md index 0b111e8..2d7f15b 100644 --- a/docs/Model/EconomicCalendar.md +++ b/docs/Model/EconomicCalendar.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**economic_calendar** | **object[]** | Array of economic events. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**economic_calendar** | **object[]** | Array of economic events. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EconomicCode.md b/docs/Model/EconomicCode.md index 71cd313..f131b1e 100644 --- a/docs/Model/EconomicCode.md +++ b/docs/Model/EconomicCode.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **string** | Finnhub economic code used to get historical data | [optional] -**country** | **string** | Country | [optional] -**name** | **string** | Indicator name | [optional] -**unit** | **string** | Unit | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**code** | **string** | Finnhub economic code used to get historical data | [optional] +**country** | **string** | Country | [optional] +**name** | **string** | Indicator name | [optional] +**unit** | **string** | Unit | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EconomicData.md b/docs/Model/EconomicData.md index 43e5ef9..159d399 100644 --- a/docs/Model/EconomicData.md +++ b/docs/Model/EconomicData.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object[]** | Array of economic data for requested code. | [optional] -**code** | **string** | Finnhub economic code | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | **object[]** | Array of economic data for requested code. | [optional] +**code** | **string** | Finnhub economic code | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EconomicEvent.md b/docs/Model/EconomicEvent.md index 516214b..70272f9 100644 --- a/docs/Model/EconomicEvent.md +++ b/docs/Model/EconomicEvent.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**actual** | **float** | Actual release | [optional] -**prev** | **float** | Previous release | [optional] -**country** | **string** | Country | [optional] -**unit** | **string** | Unit | [optional] -**estimate** | **float** | Estimate | [optional] -**event** | **string** | Event | [optional] -**impact** | **string** | Impact level | [optional] -**time** | **string** | Release time | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**actual** | **float** | Actual release | [optional] +**prev** | **float** | Previous release | [optional] +**country** | **string** | Country | [optional] +**unit** | **string** | Unit | [optional] +**estimate** | **float** | Estimate | [optional] +**event** | **string** | Event | [optional] +**impact** | **string** | Impact level | [optional] +**time** | **string** | Release time | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Estimate.md b/docs/Model/Estimate.md index 66cc5d0..8ce6e51 100644 --- a/docs/Model/Estimate.md +++ b/docs/Model/Estimate.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**revenue_avg** | **int** | Average revenue estimates. | [optional] -**revenue_high** | **int** | Highest estimate. | [optional] -**revenue_low** | **int** | Lowest estimate. | [optional] -**number_analysts** | **int** | Number of Analysts. | [optional] -**period** | [**\DateTime**](\DateTime.md) | Period. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**revenue_avg** | **int** | Average revenue estimates including Finnhub's proprietary estimates. | [optional] +**revenue_high** | **int** | Highest estimate. | [optional] +**revenue_low** | **int** | Lowest estimate. | [optional] +**number_analysts** | **int** | Number of Analysts. | [optional] +**period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FDAComitteeMeeting.md b/docs/Model/FDAComitteeMeeting.md new file mode 100644 index 0000000..e60aba8 --- /dev/null +++ b/docs/Model/FDAComitteeMeeting.md @@ -0,0 +1,12 @@ +# # FDAComitteeMeeting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_date** | [**\DateTime**](\DateTime.md) | Start time of the event in EST. | [optional] +**to_date** | [**\DateTime**](\DateTime.md) | End time of the event in EST. | [optional] +**event_description** | **string** | Event's description. | [optional] +**url** | **string** | URL. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Filing.md b/docs/Model/Filing.md index 358a26d..64725dc 100644 --- a/docs/Model/Filing.md +++ b/docs/Model/Filing.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**access_number** | **string** | Access number. | [optional] -**symbol** | **string** | Symbol. | [optional] -**cik** | **string** | CIK. | [optional] -**form** | **string** | Form type. | [optional] -**filed_date** | [**\DateTime**](\DateTime.md) | Filed date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**accepted_date** | [**\DateTime**](\DateTime.md) | Accepted date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**report_url** | **string** | Report's URL. | [optional] -**filing_url** | **string** | Filing's URL. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**access_number** | **string** | Access number. | [optional] +**symbol** | **string** | Symbol. | [optional] +**cik** | **string** | CIK. | [optional] +**form** | **string** | Form type. | [optional] +**filed_date** | [**\DateTime**](\DateTime.md) | Filed date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**accepted_date** | [**\DateTime**](\DateTime.md) | Accepted date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**report_url** | **string** | Report's URL. | [optional] +**filing_url** | **string** | Filing's URL. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilingSentiment.md b/docs/Model/FilingSentiment.md new file mode 100644 index 0000000..7d448dd --- /dev/null +++ b/docs/Model/FilingSentiment.md @@ -0,0 +1,17 @@ +# # FilingSentiment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**negative** | **float** | % of negative words in the filing. | [optional] +**positive** | **float** | % of positive words in the filing. | [optional] +**polarity** | **float** | % of polarity words in the filing. | [optional] +**litigious** | **float** | % of litigious words in the filing. | [optional] +**uncertainty** | **float** | % of uncertainty words in the filing. | [optional] +**constraining** | **float** | % of constraining words in the filing. | [optional] +**modal_weak** | **float** | % of modal-weak words in the filing. | [optional] +**modal_strong** | **float** | % of modal-strong words in the filing. | [optional] +**modal_moderate** | **float** | % of modal-moderate words in the filing. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FinancialStatements.md b/docs/Model/FinancialStatements.md index ddc5d16..91b7afc 100644 --- a/docs/Model/FinancialStatements.md +++ b/docs/Model/FinancialStatements.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol of the company. | [optional] -**financials** | **object[]** | An array of map of key, value pairs containing the data for each period. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol of the company. | [optional] +**financials** | **object[]** | An array of map of key, value pairs containing the data for each period. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FinancialsAsReported.md b/docs/Model/FinancialsAsReported.md index 59317a2..b84d4ad 100644 --- a/docs/Model/FinancialsAsReported.md +++ b/docs/Model/FinancialsAsReported.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol | [optional] -**cik** | **string** | CIK | [optional] -**data** | **object[]** | Array of filings. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol | [optional] +**cik** | **string** | CIK | [optional] +**data** | **object[]** | Array of filings. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexCandles.md b/docs/Model/ForexCandles.md index 70c72f2..4dc1a82 100644 --- a/docs/Model/ForexCandles.md +++ b/docs/Model/ForexCandles.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**o** | **float[]** | List of open prices for returned candles. | [optional] -**h** | **float[]** | List of high prices for returned candles. | [optional] -**l** | **float[]** | List of low prices for returned candles. | [optional] -**c** | **float[]** | List of close prices for returned candles. | [optional] -**v** | **float[]** | List of volume data for returned candles. | [optional] -**t** | **float[]** | List of timestamp for returned candles. | [optional] -**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**o** | **float[]** | List of open prices for returned candles. | [optional] +**h** | **float[]** | List of high prices for returned candles. | [optional] +**l** | **float[]** | List of low prices for returned candles. | [optional] +**c** | **float[]** | List of close prices for returned candles. | [optional] +**v** | **float[]** | List of volume data for returned candles. | [optional] +**t** | **float[]** | List of timestamp for returned candles. | [optional] +**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForexSymbol.md b/docs/Model/ForexSymbol.md index 4e4ac3a..840d806 100644 --- a/docs/Model/ForexSymbol.md +++ b/docs/Model/ForexSymbol.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Symbol description | [optional] -**display_symbol** | **string** | Display symbol name. | [optional] -**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/forex/candle</code> endpoint. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**description** | **string** | Symbol description | [optional] +**display_symbol** | **string** | Display symbol name. | [optional] +**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/forex/candle</code> endpoint. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Forexrates.md b/docs/Model/Forexrates.md index 3b7b00f..02f527b 100644 --- a/docs/Model/Forexrates.md +++ b/docs/Model/Forexrates.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**base** | **string** | Base currency. | [optional] -**quote** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**base** | **string** | Base currency. | [optional] +**quote** | **object** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FundOwnership.md b/docs/Model/FundOwnership.md index f683a8b..6cab658 100644 --- a/docs/Model/FundOwnership.md +++ b/docs/Model/FundOwnership.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol of the company. | [optional] -**ownership** | **object[]** | Array of investors with detailed information about their holdings. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol of the company. | [optional] +**ownership** | **object[]** | Array of investors with detailed information about their holdings. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalNBBO.md b/docs/Model/HistoricalNBBO.md new file mode 100644 index 0000000..754db31 --- /dev/null +++ b/docs/Model/HistoricalNBBO.md @@ -0,0 +1,20 @@ +# # HistoricalNBBO + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**s** | **string** | Symbol. | [optional] +**skip** | **int** | Number of ticks skipped. | [optional] +**count** | **int** | Number of ticks returned. If <code>count</code> < <code>limit</code>, all data for that date has been returned. | [optional] +**total** | **int** | Total number of ticks for that date. | [optional] +**av** | **float[]** | List of Ask volume data. | [optional] +**a** | **float[]** | List of Ask price data. | [optional] +**ax** | **string[]** | List of venues/exchanges - Ask price. A list of exchange codes can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1Tj53M1svmr-hfEtbk6_NpVR1yAyGLMaH6ByYU6CG0ZY/edit?usp=sharing\",>here</a> | [optional] +**bv** | **float[]** | List of Bid volume data. | [optional] +**b** | **float[]** | List of Bid price data. | [optional] +**bx** | **string[]** | List of venues/exchanges - Bid price. A list of exchange codes can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1Tj53M1svmr-hfEtbk6_NpVR1yAyGLMaH6ByYU6CG0ZY/edit?usp=sharing\",>here</a> | [optional] +**t** | **int[]** | List of timestamp in UNIX ms. | [optional] +**c** | [**string[][]**](array.md) | List of quote conditions. A comprehensive list of quote conditions code can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1iiA6e7Osdtai0oPMOUzgAIKXCsay89dFDmsegz6OpEg/edit?usp=sharing\">here</a> | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IPOCalendar.md b/docs/Model/IPOCalendar.md index 77fd8a3..3927227 100644 --- a/docs/Model/IPOCalendar.md +++ b/docs/Model/IPOCalendar.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ipo_calendar** | **object[]** | Array of IPO events. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**ipo_calendar** | **object[]** | Array of IPO events. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IPOEvent.md b/docs/Model/IPOEvent.md index 60baef9..c5886dc 100644 --- a/docs/Model/IPOEvent.md +++ b/docs/Model/IPOEvent.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol. | [optional] -**date** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] -**exchange** | **string** | Exchange. | [optional] -**name** | **string** | Company's name. | [optional] -**status** | **string** | IPO status. Can take 1 of the following values: <code>expected</code>,<code>priced</code>,<code>withdrawn</code>,<code>filed</code> | [optional] -**price** | **string** | Projected price or price range. | [optional] -**number_of_shares** | **int** | Number of shares offered during the IPO. | [optional] -**total_shares_value** | **int** | Total shares value. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**date** | [**\DateTime**](\DateTime.md) | IPO date. | [optional] +**exchange** | **string** | Exchange. | [optional] +**name** | **string** | Company's name. | [optional] +**status** | **string** | IPO status. Can take 1 of the following values: <code>expected</code>,<code>priced</code>,<code>withdrawn</code>,<code>filed</code> | [optional] +**price** | **string** | Projected price or price range. | [optional] +**number_of_shares** | **int** | Number of shares offered during the IPO. | [optional] +**total_shares_value** | **int** | Total shares value. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndexHistoricalConstituent.md b/docs/Model/IndexHistoricalConstituent.md index 7674e6f..e46a64a 100644 --- a/docs/Model/IndexHistoricalConstituent.md +++ b/docs/Model/IndexHistoricalConstituent.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol | [optional] -**action** | **string** | <code>add</code> or <code>remove</code>. | [optional] -**date** | [**\DateTime**](\DateTime.md) | Date of joining or leaving the index. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol | [optional] +**action** | **string** | <code>add</code> or <code>remove</code>. | [optional] +**date** | [**\DateTime**](\DateTime.md) | Date of joining or leaving the index. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Indicator.md b/docs/Model/Indicator.md index 6694fb9..82a705b 100644 --- a/docs/Model/Indicator.md +++ b/docs/Model/Indicator.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**buy** | **int** | Number of buy signals | [optional] -**neutral** | **int** | Number of neutral signals | [optional] -**sell** | **int** | Number of sell signals | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**buy** | **int** | Number of buy signals | [optional] +**neutral** | **int** | Number of neutral signals | [optional] +**sell** | **int** | Number of sell signals | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesConstituents.md b/docs/Model/IndicesConstituents.md index f43e68a..c3b7fef 100644 --- a/docs/Model/IndicesConstituents.md +++ b/docs/Model/IndicesConstituents.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Index's symbol. | [optional] -**constituents** | **string[]** | Array of constituents. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Index's symbol. | [optional] +**constituents** | **string[]** | Array of constituents. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IndicesHistoricalConstituents.md b/docs/Model/IndicesHistoricalConstituents.md index 963cf34..5ac8241 100644 --- a/docs/Model/IndicesHistoricalConstituents.md +++ b/docs/Model/IndicesHistoricalConstituents.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Index's symbol. | [optional] -**historical_constituents** | **object[]** | Array of historical constituents. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Index's symbol. | [optional] +**historical_constituents** | **object[]** | Array of historical constituents. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InsiderTransactions.md b/docs/Model/InsiderTransactions.md new file mode 100644 index 0000000..9b47dfc --- /dev/null +++ b/docs/Model/InsiderTransactions.md @@ -0,0 +1,10 @@ +# # InsiderTransactions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol of the company. | [optional] +**data** | **object[]** | Array of insider transactions. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InternationalFiling.md b/docs/Model/InternationalFiling.md new file mode 100644 index 0000000..e35930c --- /dev/null +++ b/docs/Model/InternationalFiling.md @@ -0,0 +1,17 @@ +# # InternationalFiling + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol. | [optional] +**company_name** | **string** | Company name. | [optional] +**filed_date** | [**\DateTime**](\DateTime.md) | Filed date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**category** | **string** | Category. | [optional] +**title** | **string** | Document's title. | [optional] +**description** | **string** | Document's description. | [optional] +**url** | **string** | Url. | [optional] +**language** | **string** | Language. | [optional] +**country** | **string** | Country. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InvestmentThemePortfolio.md b/docs/Model/InvestmentThemePortfolio.md new file mode 100644 index 0000000..00a2980 --- /dev/null +++ b/docs/Model/InvestmentThemePortfolio.md @@ -0,0 +1,9 @@ +# # InvestmentThemePortfolio + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InvestmentThemesThematicInvesting.md b/docs/Model/InvestmentThemesThematicInvesting.md new file mode 100644 index 0000000..9f8dd4f --- /dev/null +++ b/docs/Model/InvestmentThemesThematicInvesting.md @@ -0,0 +1,10 @@ +# # InvestmentThemesThematicInvesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**theme** | **string** | Investment theme | [optional] +**data** | **object[]** | Investment theme portfolio. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Investor.md b/docs/Model/Investor.md index 2fbf559..fa36314 100644 --- a/docs/Model/Investor.md +++ b/docs/Model/Investor.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Investor's name. | [optional] -**share** | **int** | Number of shares held by the investor. | [optional] -**change** | **int** | Number of share changed (net buy or sell) from the last period. | [optional] -**filing_date** | [**\DateTime**](\DateTime.md) | Filing date. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | Investor's name. | [optional] +**share** | **int** | Number of shares held by the investor. | [optional] +**change** | **int** | Number of share changed (net buy or sell) from the last period. | [optional] +**filing_date** | [**\DateTime**](\DateTime.md) | Filing date. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/KeyCustomersSuppliers.md b/docs/Model/KeyCustomersSuppliers.md new file mode 100644 index 0000000..0e1f66b --- /dev/null +++ b/docs/Model/KeyCustomersSuppliers.md @@ -0,0 +1,12 @@ +# # KeyCustomersSuppliers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol | [optional] +**name** | **string** | Name | [optional] +**customer** | **bool** | Whether the company is a customer. | [optional] +**supplier** | **bool** | Whether the company is a supplier | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LastBidAsk.md b/docs/Model/LastBidAsk.md index 46fcffe..c44e173 100644 --- a/docs/Model/LastBidAsk.md +++ b/docs/Model/LastBidAsk.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**b** | **float** | Bid price. | [optional] -**a** | **float** | Ask price. | [optional] -**bv** | **float** | Bid volume. | [optional] -**av** | **float** | Ask volume. | [optional] -**t** | **int** | Reference UNIX timestamp in ms. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**b** | **float** | Bid price. | [optional] +**a** | **float** | Ask price. | [optional] +**bv** | **float** | Bid volume. | [optional] +**av** | **float** | Ask volume. | [optional] +**t** | **int** | Reference UNIX timestamp in ms. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MajorPressReleases.md b/docs/Model/MajorPressReleases.md new file mode 100644 index 0000000..0469869 --- /dev/null +++ b/docs/Model/MajorPressReleases.md @@ -0,0 +1,10 @@ +# # MajorPressReleases + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Company symbol. | [optional] +**major_development** | **object[]** | Array of major developments. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundCountryExposureData.md b/docs/Model/MutualFundCountryExposureData.md new file mode 100644 index 0000000..7c0526c --- /dev/null +++ b/docs/Model/MutualFundCountryExposureData.md @@ -0,0 +1,10 @@ +# # MutualFundCountryExposureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **string** | Country | [optional] +**exposure** | **float** | Percent of exposure. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundSectorExposure.md b/docs/Model/MutualFundSectorExposure.md new file mode 100644 index 0000000..50bb4da --- /dev/null +++ b/docs/Model/MutualFundSectorExposure.md @@ -0,0 +1,10 @@ +# # MutualFundSectorExposure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Mutual symbol. | [optional] +**sector_exposure** | **object[]** | Array of sector and exposure levels. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundSectorExposureData.md b/docs/Model/MutualFundSectorExposureData.md new file mode 100644 index 0000000..7173527 --- /dev/null +++ b/docs/Model/MutualFundSectorExposureData.md @@ -0,0 +1,10 @@ +# # MutualFundSectorExposureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sector** | **string** | Sector | [optional] +**exposure** | **float** | Percent of exposure. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundsCountryExposure.md b/docs/Model/MutualFundsCountryExposure.md new file mode 100644 index 0000000..0525baa --- /dev/null +++ b/docs/Model/MutualFundsCountryExposure.md @@ -0,0 +1,10 @@ +# # MutualFundsCountryExposure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol. | [optional] +**country_exposure** | **object[]** | Array of countries and and exposure levels. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundsHoldings.md b/docs/Model/MutualFundsHoldings.md new file mode 100644 index 0000000..ebfa128 --- /dev/null +++ b/docs/Model/MutualFundsHoldings.md @@ -0,0 +1,12 @@ +# # MutualFundsHoldings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol. | [optional] +**at_date** | [**\DateTime**](\DateTime.md) | Holdings update date. | [optional] +**number_of_holdings** | **int** | Number of holdings. | [optional] +**holdings** | **object[]** | Array of holdings. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MutualFundsProfile.md b/docs/Model/MutualFundsProfile.md new file mode 100644 index 0000000..6927528 --- /dev/null +++ b/docs/Model/MutualFundsProfile.md @@ -0,0 +1,10 @@ +# # MutualFundsProfile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol. | [optional] +**profile** | [**\Finnhub\Model\ETFProfileData**](ETFProfileData.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/News.md b/docs/Model/News.md index dd243f6..72c06b5 100644 --- a/docs/Model/News.md +++ b/docs/Model/News.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**category** | **string** | News category. | [optional] -**datetime** | **int** | Published time in UNIX timestamp. | [optional] -**headline** | **string** | News headline. | [optional] -**id** | **int** | News ID. This value can be used for <code>minId</code> params to get the latest news only. | [optional] -**image** | **string** | Thumbnail image URL. | [optional] -**related** | **string** | Related stocks and companies mentioned in the article. | [optional] -**source** | **string** | News source. | [optional] -**summary** | **string** | News summary. | [optional] -**url** | **string** | URL of the original article. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**category** | **string** | News category. | [optional] +**datetime** | **int** | Published time in UNIX timestamp. | [optional] +**headline** | **string** | News headline. | [optional] +**id** | **int** | News ID. This value can be used for <code>minId</code> params to get the latest news only. | [optional] +**image** | **string** | Thumbnail image URL. | [optional] +**related** | **string** | Related stocks and companies mentioned in the article. | [optional] +**source** | **string** | News source. | [optional] +**summary** | **string** | News summary. | [optional] +**url** | **string** | URL of the original article. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewsSentiment.md b/docs/Model/NewsSentiment.md index aa0d0ff..27b07aa 100644 --- a/docs/Model/NewsSentiment.md +++ b/docs/Model/NewsSentiment.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**buzz** | [**\Finnhub\Model\CompanyNewsStatistics**](CompanyNewsStatistics.md) | | [optional] -**company_news_score** | **float** | News score. | [optional] -**sector_average_bullish_percent** | **float** | Sector average bullish percent. | [optional] -**sector_average_news_score** | **float** | Sectore average score. | [optional] -**sentiment** | [**\Finnhub\Model\Sentiment**](Sentiment.md) | | [optional] -**symbol** | **string** | Requested symbol. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**buzz** | [**\Finnhub\Model\CompanyNewsStatistics**](CompanyNewsStatistics.md) | | [optional] +**company_news_score** | **float** | News score. | [optional] +**sector_average_bullish_percent** | **float** | Sector average bullish percent. | [optional] +**sector_average_news_score** | **float** | Sectore average score. | [optional] +**sentiment** | [**\Finnhub\Model\Sentiment**](Sentiment.md) | | [optional] +**symbol** | **string** | Requested symbol. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Ownership.md b/docs/Model/Ownership.md new file mode 100644 index 0000000..551f112 --- /dev/null +++ b/docs/Model/Ownership.md @@ -0,0 +1,10 @@ +# # Ownership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol of the company. | [optional] +**ownership** | **object[]** | Array of investors with detailed information about their holdings. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PatternRecognition.md b/docs/Model/PatternRecognition.md index ef68ff7..c549024 100644 --- a/docs/Model/PatternRecognition.md +++ b/docs/Model/PatternRecognition.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**points** | **object[]** | Array of patterns. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**points** | **object[]** | Array of patterns. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PriceTarget.md b/docs/Model/PriceTarget.md index 6b430b8..81f712a 100644 --- a/docs/Model/PriceTarget.md +++ b/docs/Model/PriceTarget.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**target_high** | **float** | Highes analysts' target. | [optional] -**target_low** | **float** | Lowest analysts' target. | [optional] -**target_mean** | **float** | Mean of all analysts' targets. | [optional] -**target_median** | **float** | Median of all analysts' targets. | [optional] -**last_updated** | [**\DateTime**](\DateTime.md) | Updated time of the data | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**symbol** | **string** | Company symbol. | [optional] +**target_high** | **float** | Highes analysts' target. | [optional] +**target_low** | **float** | Lowest analysts' target. | [optional] +**target_mean** | **float** | Mean of all analysts' targets. | [optional] +**target_median** | **float** | Median of all analysts' targets. | [optional] +**last_updated** | [**\DateTime**](\DateTime.md) | Updated time of the data | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Quote.md b/docs/Model/Quote.md index b3675c2..b3025c3 100644 --- a/docs/Model/Quote.md +++ b/docs/Model/Quote.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**o** | **float** | Open price of the day | [optional] -**h** | **float** | High price of the day | [optional] -**l** | **float** | Low price of the day | [optional] -**c** | **float** | Current price | [optional] -**pc** | **float** | Previous close price | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**o** | **float** | Open price of the day | [optional] +**h** | **float** | High price of the day | [optional] +**l** | **float** | Low price of the day | [optional] +**c** | **float** | Current price | [optional] +**pc** | **float** | Previous close price | [optional] +**d** | **float** | Change | [optional] +**dp** | **float** | Percent change | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecommendationTrend.md b/docs/Model/RecommendationTrend.md index 96ae236..f25c68f 100644 --- a/docs/Model/RecommendationTrend.md +++ b/docs/Model/RecommendationTrend.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**buy** | **int** | Number of recommendations that fall into the Buy category | [optional] -**hold** | **int** | Number of recommendations that fall into the Hold category | [optional] -**period** | **string** | Updated period | [optional] -**sell** | **int** | Number of recommendations that fall into the Sell category | [optional] -**strong_buy** | **int** | Number of recommendations that fall into the Strong Buy category | [optional] -**strong_sell** | **int** | Number of recommendations that fall into the Strong Sell category | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**symbol** | **string** | Company symbol. | [optional] +**buy** | **int** | Number of recommendations that fall into the Buy category | [optional] +**hold** | **int** | Number of recommendations that fall into the Hold category | [optional] +**period** | **string** | Updated period | [optional] +**sell** | **int** | Number of recommendations that fall into the Sell category | [optional] +**strong_buy** | **int** | Number of recommendations that fall into the Strong Buy category | [optional] +**strong_sell** | **int** | Number of recommendations that fall into the Strong Sell category | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RedditSentimentContent.md b/docs/Model/RedditSentimentContent.md new file mode 100644 index 0000000..670efae --- /dev/null +++ b/docs/Model/RedditSentimentContent.md @@ -0,0 +1,15 @@ +# # RedditSentimentContent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mention** | **int** | Number of mentions | [optional] +**positive_mention** | **int** | Number of positive mentions | [optional] +**negative_mention** | **int** | Number of negative mentions | [optional] +**positive_score** | **float** | Positive score. Range 0-1 | [optional] +**negative_score** | **float** | Negative score. Range 0-1 | [optional] +**score** | **float** | Final score. Range: -1 to 1 with 1 is very positive and -1 is very negative | [optional] +**at_time** | [**\DateTime**](\DateTime.md) | Period. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Report.md b/docs/Model/Report.md index 0fe8b44..fa42392 100644 --- a/docs/Model/Report.md +++ b/docs/Model/Report.md @@ -4,18 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**access_number** | **string** | Access number. | [optional] -**symbol** | **string** | Symbol. | [optional] -**cik** | **string** | CIK. | [optional] -**year** | **int** | Year. | [optional] -**quarter** | **int** | Quarter. | [optional] -**form** | **string** | Form type. | [optional] -**start_date** | [**\DateTime**](\DateTime.md) | Period start date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**end_date** | [**\DateTime**](\DateTime.md) | Period end date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**filed_date** | [**\DateTime**](\DateTime.md) | Filed date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**accepted_date** | [**\DateTime**](\DateTime.md) | Accepted date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] -**report** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**access_number** | **string** | Access number. | [optional] +**symbol** | **string** | Symbol. | [optional] +**cik** | **string** | CIK. | [optional] +**year** | **int** | Year. | [optional] +**quarter** | **int** | Quarter. | [optional] +**form** | **string** | Form type. | [optional] +**start_date** | [**\DateTime**](\DateTime.md) | Period start date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**end_date** | [**\DateTime**](\DateTime.md) | Period end date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**filed_date** | [**\DateTime**](\DateTime.md) | Filed date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**accepted_date** | [**\DateTime**](\DateTime.md) | Accepted date <code>%Y-%m-%d %H:%M:%S</code>. | [optional] +**report** | **object** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RevenueBreakdown.md b/docs/Model/RevenueBreakdown.md new file mode 100644 index 0000000..73fd573 --- /dev/null +++ b/docs/Model/RevenueBreakdown.md @@ -0,0 +1,11 @@ +# # RevenueBreakdown + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol | [optional] +**cik** | **string** | CIK | [optional] +**data** | **object[]** | Array of revenue breakdown over multiple periods. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RevenueEstimates.md b/docs/Model/RevenueEstimates.md index 5059e0f..9a5587d 100644 --- a/docs/Model/RevenueEstimates.md +++ b/docs/Model/RevenueEstimates.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **object[]** | List of estimates | [optional] -**freq** | **string** | Frequency: annual or quarterly. | [optional] -**symbol** | **string** | Company symbol. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | **object[]** | List of estimates | [optional] +**freq** | **string** | Frequency: annual or quarterly. | [optional] +**symbol** | **string** | Company symbol. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SECSentimentAnalysis.md b/docs/Model/SECSentimentAnalysis.md new file mode 100644 index 0000000..2bb7f67 --- /dev/null +++ b/docs/Model/SECSentimentAnalysis.md @@ -0,0 +1,12 @@ +# # SECSentimentAnalysis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_number** | **string** | Access number. | [optional] +**symbol** | **string** | Symbol. | [optional] +**cik** | **string** | CIK. | [optional] +**sentiment** | [**\Finnhub\Model\FilingSentiment**](FilingSentiment.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Sentiment.md b/docs/Model/Sentiment.md index ff8a05f..bde8fa5 100644 --- a/docs/Model/Sentiment.md +++ b/docs/Model/Sentiment.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bearish_percent** | **int** | | [optional] -**bullish_percent** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**bearish_percent** | **int** | | [optional] +**bullish_percent** | **int** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SimilarityIndex.md b/docs/Model/SimilarityIndex.md index 94e1113..fa5d333 100644 --- a/docs/Model/SimilarityIndex.md +++ b/docs/Model/SimilarityIndex.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol. | [optional] -**cik** | **string** | CIK. | [optional] -**similarity** | **object[]** | Array of filings with its cosine similarity compared to the same report of the previous year. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**cik** | **string** | CIK. | [optional] +**similarity** | **object[]** | Array of filings with its cosine similarity compared to the same report of the previous year. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SocialSentiment.md b/docs/Model/SocialSentiment.md new file mode 100644 index 0000000..a9fd671 --- /dev/null +++ b/docs/Model/SocialSentiment.md @@ -0,0 +1,11 @@ +# # SocialSentiment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Company symbol. | [optional] +**reddit** | **object[]** | Reddit sentiment. | [optional] +**twitter** | **object[]** | Twitter sentiment. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Split.md b/docs/Model/Split.md index 3c7a891..653bb93 100644 --- a/docs/Model/Split.md +++ b/docs/Model/Split.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Symbol. | [optional] -**date** | [**\DateTime**](\DateTime.md) | Split date. | [optional] -**from_factor** | **float** | From factor. | [optional] -**to_factor** | **float** | To factor. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**symbol** | **string** | Symbol. | [optional] +**date** | [**\DateTime**](\DateTime.md) | Split date. | [optional] +**from_factor** | **float** | From factor. | [optional] +**to_factor** | **float** | To factor. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Stock.md b/docs/Model/Stock.md index 982f442..0a0c807 100644 --- a/docs/Model/Stock.md +++ b/docs/Model/Stock.md @@ -4,12 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**description** | **string** | Symbol description | [optional] -**display_symbol** | **string** | Display symbol name. | [optional] -**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/stock/candle</code> endpoint. | [optional] -**type** | **string** | Security type. | [optional] -**currency** | **string** | Price's currency. This might be different from the reporting currency of fundamental data. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**description** | **string** | Symbol description | [optional] +**display_symbol** | **string** | Display symbol name. | [optional] +**symbol** | **string** | Unique symbol used to identify this symbol used in <code>/stock/candle</code> endpoint. | [optional] +**type** | **string** | Security type. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StockCandles.md b/docs/Model/StockCandles.md index 249ddad..0b08ac3 100644 --- a/docs/Model/StockCandles.md +++ b/docs/Model/StockCandles.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**o** | **float[]** | List of open prices for returned candles. | [optional] -**h** | **float[]** | List of high prices for returned candles. | [optional] -**l** | **float[]** | List of low prices for returned candles. | [optional] -**c** | **float[]** | List of close prices for returned candles. | [optional] -**v** | **float[]** | List of volume data for returned candles. | [optional] -**t** | **int[]** | List of timestamp for returned candles. | [optional] -**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**o** | **float[]** | List of open prices for returned candles. | [optional] +**h** | **float[]** | List of high prices for returned candles. | [optional] +**l** | **float[]** | List of low prices for returned candles. | [optional] +**c** | **float[]** | List of close prices for returned candles. | [optional] +**v** | **float[]** | List of volume data for returned candles. | [optional] +**t** | **int[]** | List of timestamp for returned candles. | [optional] +**s** | **string** | Status of the response. This field can either be ok or no_data. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StockTranscripts.md b/docs/Model/StockTranscripts.md index 1cb87d0..1fd2dd0 100644 --- a/docs/Model/StockTranscripts.md +++ b/docs/Model/StockTranscripts.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Transcript's ID used to get the <a href=\"#transcripts\">full transcript</a>. | [optional] -**title** | **string** | Title. | [optional] -**time** | [**\DateTime**](\DateTime.md) | Time of the event. | [optional] -**year** | **int** | Year of earnings result in the case of earnings call transcript. | [optional] -**quarter** | **int** | Quarter of earnings result in the case of earnings call transcript. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | Transcript's ID used to get the <a href=\"#transcripts\">full transcript</a>. | [optional] +**title** | **string** | Title. | [optional] +**time** | [**\DateTime**](\DateTime.md) | Time of the event. | [optional] +**year** | **int** | Year of earnings result in the case of earnings call transcript. | [optional] +**quarter** | **int** | Quarter of earnings result in the case of earnings call transcript. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SupplyChainRelationships.md b/docs/Model/SupplyChainRelationships.md new file mode 100644 index 0000000..287e892 --- /dev/null +++ b/docs/Model/SupplyChainRelationships.md @@ -0,0 +1,10 @@ +# # SupplyChainRelationships + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | symbol | [optional] +**data** | **object[]** | Key customers and suppliers. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SupportResistance.md b/docs/Model/SupportResistance.md index 07defad..258187b 100644 --- a/docs/Model/SupportResistance.md +++ b/docs/Model/SupportResistance.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**levels** | **float[]** | Array of support and resistance levels. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**levels** | **float[]** | Array of support and resistance levels. | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SymbolLookup.md b/docs/Model/SymbolLookup.md new file mode 100644 index 0000000..00558a2 --- /dev/null +++ b/docs/Model/SymbolLookup.md @@ -0,0 +1,10 @@ +# # SymbolLookup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **object[]** | Array of search results. | [optional] +**count** | **int** | Number of results. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TechnicalAnalysis.md b/docs/Model/TechnicalAnalysis.md index 3b41009..46b3e67 100644 --- a/docs/Model/TechnicalAnalysis.md +++ b/docs/Model/TechnicalAnalysis.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**count** | [**\Finnhub\Model\Indicator**](Indicator.md) | | [optional] -**signal** | **string** | Aggregate Signal | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**count** | [**\Finnhub\Model\Indicator**](Indicator.md) | | [optional] +**signal** | **string** | Aggregate Signal | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TickData.md b/docs/Model/TickData.md index 7cf5e03..92bcc75 100644 --- a/docs/Model/TickData.md +++ b/docs/Model/TickData.md @@ -4,15 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**s** | **string** | Symbol. | [optional] -**skip** | **int** | Number of ticks skipped. | [optional] -**count** | **int** | Number of ticks returned. If <code>count</code> < <code>limit</code>, all data for that date has been returned. | [optional] -**total** | **int** | Total number of ticks for that date. | [optional] -**v** | **float[]** | List of volume data. | [optional] -**p** | **float[]** | List of price data. | [optional] -**t** | **int[]** | List of timestamp in UNIX ms. | [optional] -**x** | **string[]** | List of venues/exchanges. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**s** | **string** | Symbol. | [optional] +**skip** | **int** | Number of ticks skipped. | [optional] +**count** | **int** | Number of ticks returned. If <code>count</code> < <code>limit</code>, all data for that date has been returned. | [optional] +**total** | **int** | Total number of ticks for that date. | [optional] +**v** | **float[]** | List of volume data. | [optional] +**p** | **float[]** | List of price data. | [optional] +**t** | **int[]** | List of timestamp in UNIX ms. | [optional] +**x** | **string[]** | List of venues/exchanges. A list of exchange codes can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1Tj53M1svmr-hfEtbk6_NpVR1yAyGLMaH6ByYU6CG0ZY/edit?usp=sharing\",>here</a> | [optional] +**c** | [**string[][]**](array.md) | List of trade conditions. A comprehensive list of trade conditions code can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1PUxiSWPHSODbaTaoL2Vef6DgU-yFtlRGZf19oBb9Hp0/edit?usp=sharing\">here</a> | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Transactions.md b/docs/Model/Transactions.md new file mode 100644 index 0000000..e6fc81e --- /dev/null +++ b/docs/Model/Transactions.md @@ -0,0 +1,15 @@ +# # Transactions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Insider's name. | [optional] +**share** | **int** | Number of shares held after the transaction. | [optional] +**change** | **int** | Number of share changed from the last period. A positive value suggests a <code>BUY</code> transaction. A negative value suggests a <code>SELL</code> transaction. | [optional] +**filing_date** | [**\DateTime**](\DateTime.md) | Filing date. | [optional] +**transaction_date** | [**\DateTime**](\DateTime.md) | Transaction date. | [optional] +**transaction_price** | **float** | Average transaction price. | [optional] +**transaction_code** | [**\DateTime**](\DateTime.md) | Transaction code. A list of codes and their meanings can be found <a href=\"https://www.sec.gov/about/forms/form4data.pdf\" target=\"_blank\" rel=\"noopener\">here</a>. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TranscriptContent.md b/docs/Model/TranscriptContent.md index 3de20ef..c09afbc 100644 --- a/docs/Model/TranscriptContent.md +++ b/docs/Model/TranscriptContent.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Speaker's name | [optional] -**speech** | **string[]** | Speaker's speech | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | Speaker's name | [optional] +**speech** | **string[]** | Speaker's speech | [optional] +**session** | **string** | Earnings calls section (management discussion or Q&A) | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TranscriptParticipant.md b/docs/Model/TranscriptParticipant.md index 3f4a9df..ea989c7 100644 --- a/docs/Model/TranscriptParticipant.md +++ b/docs/Model/TranscriptParticipant.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Participant's name | [optional] -**description** | **string** | Participant's description | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | Participant's name | [optional] +**description** | **string** | Participant's description | [optional] +**role** | **string** | Whether the speak is a company's executive or an analyst | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trend.md b/docs/Model/Trend.md index 55acaab..047cd3e 100644 --- a/docs/Model/Trend.md +++ b/docs/Model/Trend.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**adx** | **float** | ADX reading | [optional] -**trending** | **bool** | Whether market is trending or going sideway | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**adx** | **float** | ADX reading | [optional] +**trending** | **bool** | Whether market is trending or going sideway | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TwitterSentimentContent.md b/docs/Model/TwitterSentimentContent.md new file mode 100644 index 0000000..07ffda0 --- /dev/null +++ b/docs/Model/TwitterSentimentContent.md @@ -0,0 +1,15 @@ +# # TwitterSentimentContent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mention** | **int** | Number of mentions | [optional] +**positive_mention** | **int** | Number of positive mentions | [optional] +**negative_mention** | **int** | Number of negative mentions | [optional] +**positive_score** | **float** | Positive score. Range 0-1 | [optional] +**negative_score** | **float** | Negative score. Range 0-1 | [optional] +**score** | **float** | Final score. Range: -1 to 1 with 1 is very positive and -1 is very negative | [optional] +**at_time** | [**\DateTime**](\DateTime.md) | Period. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpgradeDowngrade.md b/docs/Model/UpgradeDowngrade.md index 1cbfe2d..8a9dbb2 100644 --- a/docs/Model/UpgradeDowngrade.md +++ b/docs/Model/UpgradeDowngrade.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**symbol** | **string** | Company symbol. | [optional] -**grade_time** | **int** | Upgrade/downgrade time in UNIX timestamp. | [optional] -**from_grade** | **string** | From grade. | [optional] -**to_grade** | **string** | To grade. | [optional] -**company** | **string** | Company/analyst who did the upgrade/downgrade. | [optional] -**action** | **string** | Action can take any of the following values: <code>up(upgrade), down(downgrade), main(maintains), init(initiate), reit(reiterate)</code>. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**symbol** | **string** | Company symbol. | [optional] +**grade_time** | **int** | Upgrade/downgrade time in UNIX timestamp. | [optional] +**from_grade** | **string** | From grade. | [optional] +**to_grade** | **string** | To grade. | [optional] +**company** | **string** | Company/analyst who did the upgrade/downgrade. | [optional] +**action** | **string** | Action can take any of the following values: <code>up(upgrade), down(downgrade), main(maintains), init(initiate), reit(reiterate)</code>. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php index 3c3e012..d40730e 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex): void { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -156,7 +155,7 @@ public function aggregateIndicatorWithHttpInfo($symbol, $resolution) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -169,21 +168,20 @@ public function aggregateIndicatorWithHttpInfo($symbol, $resolution) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\AggregateIndicators' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -194,11 +192,10 @@ public function aggregateIndicatorWithHttpInfo($symbol, $resolution) } $returnType = '\Finnhub\Model\AggregateIndicators'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -263,11 +260,10 @@ public function aggregateIndicatorAsyncWithHttpInfo($symbol, $resolution) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -287,7 +283,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -302,7 +298,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function aggregateIndicatorRequest($symbol, $resolution) + public function aggregateIndicatorRequest($symbol, $resolution) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -341,8 +337,6 @@ protected function aggregateIndicatorRequest($symbol, $resolution) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -356,21 +350,17 @@ protected function aggregateIndicatorRequest($symbol, $resolution) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -416,7 +406,7 @@ protected function aggregateIndicatorRequest($symbol, $resolution) * Basic Financials * * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> (required) + * @param string $metric Metric type. Can be 1 of the following values <code>all</code> (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -434,7 +424,7 @@ public function companyBasicFinancials($symbol, $metric) * Basic Financials * * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> (required) + * @param string $metric Metric type. Can be 1 of the following values <code>all</code> (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -451,7 +441,7 @@ public function companyBasicFinancialsWithHttpInfo($symbol, $metric) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -464,21 +454,20 @@ public function companyBasicFinancialsWithHttpInfo($symbol, $metric) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\BasicFinancials' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -489,11 +478,10 @@ public function companyBasicFinancialsWithHttpInfo($symbol, $metric) } $returnType = '\Finnhub\Model\BasicFinancials'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -523,7 +511,7 @@ public function companyBasicFinancialsWithHttpInfo($symbol, $metric) * Basic Financials * * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> (required) + * @param string $metric Metric type. Can be 1 of the following values <code>all</code> (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -544,7 +532,7 @@ function ($response) { * Basic Financials * * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> (required) + * @param string $metric Metric type. Can be 1 of the following values <code>all</code> (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -558,11 +546,10 @@ public function companyBasicFinancialsAsyncWithHttpInfo($symbol, $metric) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -582,7 +569,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -592,12 +579,12 @@ function ($exception) { * Create request for operation 'companyBasicFinancials' * * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code> (required) + * @param string $metric Metric type. Can be 1 of the following values <code>all</code> (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyBasicFinancialsRequest($symbol, $metric) + public function companyBasicFinancialsRequest($symbol, $metric) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -636,8 +623,6 @@ protected function companyBasicFinancialsRequest($symbol, $metric) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -651,21 +636,17 @@ protected function companyBasicFinancialsRequest($symbol, $metric) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -746,7 +727,7 @@ public function companyEarningsWithHttpInfo($symbol, $limit = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -759,21 +740,20 @@ public function companyEarningsWithHttpInfo($symbol, $limit = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\EarningResult[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -784,11 +764,10 @@ public function companyEarningsWithHttpInfo($symbol, $limit = null) } $returnType = '\Finnhub\Model\EarningResult[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -853,11 +832,10 @@ public function companyEarningsAsyncWithHttpInfo($symbol, $limit = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -877,7 +855,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -892,7 +870,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyEarningsRequest($symbol, $limit = null) + public function companyEarningsRequest($symbol, $limit = null) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -925,8 +903,6 @@ protected function companyEarningsRequest($symbol, $limit = null) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -940,21 +916,17 @@ protected function companyEarningsRequest($symbol, $limit = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1035,7 +1007,7 @@ public function companyEpsEstimatesWithHttpInfo($symbol, $freq = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -1048,21 +1020,20 @@ public function companyEpsEstimatesWithHttpInfo($symbol, $freq = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\EarningsEstimates' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1073,11 +1044,10 @@ public function companyEpsEstimatesWithHttpInfo($symbol, $freq = null) } $returnType = '\Finnhub\Model\EarningsEstimates'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1142,11 +1112,10 @@ public function companyEpsEstimatesAsyncWithHttpInfo($symbol, $freq = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1166,7 +1135,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1181,7 +1150,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyEpsEstimatesRequest($symbol, $freq = null) + public function companyEpsEstimatesRequest($symbol, $freq = null) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -1214,8 +1183,6 @@ protected function companyEpsEstimatesRequest($symbol, $freq = null) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1229,21 +1196,17 @@ protected function companyEpsEstimatesRequest($symbol, $freq = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1322,7 +1285,7 @@ public function companyExecutiveWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -1335,21 +1298,20 @@ public function companyExecutiveWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CompanyExecutive' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1360,11 +1322,10 @@ public function companyExecutiveWithHttpInfo($symbol) } $returnType = '\Finnhub\Model\CompanyExecutive'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1427,11 +1388,10 @@ public function companyExecutiveAsyncWithHttpInfo($symbol) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1451,7 +1411,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1465,7 +1425,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyExecutiveRequest($symbol) + public function companyExecutiveRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -1491,8 +1451,6 @@ protected function companyExecutiveRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1506,21 +1464,17 @@ protected function companyExecutiveRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1603,7 +1557,7 @@ public function companyNewsWithHttpInfo($symbol, $from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -1616,21 +1570,20 @@ public function companyNewsWithHttpInfo($symbol, $from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\News[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1641,11 +1594,10 @@ public function companyNewsWithHttpInfo($symbol, $from, $to) } $returnType = '\Finnhub\Model\News[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1712,11 +1664,10 @@ public function companyNewsAsyncWithHttpInfo($symbol, $from, $to) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1736,7 +1687,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1752,7 +1703,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyNewsRequest($symbol, $from, $to) + public function companyNewsRequest($symbol, $from, $to) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -1804,8 +1755,6 @@ protected function companyNewsRequest($symbol, $from, $to) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1819,21 +1768,17 @@ protected function companyNewsRequest($symbol, $from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1912,7 +1857,7 @@ public function companyPeersWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -1925,21 +1870,20 @@ public function companyPeersWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('string[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -1950,11 +1894,10 @@ public function companyPeersWithHttpInfo($symbol) } $returnType = 'string[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2017,11 +1960,10 @@ public function companyPeersAsyncWithHttpInfo($symbol) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2041,7 +1983,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2055,7 +1997,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyPeersRequest($symbol) + public function companyPeersRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -2081,8 +2023,6 @@ protected function companyPeersRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2096,21 +2036,17 @@ protected function companyPeersRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2193,7 +2129,7 @@ public function companyProfileWithHttpInfo($symbol = null, $isin = null, $cusip } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -2206,21 +2142,20 @@ public function companyProfileWithHttpInfo($symbol = null, $isin = null, $cusip sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CompanyProfile' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2231,11 +2166,10 @@ public function companyProfileWithHttpInfo($symbol = null, $isin = null, $cusip } $returnType = '\Finnhub\Model\CompanyProfile'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2302,11 +2236,10 @@ public function companyProfileAsyncWithHttpInfo($symbol = null, $isin = null, $c ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2326,7 +2259,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2342,7 +2275,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyProfileRequest($symbol = null, $isin = null, $cusip = null) + public function companyProfileRequest($symbol = null, $isin = null, $cusip = null) { $resourcePath = '/stock/profile'; @@ -2376,8 +2309,6 @@ protected function companyProfileRequest($symbol = null, $isin = null, $cusip = - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2391,21 +2322,17 @@ protected function companyProfileRequest($symbol = null, $isin = null, $cusip = } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2488,7 +2415,7 @@ public function companyProfile2WithHttpInfo($symbol = null, $isin = null, $cusip } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -2501,21 +2428,20 @@ public function companyProfile2WithHttpInfo($symbol = null, $isin = null, $cusip sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CompanyProfile2' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2526,11 +2452,10 @@ public function companyProfile2WithHttpInfo($symbol = null, $isin = null, $cusip } $returnType = '\Finnhub\Model\CompanyProfile2'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2597,11 +2522,10 @@ public function companyProfile2AsyncWithHttpInfo($symbol = null, $isin = null, $ ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2621,7 +2545,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2637,7 +2561,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyProfile2Request($symbol = null, $isin = null, $cusip = null) + public function companyProfile2Request($symbol = null, $isin = null, $cusip = null) { $resourcePath = '/stock/profile2'; @@ -2671,8 +2595,6 @@ protected function companyProfile2Request($symbol = null, $isin = null, $cusip = - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2686,21 +2608,17 @@ protected function companyProfile2Request($symbol = null, $isin = null, $cusip = } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2781,7 +2699,7 @@ public function companyRevenueEstimatesWithHttpInfo($symbol, $freq = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -2794,21 +2712,20 @@ public function companyRevenueEstimatesWithHttpInfo($symbol, $freq = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\RevenueEstimates' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2819,11 +2736,10 @@ public function companyRevenueEstimatesWithHttpInfo($symbol, $freq = null) } $returnType = '\Finnhub\Model\RevenueEstimates'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2888,11 +2804,10 @@ public function companyRevenueEstimatesAsyncWithHttpInfo($symbol, $freq = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -2912,7 +2827,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2927,7 +2842,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function companyRevenueEstimatesRequest($symbol, $freq = null) + public function companyRevenueEstimatesRequest($symbol, $freq = null) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -2960,8 +2875,6 @@ protected function companyRevenueEstimatesRequest($symbol, $freq = null) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2975,21 +2888,17 @@ protected function companyRevenueEstimatesRequest($symbol, $freq = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3066,7 +2975,7 @@ public function countryWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -3079,21 +2988,20 @@ public function countryWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CountryMetadata[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3104,11 +3012,10 @@ public function countryWithHttpInfo() } $returnType = '\Finnhub\Model\CountryMetadata[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3169,11 +3076,10 @@ public function countryAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3193,7 +3099,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3206,7 +3112,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function countryRequest() + public function countryRequest() { $resourcePath = '/country'; @@ -3219,8 +3125,6 @@ protected function countryRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3234,21 +3138,17 @@ protected function countryRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3325,7 +3225,7 @@ public function covid19WithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -3338,21 +3238,20 @@ public function covid19WithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CovidInfo[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3363,11 +3262,10 @@ public function covid19WithHttpInfo() } $returnType = '\Finnhub\Model\CovidInfo[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3428,11 +3326,10 @@ public function covid19AsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3452,7 +3349,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3465,7 +3362,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function covid19Request() + public function covid19Request() { $resourcePath = '/covid19/us'; @@ -3478,8 +3375,6 @@ protected function covid19Request() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3493,21 +3388,17 @@ protected function covid19Request() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3592,7 +3483,7 @@ public function cryptoCandlesWithHttpInfo($symbol, $resolution, $from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -3605,21 +3496,20 @@ public function cryptoCandlesWithHttpInfo($symbol, $resolution, $from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CryptoCandles' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3630,11 +3520,10 @@ public function cryptoCandlesWithHttpInfo($symbol, $resolution, $from, $to) } $returnType = '\Finnhub\Model\CryptoCandles'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3703,11 +3592,10 @@ public function cryptoCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3727,7 +3615,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3744,7 +3632,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cryptoCandlesRequest($symbol, $resolution, $from, $to) + public function cryptoCandlesRequest($symbol, $resolution, $from, $to) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -3809,8 +3697,6 @@ protected function cryptoCandlesRequest($symbol, $resolution, $from, $to) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3824,21 +3710,17 @@ protected function cryptoCandlesRequest($symbol, $resolution, $from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3915,7 +3797,7 @@ public function cryptoExchangesWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -3928,21 +3810,20 @@ public function cryptoExchangesWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('string[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -3953,11 +3834,10 @@ public function cryptoExchangesWithHttpInfo() } $returnType = 'string[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4018,11 +3898,10 @@ public function cryptoExchangesAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4042,7 +3921,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -4055,7 +3934,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cryptoExchangesRequest() + public function cryptoExchangesRequest() { $resourcePath = '/crypto/exchange'; @@ -4068,8 +3947,6 @@ protected function cryptoExchangesRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4083,21 +3960,17 @@ protected function cryptoExchangesRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4176,7 +4049,7 @@ public function cryptoSymbolsWithHttpInfo($exchange) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -4189,21 +4062,20 @@ public function cryptoSymbolsWithHttpInfo($exchange) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\CryptoSymbol[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4214,11 +4086,10 @@ public function cryptoSymbolsWithHttpInfo($exchange) } $returnType = '\Finnhub\Model\CryptoSymbol[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4281,11 +4152,10 @@ public function cryptoSymbolsAsyncWithHttpInfo($exchange) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4305,7 +4175,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -4319,7 +4189,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cryptoSymbolsRequest($exchange) + public function cryptoSymbolsRequest($exchange) { // verify the required parameter 'exchange' is set if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { @@ -4345,8 +4215,6 @@ protected function cryptoSymbolsRequest($exchange) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4360,21 +4228,17 @@ protected function cryptoSymbolsRequest($exchange) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4459,7 +4323,7 @@ public function earningsCalendarWithHttpInfo($from = null, $to = null, $symbol = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -4472,21 +4336,20 @@ public function earningsCalendarWithHttpInfo($from = null, $to = null, $symbol = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\EarningsCalendar' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4497,11 +4360,10 @@ public function earningsCalendarWithHttpInfo($from = null, $to = null, $symbol = } $returnType = '\Finnhub\Model\EarningsCalendar'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4570,11 +4432,10 @@ public function earningsCalendarAsyncWithHttpInfo($from = null, $to = null, $sym ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4594,7 +4455,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -4611,7 +4472,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function earningsCalendarRequest($from = null, $to = null, $symbol = null, $international = null) + public function earningsCalendarRequest($from = null, $to = null, $symbol = null, $international = null) { $resourcePath = '/calendar/earnings'; @@ -4652,8 +4513,6 @@ protected function earningsCalendarRequest($from = null, $to = null, $symbol = n - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4667,21 +4526,17 @@ protected function earningsCalendarRequest($from = null, $to = null, $symbol = n } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4722,34 +4577,36 @@ protected function earningsCalendarRequest($from = null, $to = null, $symbol = n } /** - * Operation economicCode + * Operation earningsCallTranscriptsApi * - * Economic Code + * Earnings Call Transcripts * + * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\EconomicCode[] + * @return \Finnhub\Model\EarningsCallTranscripts */ - public function economicCode() + public function earningsCallTranscriptsApi($id) { - list($response) = $this->economicCodeWithHttpInfo(); + list($response) = $this->earningsCallTranscriptsApiWithHttpInfo($id); return $response; } /** - * Operation economicCodeWithHttpInfo + * Operation earningsCallTranscriptsApiWithHttpInfo * - * Economic Code + * Earnings Call Transcripts * + * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\EconomicCode[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\EarningsCallTranscripts, HTTP status code, HTTP response headers (array of strings) */ - public function economicCodeWithHttpInfo() + public function earningsCallTranscriptsApiWithHttpInfo($id) { - $request = $this->economicCodeRequest(); + $request = $this->earningsCallTranscriptsApiRequest($id); try { $options = $this->createHttpClientOption(); @@ -4758,7 +4615,7 @@ public function economicCodeWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -4771,36 +4628,34 @@ public function economicCodeWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\EconomicCode[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\EarningsCallTranscripts' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\EconomicCode[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\EarningsCallTranscripts', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\EconomicCode[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\EarningsCallTranscripts'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4814,7 +4669,7 @@ public function economicCodeWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\EconomicCode[]', + '\Finnhub\Model\EarningsCallTranscripts', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4825,17 +4680,18 @@ public function economicCodeWithHttpInfo() } /** - * Operation economicCodeAsync + * Operation earningsCallTranscriptsApiAsync * - * Economic Code + * Earnings Call Transcripts * + * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function economicCodeAsync() + public function earningsCallTranscriptsApiAsync($id) { - return $this->economicCodeAsyncWithHttpInfo() + return $this->earningsCallTranscriptsApiAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -4844,28 +4700,28 @@ function ($response) { } /** - * Operation economicCodeAsyncWithHttpInfo + * Operation earningsCallTranscriptsApiAsyncWithHttpInfo * - * Economic Code + * Earnings Call Transcripts * + * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function economicCodeAsyncWithHttpInfo() + public function earningsCallTranscriptsApiAsyncWithHttpInfo($id) { - $returnType = '\Finnhub\Model\EconomicCode[]'; - $request = $this->economicCodeRequest(); + $returnType = '\Finnhub\Model\EarningsCallTranscripts'; + $request = $this->earningsCallTranscriptsApiRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -4885,34 +4741,46 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'economicCode' + * Create request for operation 'earningsCallTranscriptsApi' * + * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function economicCodeRequest() + public function earningsCallTranscriptsApiRequest($id) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling earningsCallTranscriptsApi' + ); + } - $resourcePath = '/economic/code'; + $resourcePath = '/stock/transcripts'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($id)) { + $id = ObjectSerializer::serializeCollection($id, '', true); + } + if ($id !== null) { + $queryParams['id'] = $id; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4926,21 +4794,17 @@ protected function economicCodeRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4981,36 +4845,34 @@ protected function economicCodeRequest() } /** - * Operation economicData + * Operation economicCode * - * Economic Data + * Economic Code * - * @param string $code Economic code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\EconomicData + * @return \Finnhub\Model\EconomicCode[] */ - public function economicData($code) + public function economicCode() { - list($response) = $this->economicDataWithHttpInfo($code); + list($response) = $this->economicCodeWithHttpInfo(); return $response; } /** - * Operation economicDataWithHttpInfo + * Operation economicCodeWithHttpInfo * - * Economic Data + * Economic Code * - * @param string $code Economic code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\EconomicData, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\EconomicCode[], HTTP status code, HTTP response headers (array of strings) */ - public function economicDataWithHttpInfo($code) + public function economicCodeWithHttpInfo() { - $request = $this->economicDataRequest($code); + $request = $this->economicCodeRequest(); try { $options = $this->createHttpClientOption(); @@ -5019,7 +4881,7 @@ public function economicDataWithHttpInfo($code) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -5032,36 +4894,34 @@ public function economicDataWithHttpInfo($code) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\EconomicData' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\EconomicCode[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\EconomicData', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\EconomicCode[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\EconomicData'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\EconomicCode[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5075,7 +4935,7 @@ public function economicDataWithHttpInfo($code) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\EconomicData', + '\Finnhub\Model\EconomicCode[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5086,18 +4946,17 @@ public function economicDataWithHttpInfo($code) } /** - * Operation economicDataAsync + * Operation economicCodeAsync * - * Economic Data + * Economic Code * - * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function economicDataAsync($code) + public function economicCodeAsync() { - return $this->economicDataAsyncWithHttpInfo($code) + return $this->economicCodeAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -5106,29 +4965,27 @@ function ($response) { } /** - * Operation economicDataAsyncWithHttpInfo + * Operation economicCodeAsyncWithHttpInfo * - * Economic Data + * Economic Code * - * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function economicDataAsyncWithHttpInfo($code) + public function economicCodeAsyncWithHttpInfo() { - $returnType = '\Finnhub\Model\EconomicData'; - $request = $this->economicDataRequest($code); + $returnType = '\Finnhub\Model\EconomicCode[]'; + $request = $this->economicCodeRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5148,48 +5005,32 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'economicData' + * Create request for operation 'economicCode' * - * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function economicDataRequest($code) + public function economicCodeRequest() { - // verify the required parameter 'code' is set - if ($code === null || (is_array($code) && count($code) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $code when calling economicData' - ); - } - $resourcePath = '/economic'; + $resourcePath = '/economic/code'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($code)) { - $code = ObjectSerializer::serializeCollection($code, '', true); - } - if ($code !== null) { - $queryParams['code'] = $code; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5203,21 +5044,17 @@ protected function economicDataRequest($code) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -5258,36 +5095,36 @@ protected function economicDataRequest($code) } /** - * Operation etfsCountryExposure + * Operation economicData * - * ETFs Country Exposure + * Economic Data * - * @param string $symbol ETF symbol. (required) + * @param string $code Economic code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\ETFsCountryExposure + * @return \Finnhub\Model\EconomicData */ - public function etfsCountryExposure($symbol) + public function economicData($code) { - list($response) = $this->etfsCountryExposureWithHttpInfo($symbol); + list($response) = $this->economicDataWithHttpInfo($code); return $response; } /** - * Operation etfsCountryExposureWithHttpInfo + * Operation economicDataWithHttpInfo * - * ETFs Country Exposure + * Economic Data * - * @param string $symbol ETF symbol. (required) + * @param string $code Economic code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\ETFsCountryExposure, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\EconomicData, HTTP status code, HTTP response headers (array of strings) */ - public function etfsCountryExposureWithHttpInfo($symbol) + public function economicDataWithHttpInfo($code) { - $request = $this->etfsCountryExposureRequest($symbol); + $request = $this->economicDataRequest($code); try { $options = $this->createHttpClientOption(); @@ -5296,7 +5133,7 @@ public function etfsCountryExposureWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -5309,36 +5146,34 @@ public function etfsCountryExposureWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\ETFsCountryExposure' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\EconomicData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsCountryExposure', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\EconomicData', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\ETFsCountryExposure'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\EconomicData'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5352,7 +5187,7 @@ public function etfsCountryExposureWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\ETFsCountryExposure', + '\Finnhub\Model\EconomicData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5363,18 +5198,18 @@ public function etfsCountryExposureWithHttpInfo($symbol) } /** - * Operation etfsCountryExposureAsync + * Operation economicDataAsync * - * ETFs Country Exposure + * Economic Data * - * @param string $symbol ETF symbol. (required) + * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsCountryExposureAsync($symbol) + public function economicDataAsync($code) { - return $this->etfsCountryExposureAsyncWithHttpInfo($symbol) + return $this->economicDataAsyncWithHttpInfo($code) ->then( function ($response) { return $response[0]; @@ -5383,29 +5218,28 @@ function ($response) { } /** - * Operation etfsCountryExposureAsyncWithHttpInfo + * Operation economicDataAsyncWithHttpInfo * - * ETFs Country Exposure + * Economic Data * - * @param string $symbol ETF symbol. (required) + * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsCountryExposureAsyncWithHttpInfo($symbol) + public function economicDataAsyncWithHttpInfo($code) { - $returnType = '\Finnhub\Model\ETFsCountryExposure'; - $request = $this->etfsCountryExposureRequest($symbol); + $returnType = '\Finnhub\Model\EconomicData'; + $request = $this->economicDataRequest($code); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5425,30 +5259,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'etfsCountryExposure' + * Create request for operation 'economicData' * - * @param string $symbol ETF symbol. (required) + * @param string $code Economic code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function etfsCountryExposureRequest($symbol) + public function economicDataRequest($code) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling etfsCountryExposure' + 'Missing the required parameter $code when calling economicData' ); } - $resourcePath = '/etf/country'; + $resourcePath = '/economic'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5456,17 +5290,15 @@ protected function etfsCountryExposureRequest($symbol) $multipart = false; // query params - if (is_array($symbol)) { - $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + if (is_array($code)) { + $code = ObjectSerializer::serializeCollection($code, '', true); } - if ($symbol !== null) { - $queryParams['symbol'] = $symbol; + if ($code !== null) { + $queryParams['code'] = $code; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5480,21 +5312,17 @@ protected function etfsCountryExposureRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -5535,36 +5363,36 @@ protected function etfsCountryExposureRequest($symbol) } /** - * Operation etfsHoldings + * Operation etfsCountryExposure * - * ETFs Holdings + * ETFs Country Exposure * * @param string $symbol ETF symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\ETFsHoldings + * @return \Finnhub\Model\ETFsCountryExposure */ - public function etfsHoldings($symbol) + public function etfsCountryExposure($symbol) { - list($response) = $this->etfsHoldingsWithHttpInfo($symbol); + list($response) = $this->etfsCountryExposureWithHttpInfo($symbol); return $response; } /** - * Operation etfsHoldingsWithHttpInfo + * Operation etfsCountryExposureWithHttpInfo * - * ETFs Holdings + * ETFs Country Exposure * * @param string $symbol ETF symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\ETFsHoldings, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\ETFsCountryExposure, HTTP status code, HTTP response headers (array of strings) */ - public function etfsHoldingsWithHttpInfo($symbol) + public function etfsCountryExposureWithHttpInfo($symbol) { - $request = $this->etfsHoldingsRequest($symbol); + $request = $this->etfsCountryExposureRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -5573,7 +5401,7 @@ public function etfsHoldingsWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -5586,36 +5414,34 @@ public function etfsHoldingsWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\ETFsHoldings' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\ETFsCountryExposure' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsHoldings', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsCountryExposure', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\ETFsHoldings'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\ETFsCountryExposure'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5629,7 +5455,7 @@ public function etfsHoldingsWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\ETFsHoldings', + '\Finnhub\Model\ETFsCountryExposure', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5640,18 +5466,18 @@ public function etfsHoldingsWithHttpInfo($symbol) } /** - * Operation etfsHoldingsAsync + * Operation etfsCountryExposureAsync * - * ETFs Holdings + * ETFs Country Exposure * * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsHoldingsAsync($symbol) + public function etfsCountryExposureAsync($symbol) { - return $this->etfsHoldingsAsyncWithHttpInfo($symbol) + return $this->etfsCountryExposureAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -5660,29 +5486,28 @@ function ($response) { } /** - * Operation etfsHoldingsAsyncWithHttpInfo + * Operation etfsCountryExposureAsyncWithHttpInfo * - * ETFs Holdings + * ETFs Country Exposure * * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsHoldingsAsyncWithHttpInfo($symbol) + public function etfsCountryExposureAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\ETFsHoldings'; - $request = $this->etfsHoldingsRequest($symbol); + $returnType = '\Finnhub\Model\ETFsCountryExposure'; + $request = $this->etfsCountryExposureRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5702,30 +5527,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'etfsHoldings' + * Create request for operation 'etfsCountryExposure' * * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function etfsHoldingsRequest($symbol) + public function etfsCountryExposureRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling etfsHoldings' + 'Missing the required parameter $symbol when calling etfsCountryExposure' ); } - $resourcePath = '/etf/holdings'; + $resourcePath = '/etf/country'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5742,8 +5567,6 @@ protected function etfsHoldingsRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5757,21 +5580,17 @@ protected function etfsHoldingsRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -5812,36 +5631,40 @@ protected function etfsHoldingsRequest($symbol) } /** - * Operation etfsIndustryExposure + * Operation etfsHoldings * - * ETFs Industry Exposure + * ETFs Holdings * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\ETFsIndustryExposure + * @return \Finnhub\Model\ETFsHoldings */ - public function etfsIndustryExposure($symbol) + public function etfsHoldings($symbol = null, $isin = null, $skip = null) { - list($response) = $this->etfsIndustryExposureWithHttpInfo($symbol); + list($response) = $this->etfsHoldingsWithHttpInfo($symbol, $isin, $skip); return $response; } /** - * Operation etfsIndustryExposureWithHttpInfo + * Operation etfsHoldingsWithHttpInfo * - * ETFs Industry Exposure + * ETFs Holdings * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\ETFsIndustryExposure, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\ETFsHoldings, HTTP status code, HTTP response headers (array of strings) */ - public function etfsIndustryExposureWithHttpInfo($symbol) + public function etfsHoldingsWithHttpInfo($symbol = null, $isin = null, $skip = null) { - $request = $this->etfsIndustryExposureRequest($symbol); + $request = $this->etfsHoldingsRequest($symbol, $isin, $skip); try { $options = $this->createHttpClientOption(); @@ -5850,7 +5673,7 @@ public function etfsIndustryExposureWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -5863,36 +5686,34 @@ public function etfsIndustryExposureWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\ETFsIndustryExposure' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\ETFsHoldings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsIndustryExposure', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsHoldings', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\ETFsIndustryExposure'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\ETFsHoldings'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5906,7 +5727,7 @@ public function etfsIndustryExposureWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\ETFsIndustryExposure', + '\Finnhub\Model\ETFsHoldings', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5917,18 +5738,20 @@ public function etfsIndustryExposureWithHttpInfo($symbol) } /** - * Operation etfsIndustryExposureAsync + * Operation etfsHoldingsAsync * - * ETFs Industry Exposure + * ETFs Holdings * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsIndustryExposureAsync($symbol) + public function etfsHoldingsAsync($symbol = null, $isin = null, $skip = null) { - return $this->etfsIndustryExposureAsyncWithHttpInfo($symbol) + return $this->etfsHoldingsAsyncWithHttpInfo($symbol, $isin, $skip) ->then( function ($response) { return $response[0]; @@ -5937,29 +5760,30 @@ function ($response) { } /** - * Operation etfsIndustryExposureAsyncWithHttpInfo + * Operation etfsHoldingsAsyncWithHttpInfo * - * ETFs Industry Exposure + * ETFs Holdings * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsIndustryExposureAsyncWithHttpInfo($symbol) + public function etfsHoldingsAsyncWithHttpInfo($symbol = null, $isin = null, $skip = null) { - $returnType = '\Finnhub\Model\ETFsIndustryExposure'; - $request = $this->etfsIndustryExposureRequest($symbol); + $returnType = '\Finnhub\Model\ETFsHoldings'; + $request = $this->etfsHoldingsRequest($symbol, $isin, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -5979,30 +5803,26 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'etfsIndustryExposure' + * Create request for operation 'etfsHoldings' * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function etfsIndustryExposureRequest($symbol) + public function etfsHoldingsRequest($symbol = null, $isin = null, $skip = null) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling etfsIndustryExposure' - ); - } - $resourcePath = '/etf/sector'; + $resourcePath = '/etf/holdings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6016,11 +5836,23 @@ protected function etfsIndustryExposureRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -6034,21 +5866,17 @@ protected function etfsIndustryExposureRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -6093,15 +5921,16 @@ protected function etfsIndustryExposureRequest($symbol) * * ETFs Profile * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Finnhub\Model\ETFsProfile */ - public function etfsProfile($symbol) + public function etfsProfile($symbol = null, $isin = null) { - list($response) = $this->etfsProfileWithHttpInfo($symbol); + list($response) = $this->etfsProfileWithHttpInfo($symbol, $isin); return $response; } @@ -6110,15 +5939,16 @@ public function etfsProfile($symbol) * * ETFs Profile * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Finnhub\Model\ETFsProfile, HTTP status code, HTTP response headers (array of strings) */ - public function etfsProfileWithHttpInfo($symbol) + public function etfsProfileWithHttpInfo($symbol = null, $isin = null) { - $request = $this->etfsProfileRequest($symbol); + $request = $this->etfsProfileRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -6127,7 +5957,7 @@ public function etfsProfileWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -6140,21 +5970,20 @@ public function etfsProfileWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\ETFsProfile' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6165,11 +5994,10 @@ public function etfsProfileWithHttpInfo($symbol) } $returnType = '\Finnhub\Model\ETFsProfile'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6198,14 +6026,15 @@ public function etfsProfileWithHttpInfo($symbol) * * ETFs Profile * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsProfileAsync($symbol) + public function etfsProfileAsync($symbol = null, $isin = null) { - return $this->etfsProfileAsyncWithHttpInfo($symbol) + return $this->etfsProfileAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -6218,25 +6047,25 @@ function ($response) { * * ETFs Profile * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function etfsProfileAsyncWithHttpInfo($symbol) + public function etfsProfileAsyncWithHttpInfo($symbol = null, $isin = null) { $returnType = '\Finnhub\Model\ETFsProfile'; - $request = $this->etfsProfileRequest($symbol); + $request = $this->etfsProfileRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6256,7 +6085,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -6265,19 +6094,14 @@ function ($exception) { /** * Create request for operation 'etfsProfile' * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function etfsProfileRequest($symbol) + public function etfsProfileRequest($symbol = null, $isin = null) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling etfsProfile' - ); - } $resourcePath = '/etf/profile'; $formParams = []; @@ -6293,11 +6117,16 @@ protected function etfsProfileRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -6311,21 +6140,17 @@ protected function etfsProfileRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -6366,46 +6191,36 @@ protected function etfsProfileRequest($symbol) } /** - * Operation filings + * Operation etfsSectorExposure * - * Filings + * ETFs Sector Exposure * - * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) - * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) - * @param \DateTime $from From date: 2020-03-15. (optional) - * @param \DateTime $to To date: 2020-03-16. (optional) + * @param string $symbol ETF symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Filing[] + * @return \Finnhub\Model\ETFsSectorExposure */ - public function filings($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + public function etfsSectorExposure($symbol) { - list($response) = $this->filingsWithHttpInfo($symbol, $cik, $access_number, $form, $from, $to); + list($response) = $this->etfsSectorExposureWithHttpInfo($symbol); return $response; } /** - * Operation filingsWithHttpInfo + * Operation etfsSectorExposureWithHttpInfo * - * Filings + * ETFs Sector Exposure * - * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) - * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) - * @param \DateTime $from From date: 2020-03-15. (optional) - * @param \DateTime $to To date: 2020-03-16. (optional) + * @param string $symbol ETF symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Filing[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\ETFsSectorExposure, HTTP status code, HTTP response headers (array of strings) */ - public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + public function etfsSectorExposureWithHttpInfo($symbol) { - $request = $this->filingsRequest($symbol, $cik, $access_number, $form, $from, $to); + $request = $this->etfsSectorExposureRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -6414,7 +6229,7 @@ public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -6427,36 +6242,34 @@ public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Filing[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\ETFsSectorExposure' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Filing[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\ETFsSectorExposure', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Filing[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\ETFsSectorExposure'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6470,7 +6283,7 @@ public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Filing[]', + '\Finnhub\Model\ETFsSectorExposure', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6481,23 +6294,18 @@ public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number } /** - * Operation filingsAsync + * Operation etfsSectorExposureAsync * - * Filings + * ETFs Sector Exposure * - * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) - * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) - * @param \DateTime $from From date: 2020-03-15. (optional) - * @param \DateTime $to To date: 2020-03-16. (optional) + * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function filingsAsync($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + public function etfsSectorExposureAsync($symbol) { - return $this->filingsAsyncWithHttpInfo($symbol, $cik, $access_number, $form, $from, $to) + return $this->etfsSectorExposureAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -6506,34 +6314,28 @@ function ($response) { } /** - * Operation filingsAsyncWithHttpInfo + * Operation etfsSectorExposureAsyncWithHttpInfo * - * Filings + * ETFs Sector Exposure * - * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) - * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) - * @param \DateTime $from From date: 2020-03-15. (optional) - * @param \DateTime $to To date: 2020-03-16. (optional) + * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function filingsAsyncWithHttpInfo($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + public function etfsSectorExposureAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\Filing[]'; - $request = $this->filingsRequest($symbol, $cik, $access_number, $form, $from, $to); + $returnType = '\Finnhub\Model\ETFsSectorExposure'; + $request = $this->etfsSectorExposureRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6553,29 +6355,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'filings' + * Create request for operation 'etfsSectorExposure' * - * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) - * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) - * @param \DateTime $from From date: 2020-03-15. (optional) - * @param \DateTime $to To date: 2020-03-16. (optional) + * @param string $symbol ETF symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function filingsRequest($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + public function etfsSectorExposureRequest($symbol) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling etfsSectorExposure' + ); + } - $resourcePath = '/stock/filings'; + $resourcePath = '/etf/sector'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6589,46 +6392,4203 @@ protected function filingsRequest($symbol = null, $cik = null, $access_number = if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($cik)) { - $cik = ObjectSerializer::serializeCollection($cik, '', true); - } - if ($cik !== null) { - $queryParams['cik'] = $cik; + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); } - // query params + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fdaCommitteeMeetingCalendar + * + * FDA Committee Meeting Calendar + * + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\FDAComitteeMeeting[] + */ + public function fdaCommitteeMeetingCalendar() + { + list($response) = $this->fdaCommitteeMeetingCalendarWithHttpInfo(); + return $response; + } + + /** + * Operation fdaCommitteeMeetingCalendarWithHttpInfo + * + * FDA Committee Meeting Calendar + * + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\FDAComitteeMeeting[], HTTP status code, HTTP response headers (array of strings) + */ + public function fdaCommitteeMeetingCalendarWithHttpInfo() + { + $request = $this->fdaCommitteeMeetingCalendarRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\FDAComitteeMeeting[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\FDAComitteeMeeting[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\FDAComitteeMeeting[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\FDAComitteeMeeting[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fdaCommitteeMeetingCalendarAsync + * + * FDA Committee Meeting Calendar + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fdaCommitteeMeetingCalendarAsync() + { + return $this->fdaCommitteeMeetingCalendarAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fdaCommitteeMeetingCalendarAsyncWithHttpInfo + * + * FDA Committee Meeting Calendar + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fdaCommitteeMeetingCalendarAsyncWithHttpInfo() + { + $returnType = '\Finnhub\Model\FDAComitteeMeeting[]'; + $request = $this->fdaCommitteeMeetingCalendarRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fdaCommitteeMeetingCalendar' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fdaCommitteeMeetingCalendarRequest() + { + + $resourcePath = '/fda-advisory-committee-calendar'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation filings + * + * SEC Filings + * + * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) + * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\Filing[] + */ + public function filings($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + { + list($response) = $this->filingsWithHttpInfo($symbol, $cik, $access_number, $form, $from, $to); + return $response; + } + + /** + * Operation filingsWithHttpInfo + * + * SEC Filings + * + * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) + * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\Filing[], HTTP status code, HTTP response headers (array of strings) + */ + public function filingsWithHttpInfo($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + { + $request = $this->filingsRequest($symbol, $cik, $access_number, $form, $from, $to); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\Filing[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\Filing[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\Filing[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\Filing[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation filingsAsync + * + * SEC Filings + * + * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) + * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function filingsAsync($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + { + return $this->filingsAsyncWithHttpInfo($symbol, $cik, $access_number, $form, $from, $to) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation filingsAsyncWithHttpInfo + * + * SEC Filings + * + * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) + * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function filingsAsyncWithHttpInfo($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + { + $returnType = '\Finnhub\Model\Filing[]'; + $request = $this->filingsRequest($symbol, $cik, $access_number, $form, $from, $to); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'filings' + * + * @param string $symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve data from. (optional) + * @param string $form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company. (optional) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function filingsRequest($symbol = null, $cik = null, $access_number = null, $form = null, $from = null, $to = null) + { + + $resourcePath = '/stock/filings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($cik)) { + $cik = ObjectSerializer::serializeCollection($cik, '', true); + } + if ($cik !== null) { + $queryParams['cik'] = $cik; + } + // query params + if (is_array($access_number)) { + $access_number = ObjectSerializer::serializeCollection($access_number, '', true); + } + if ($access_number !== null) { + $queryParams['accessNumber'] = $access_number; + } + // query params + if (is_array($form)) { + $form = ObjectSerializer::serializeCollection($form, '', true); + } + if ($form !== null) { + $queryParams['form'] = $form; + } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation filingsSentiment + * + * SEC Sentiment Analysis + * + * @param string $access_number Access number of a specific report you want to retrieve data from. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\SECSentimentAnalysis + */ + public function filingsSentiment($access_number) + { + list($response) = $this->filingsSentimentWithHttpInfo($access_number); + return $response; + } + + /** + * Operation filingsSentimentWithHttpInfo + * + * SEC Sentiment Analysis + * + * @param string $access_number Access number of a specific report you want to retrieve data from. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\SECSentimentAnalysis, HTTP status code, HTTP response headers (array of strings) + */ + public function filingsSentimentWithHttpInfo($access_number) + { + $request = $this->filingsSentimentRequest($access_number); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\SECSentimentAnalysis' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\SECSentimentAnalysis', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\SECSentimentAnalysis'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\SECSentimentAnalysis', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation filingsSentimentAsync + * + * SEC Sentiment Analysis + * + * @param string $access_number Access number of a specific report you want to retrieve data from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function filingsSentimentAsync($access_number) + { + return $this->filingsSentimentAsyncWithHttpInfo($access_number) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation filingsSentimentAsyncWithHttpInfo + * + * SEC Sentiment Analysis + * + * @param string $access_number Access number of a specific report you want to retrieve data from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function filingsSentimentAsyncWithHttpInfo($access_number) + { + $returnType = '\Finnhub\Model\SECSentimentAnalysis'; + $request = $this->filingsSentimentRequest($access_number); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'filingsSentiment' + * + * @param string $access_number Access number of a specific report you want to retrieve data from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function filingsSentimentRequest($access_number) + { + // verify the required parameter 'access_number' is set + if ($access_number === null || (is_array($access_number) && count($access_number) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $access_number when calling filingsSentiment' + ); + } + + $resourcePath = '/stock/filings-sentiment'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($access_number)) { + $access_number = ObjectSerializer::serializeCollection($access_number, '', true); + } + if ($access_number !== null) { + $queryParams['accessNumber'] = $access_number; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation financials + * + * Financial Statements + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) + * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\FinancialStatements + */ + public function financials($symbol, $statement, $freq) + { + list($response) = $this->financialsWithHttpInfo($symbol, $statement, $freq); + return $response; + } + + /** + * Operation financialsWithHttpInfo + * + * Financial Statements + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) + * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\FinancialStatements, HTTP status code, HTTP response headers (array of strings) + */ + public function financialsWithHttpInfo($symbol, $statement, $freq) + { + $request = $this->financialsRequest($symbol, $statement, $freq); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\FinancialStatements' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\FinancialStatements', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\FinancialStatements'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\FinancialStatements', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation financialsAsync + * + * Financial Statements + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) + * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function financialsAsync($symbol, $statement, $freq) + { + return $this->financialsAsyncWithHttpInfo($symbol, $statement, $freq) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation financialsAsyncWithHttpInfo + * + * Financial Statements + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) + * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function financialsAsyncWithHttpInfo($symbol, $statement, $freq) + { + $returnType = '\Finnhub\Model\FinancialStatements'; + $request = $this->financialsRequest($symbol, $statement, $freq); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'financials' + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) + * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function financialsRequest($symbol, $statement, $freq) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling financials' + ); + } + // verify the required parameter 'statement' is set + if ($statement === null || (is_array($statement) && count($statement) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $statement when calling financials' + ); + } + // verify the required parameter 'freq' is set + if ($freq === null || (is_array($freq) && count($freq) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $freq when calling financials' + ); + } + + $resourcePath = '/stock/financials'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($statement)) { + $statement = ObjectSerializer::serializeCollection($statement, '', true); + } + if ($statement !== null) { + $queryParams['statement'] = $statement; + } + // query params + if (is_array($freq)) { + $freq = ObjectSerializer::serializeCollection($freq, '', true); + } + if ($freq !== null) { + $queryParams['freq'] = $freq; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation financialsReported + * + * Financials As Reported + * + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) + * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\FinancialsAsReported + */ + public function financialsReported($symbol = null, $cik = null, $access_number = null, $freq = null) + { + list($response) = $this->financialsReportedWithHttpInfo($symbol, $cik, $access_number, $freq); + return $response; + } + + /** + * Operation financialsReportedWithHttpInfo + * + * Financials As Reported + * + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) + * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\FinancialsAsReported, HTTP status code, HTTP response headers (array of strings) + */ + public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $access_number = null, $freq = null) + { + $request = $this->financialsReportedRequest($symbol, $cik, $access_number, $freq); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\FinancialsAsReported' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\FinancialsAsReported', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\FinancialsAsReported'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\FinancialsAsReported', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation financialsReportedAsync + * + * Financials As Reported + * + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) + * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function financialsReportedAsync($symbol = null, $cik = null, $access_number = null, $freq = null) + { + return $this->financialsReportedAsyncWithHttpInfo($symbol, $cik, $access_number, $freq) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation financialsReportedAsyncWithHttpInfo + * + * Financials As Reported + * + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) + * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function financialsReportedAsyncWithHttpInfo($symbol = null, $cik = null, $access_number = null, $freq = null) + { + $returnType = '\Finnhub\Model\FinancialsAsReported'; + $request = $this->financialsReportedRequest($symbol, $cik, $access_number, $freq); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'financialsReported' + * + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) + * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) + * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function financialsReportedRequest($symbol = null, $cik = null, $access_number = null, $freq = null) + { + + $resourcePath = '/stock/financials-reported'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($cik)) { + $cik = ObjectSerializer::serializeCollection($cik, '', true); + } + if ($cik !== null) { + $queryParams['cik'] = $cik; + } + // query params if (is_array($access_number)) { $access_number = ObjectSerializer::serializeCollection($access_number, '', true); } - if ($access_number !== null) { - $queryParams['accessNumber'] = $access_number; + if ($access_number !== null) { + $queryParams['accessNumber'] = $access_number; + } + // query params + if (is_array($freq)) { + $freq = ObjectSerializer::serializeCollection($freq, '', true); + } + if ($freq !== null) { + $queryParams['freq'] = $freq; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexCandles + * + * Forex Candles + * + * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\ForexCandles + */ + public function forexCandles($symbol, $resolution, $from, $to) + { + list($response) = $this->forexCandlesWithHttpInfo($symbol, $resolution, $from, $to); + return $response; + } + + /** + * Operation forexCandlesWithHttpInfo + * + * Forex Candles + * + * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\ForexCandles, HTTP status code, HTTP response headers (array of strings) + */ + public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) + { + $request = $this->forexCandlesRequest($symbol, $resolution, $from, $to); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\ForexCandles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\ForexCandles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\ForexCandles'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\ForexCandles', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexCandlesAsync + * + * Forex Candles + * + * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexCandlesAsync($symbol, $resolution, $from, $to) + { + return $this->forexCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexCandlesAsyncWithHttpInfo + * + * Forex Candles + * + * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to) + { + $returnType = '\Finnhub\Model\ForexCandles'; + $request = $this->forexCandlesRequest($symbol, $resolution, $from, $to); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'forexCandles' + * + * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexCandlesRequest($symbol, $resolution, $from, $to) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling forexCandles' + ); + } + // verify the required parameter 'resolution' is set + if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $resolution when calling forexCandles' + ); + } + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling forexCandles' + ); + } + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to when calling forexCandles' + ); + } + + $resourcePath = '/forex/candle'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($resolution)) { + $resolution = ObjectSerializer::serializeCollection($resolution, '', true); + } + if ($resolution !== null) { + $queryParams['resolution'] = $resolution; + } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexExchanges + * + * Forex Exchanges + * + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string[] + */ + public function forexExchanges() + { + list($response) = $this->forexExchangesWithHttpInfo(); + return $response; + } + + /** + * Operation forexExchangesWithHttpInfo + * + * Forex Exchanges + * + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string[], HTTP status code, HTTP response headers (array of strings) + */ + public function forexExchangesWithHttpInfo() + { + $request = $this->forexExchangesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('string[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'string[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexExchangesAsync + * + * Forex Exchanges + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexExchangesAsync() + { + return $this->forexExchangesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexExchangesAsyncWithHttpInfo + * + * Forex Exchanges + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexExchangesAsyncWithHttpInfo() + { + $returnType = 'string[]'; + $request = $this->forexExchangesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'forexExchanges' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexExchangesRequest() + { + + $resourcePath = '/forex/exchange'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexRates + * + * Forex rates + * + * @param string $base Base currency. Default to EUR. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\Forexrates + */ + public function forexRates($base = null) + { + list($response) = $this->forexRatesWithHttpInfo($base); + return $response; + } + + /** + * Operation forexRatesWithHttpInfo + * + * Forex rates + * + * @param string $base Base currency. Default to EUR. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\Forexrates, HTTP status code, HTTP response headers (array of strings) + */ + public function forexRatesWithHttpInfo($base = null) + { + $request = $this->forexRatesRequest($base); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\Forexrates' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\Forexrates', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\Forexrates'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\Forexrates', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexRatesAsync + * + * Forex rates + * + * @param string $base Base currency. Default to EUR. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexRatesAsync($base = null) + { + return $this->forexRatesAsyncWithHttpInfo($base) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexRatesAsyncWithHttpInfo + * + * Forex rates + * + * @param string $base Base currency. Default to EUR. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexRatesAsyncWithHttpInfo($base = null) + { + $returnType = '\Finnhub\Model\Forexrates'; + $request = $this->forexRatesRequest($base); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'forexRates' + * + * @param string $base Base currency. Default to EUR. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexRatesRequest($base = null) + { + + $resourcePath = '/forex/rates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($base)) { + $base = ObjectSerializer::serializeCollection($base, '', true); + } + if ($base !== null) { + $queryParams['base'] = $base; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forexSymbols + * + * Forex Symbol + * + * @param string $exchange Exchange you want to get the list of symbols from. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\ForexSymbol[] + */ + public function forexSymbols($exchange) + { + list($response) = $this->forexSymbolsWithHttpInfo($exchange); + return $response; + } + + /** + * Operation forexSymbolsWithHttpInfo + * + * Forex Symbol + * + * @param string $exchange Exchange you want to get the list of symbols from. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\ForexSymbol[], HTTP status code, HTTP response headers (array of strings) + */ + public function forexSymbolsWithHttpInfo($exchange) + { + $request = $this->forexSymbolsRequest($exchange); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\ForexSymbol[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\ForexSymbol[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\ForexSymbol[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\ForexSymbol[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation forexSymbolsAsync + * + * Forex Symbol + * + * @param string $exchange Exchange you want to get the list of symbols from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexSymbolsAsync($exchange) + { + return $this->forexSymbolsAsyncWithHttpInfo($exchange) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forexSymbolsAsyncWithHttpInfo + * + * Forex Symbol + * + * @param string $exchange Exchange you want to get the list of symbols from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forexSymbolsAsyncWithHttpInfo($exchange) + { + $returnType = '\Finnhub\Model\ForexSymbol[]'; + $request = $this->forexSymbolsRequest($exchange); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'forexSymbols' + * + * @param string $exchange Exchange you want to get the list of symbols from. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forexSymbolsRequest($exchange) + { + // verify the required parameter 'exchange' is set + if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $exchange when calling forexSymbols' + ); + } + + $resourcePath = '/forex/symbol'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($exchange)) { + $exchange = ObjectSerializer::serializeCollection($exchange, '', true); + } + if ($exchange !== null) { + $queryParams['exchange'] = $exchange; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fundOwnership + * + * Fund Ownership + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\FundOwnership + */ + public function fundOwnership($symbol, $limit = null) + { + list($response) = $this->fundOwnershipWithHttpInfo($symbol, $limit); + return $response; + } + + /** + * Operation fundOwnershipWithHttpInfo + * + * Fund Ownership + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\FundOwnership, HTTP status code, HTTP response headers (array of strings) + */ + public function fundOwnershipWithHttpInfo($symbol, $limit = null) + { + $request = $this->fundOwnershipRequest($symbol, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\FundOwnership' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\FundOwnership', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\FundOwnership'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\FundOwnership', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fundOwnershipAsync + * + * Fund Ownership + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fundOwnershipAsync($symbol, $limit = null) + { + return $this->fundOwnershipAsyncWithHttpInfo($symbol, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fundOwnershipAsyncWithHttpInfo + * + * Fund Ownership + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fundOwnershipAsyncWithHttpInfo($symbol, $limit = null) + { + $returnType = '\Finnhub\Model\FundOwnership'; + $request = $this->fundOwnershipRequest($symbol, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fundOwnership' + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fundOwnershipRequest($symbol, $limit = null) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling fundOwnership' + ); + } + + $resourcePath = '/stock/fund-ownership'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indicesConstituents + * + * Indices Constituents + * + * @param string $symbol symbol (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\IndicesConstituents + */ + public function indicesConstituents($symbol) + { + list($response) = $this->indicesConstituentsWithHttpInfo($symbol); + return $response; + } + + /** + * Operation indicesConstituentsWithHttpInfo + * + * Indices Constituents + * + * @param string $symbol symbol (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\IndicesConstituents, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesConstituentsWithHttpInfo($symbol) + { + $request = $this->indicesConstituentsRequest($symbol); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\IndicesConstituents' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\IndicesConstituents', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\IndicesConstituents'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\IndicesConstituents', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesConstituentsAsync + * + * Indices Constituents + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesConstituentsAsync($symbol) + { + return $this->indicesConstituentsAsyncWithHttpInfo($symbol) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesConstituentsAsyncWithHttpInfo + * + * Indices Constituents + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesConstituentsAsyncWithHttpInfo($symbol) + { + $returnType = '\Finnhub\Model\IndicesConstituents'; + $request = $this->indicesConstituentsRequest($symbol); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indicesConstituents' + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesConstituentsRequest($symbol) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling indicesConstituents' + ); + } + + $resourcePath = '/index/constituents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indicesHistoricalConstituents + * + * Indices Historical Constituents + * + * @param string $symbol symbol (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\IndicesHistoricalConstituents + */ + public function indicesHistoricalConstituents($symbol) + { + list($response) = $this->indicesHistoricalConstituentsWithHttpInfo($symbol); + return $response; + } + + /** + * Operation indicesHistoricalConstituentsWithHttpInfo + * + * Indices Historical Constituents + * + * @param string $symbol symbol (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\IndicesHistoricalConstituents, HTTP status code, HTTP response headers (array of strings) + */ + public function indicesHistoricalConstituentsWithHttpInfo($symbol) + { + $request = $this->indicesHistoricalConstituentsRequest($symbol); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\IndicesHistoricalConstituents' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\IndicesHistoricalConstituents', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\IndicesHistoricalConstituents'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\IndicesHistoricalConstituents', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indicesHistoricalConstituentsAsync + * + * Indices Historical Constituents + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesHistoricalConstituentsAsync($symbol) + { + return $this->indicesHistoricalConstituentsAsyncWithHttpInfo($symbol) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indicesHistoricalConstituentsAsyncWithHttpInfo + * + * Indices Historical Constituents + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function indicesHistoricalConstituentsAsyncWithHttpInfo($symbol) + { + $returnType = '\Finnhub\Model\IndicesHistoricalConstituents'; + $request = $this->indicesHistoricalConstituentsRequest($symbol); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indicesHistoricalConstituents' + * + * @param string $symbol symbol (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indicesHistoricalConstituentsRequest($symbol) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling indicesHistoricalConstituents' + ); + } + + $resourcePath = '/index/historical-constituents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation insiderTransactions + * + * Insider Transactions + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\InsiderTransactions + */ + public function insiderTransactions($symbol, $from = null, $to = null) + { + list($response) = $this->insiderTransactionsWithHttpInfo($symbol, $from, $to); + return $response; + } + + /** + * Operation insiderTransactionsWithHttpInfo + * + * Insider Transactions + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\InsiderTransactions, HTTP status code, HTTP response headers (array of strings) + */ + public function insiderTransactionsWithHttpInfo($symbol, $from = null, $to = null) + { + $request = $this->insiderTransactionsRequest($symbol, $from, $to); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\InsiderTransactions' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\InsiderTransactions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\InsiderTransactions'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\InsiderTransactions', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation insiderTransactionsAsync + * + * Insider Transactions + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function insiderTransactionsAsync($symbol, $from = null, $to = null) + { + return $this->insiderTransactionsAsyncWithHttpInfo($symbol, $from, $to) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation insiderTransactionsAsyncWithHttpInfo + * + * Insider Transactions + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function insiderTransactionsAsyncWithHttpInfo($symbol, $from = null, $to = null) + { + $returnType = '\Finnhub\Model\InsiderTransactions'; + $request = $this->insiderTransactionsRequest($symbol, $from, $to); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'insiderTransactions' + * + * @param string $symbol Symbol of the company: AAPL. (required) + * @param \DateTime $from From date: 2020-03-15. (optional) + * @param \DateTime $to To date: 2020-03-16. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function insiderTransactionsRequest($symbol, $from = null, $to = null) + { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling insiderTransactions' + ); + } + + $resourcePath = '/stock/insider-transactions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation internationalFilings + * + * International Filings + * + * @param string $symbol Symbol. Leave empty to list latest filings. (optional) + * @param string $country Filter by country using country's 2-letter code. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\InternationalFiling[] + */ + public function internationalFilings($symbol = null, $country = null) + { + list($response) = $this->internationalFilingsWithHttpInfo($symbol, $country); + return $response; + } + + /** + * Operation internationalFilingsWithHttpInfo + * + * International Filings + * + * @param string $symbol Symbol. Leave empty to list latest filings. (optional) + * @param string $country Filter by country using country's 2-letter code. (optional) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\InternationalFiling[], HTTP status code, HTTP response headers (array of strings) + */ + public function internationalFilingsWithHttpInfo($symbol = null, $country = null) + { + $request = $this->internationalFilingsRequest($symbol, $country); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\InternationalFiling[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\InternationalFiling[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\InternationalFiling[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\InternationalFiling[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation internationalFilingsAsync + * + * International Filings + * + * @param string $symbol Symbol. Leave empty to list latest filings. (optional) + * @param string $country Filter by country using country's 2-letter code. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function internationalFilingsAsync($symbol = null, $country = null) + { + return $this->internationalFilingsAsyncWithHttpInfo($symbol, $country) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation internationalFilingsAsyncWithHttpInfo + * + * International Filings + * + * @param string $symbol Symbol. Leave empty to list latest filings. (optional) + * @param string $country Filter by country using country's 2-letter code. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function internationalFilingsAsyncWithHttpInfo($symbol = null, $country = null) + { + $returnType = '\Finnhub\Model\InternationalFiling[]'; + $request = $this->internationalFilingsRequest($symbol, $country); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'internationalFilings' + * + * @param string $symbol Symbol. Leave empty to list latest filings. (optional) + * @param string $country Filter by country using country's 2-letter code. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function internationalFilingsRequest($symbol = null, $country = null) + { + + $resourcePath = '/stock/international-filings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; } // query params - if (is_array($form)) { - $form = ObjectSerializer::serializeCollection($form, '', true); + if (is_array($country)) { + $country = ObjectSerializer::serializeCollection($country, '', true); } - if ($form !== null) { - $queryParams['form'] = $form; + if ($country !== null) { + $queryParams['country'] = $country; } - // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); } - if ($from !== null) { - $queryParams['from'] = $from; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('token'); + if ($apiKey !== null) { + $queryParams['token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation investmentThemesThematicInvesting + * + * Investment Themes (Thematic Investing) + * + * @param string $theme Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\InvestmentThemesThematicInvesting + */ + public function investmentThemesThematicInvesting($theme) + { + list($response) = $this->investmentThemesThematicInvestingWithHttpInfo($theme); + return $response; + } + + /** + * Operation investmentThemesThematicInvestingWithHttpInfo + * + * Investment Themes (Thematic Investing) + * + * @param string $theme Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\InvestmentThemesThematicInvesting, HTTP status code, HTTP response headers (array of strings) + */ + public function investmentThemesThematicInvestingWithHttpInfo($theme) + { + $request = $this->investmentThemesThematicInvestingRequest($theme); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Finnhub\Model\InvestmentThemesThematicInvesting' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\InvestmentThemesThematicInvesting', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\InvestmentThemesThematicInvesting'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Finnhub\Model\InvestmentThemesThematicInvesting', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation investmentThemesThematicInvestingAsync + * + * Investment Themes (Thematic Investing) + * + * @param string $theme Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function investmentThemesThematicInvestingAsync($theme) + { + return $this->investmentThemesThematicInvestingAsyncWithHttpInfo($theme) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation investmentThemesThematicInvestingAsyncWithHttpInfo + * + * Investment Themes (Thematic Investing) + * + * @param string $theme Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function investmentThemesThematicInvestingAsyncWithHttpInfo($theme) + { + $returnType = '\Finnhub\Model\InvestmentThemesThematicInvesting'; + $request = $this->investmentThemesThematicInvestingRequest($theme); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'investmentThemesThematicInvesting' + * + * @param string $theme Investment theme. A full list of themes supported can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing\">here</a>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function investmentThemesThematicInvestingRequest($theme) + { + // verify the required parameter 'theme' is set + if ($theme === null || (is_array($theme) && count($theme) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $theme when calling investmentThemesThematicInvesting' + ); } + + $resourcePath = '/stock/investment-theme'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); + if (is_array($theme)) { + $theme = ObjectSerializer::serializeCollection($theme, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($theme !== null) { + $queryParams['theme'] = $theme; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -6642,21 +10602,17 @@ protected function filingsRequest($symbol = null, $cik = null, $access_number = } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -6697,40 +10653,38 @@ protected function filingsRequest($symbol = null, $cik = null, $access_number = } /** - * Operation financials + * Operation ipoCalendar * - * Financial Statements + * IPO Calendar * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) - * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * @param \DateTime $from From date: 2020-03-15. (required) + * @param \DateTime $to To date: 2020-03-16. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\FinancialStatements + * @return \Finnhub\Model\IPOCalendar */ - public function financials($symbol, $statement, $freq) + public function ipoCalendar($from, $to) { - list($response) = $this->financialsWithHttpInfo($symbol, $statement, $freq); + list($response) = $this->ipoCalendarWithHttpInfo($from, $to); return $response; } /** - * Operation financialsWithHttpInfo + * Operation ipoCalendarWithHttpInfo * - * Financial Statements + * IPO Calendar * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) - * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * @param \DateTime $from From date: 2020-03-15. (required) + * @param \DateTime $to To date: 2020-03-16. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\FinancialStatements, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\IPOCalendar, HTTP status code, HTTP response headers (array of strings) */ - public function financialsWithHttpInfo($symbol, $statement, $freq) + public function ipoCalendarWithHttpInfo($from, $to) { - $request = $this->financialsRequest($symbol, $statement, $freq); + $request = $this->ipoCalendarRequest($from, $to); try { $options = $this->createHttpClientOption(); @@ -6739,7 +10693,7 @@ public function financialsWithHttpInfo($symbol, $statement, $freq) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -6752,36 +10706,34 @@ public function financialsWithHttpInfo($symbol, $statement, $freq) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\FinancialStatements' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\IPOCalendar' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\FinancialStatements', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\IPOCalendar', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\FinancialStatements'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\IPOCalendar'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6795,7 +10747,7 @@ public function financialsWithHttpInfo($symbol, $statement, $freq) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\FinancialStatements', + '\Finnhub\Model\IPOCalendar', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6806,20 +10758,19 @@ public function financialsWithHttpInfo($symbol, $statement, $freq) } /** - * Operation financialsAsync + * Operation ipoCalendarAsync * - * Financial Statements + * IPO Calendar * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) - * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * @param \DateTime $from From date: 2020-03-15. (required) + * @param \DateTime $to To date: 2020-03-16. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function financialsAsync($symbol, $statement, $freq) + public function ipoCalendarAsync($from, $to) { - return $this->financialsAsyncWithHttpInfo($symbol, $statement, $freq) + return $this->ipoCalendarAsyncWithHttpInfo($from, $to) ->then( function ($response) { return $response[0]; @@ -6828,31 +10779,29 @@ function ($response) { } /** - * Operation financialsAsyncWithHttpInfo + * Operation ipoCalendarAsyncWithHttpInfo * - * Financial Statements + * IPO Calendar * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) - * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * @param \DateTime $from From date: 2020-03-15. (required) + * @param \DateTime $to To date: 2020-03-16. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function financialsAsyncWithHttpInfo($symbol, $statement, $freq) + public function ipoCalendarAsyncWithHttpInfo($from, $to) { - $returnType = '\Finnhub\Model\FinancialStatements'; - $request = $this->financialsRequest($symbol, $statement, $freq); + $returnType = '\Finnhub\Model\IPOCalendar'; + $request = $this->ipoCalendarRequest($from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -6872,44 +10821,37 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'financials' + * Create request for operation 'ipoCalendar' * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param string $statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively. (required) - * @param string $freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow. (required) + * @param \DateTime $from From date: 2020-03-15. (required) + * @param \DateTime $to To date: 2020-03-16. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function financialsRequest($symbol, $statement, $freq) + public function ipoCalendarRequest($from, $to) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling financials' - ); - } - // verify the required parameter 'statement' is set - if ($statement === null || (is_array($statement) && count($statement) === 0)) { + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $statement when calling financials' + 'Missing the required parameter $from when calling ipoCalendar' ); } - // verify the required parameter 'freq' is set - if ($freq === null || (is_array($freq) && count($freq) === 0)) { + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $freq when calling financials' + 'Missing the required parameter $to when calling ipoCalendar' ); } - $resourcePath = '/stock/financials'; + $resourcePath = '/calendar/ipo'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6917,31 +10859,22 @@ protected function financialsRequest($symbol, $statement, $freq) $multipart = false; // query params - if (is_array($symbol)) { - $symbol = ObjectSerializer::serializeCollection($symbol, '', true); - } - if ($symbol !== null) { - $queryParams['symbol'] = $symbol; - } - // query params - if (is_array($statement)) { - $statement = ObjectSerializer::serializeCollection($statement, '', true); + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); } - if ($statement !== null) { - $queryParams['statement'] = $statement; + if ($from !== null) { + $queryParams['from'] = $from; } // query params - if (is_array($freq)) { - $freq = ObjectSerializer::serializeCollection($freq, '', true); + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); } - if ($freq !== null) { - $queryParams['freq'] = $freq; + if ($to !== null) { + $queryParams['to'] = $to; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -6955,21 +10888,17 @@ protected function financialsRequest($symbol, $statement, $freq) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -7010,42 +10939,38 @@ protected function financialsRequest($symbol, $statement, $freq) } /** - * Operation financialsReported + * Operation marketNews * - * Financials As Reported + * Market News * - * @param string $symbol Symbol. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) - * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\FinancialsAsReported + * @return \Finnhub\Model\News[] */ - public function financialsReported($symbol = null, $cik = null, $access_number = null, $freq = null) + public function marketNews($category, $min_id = null) { - list($response) = $this->financialsReportedWithHttpInfo($symbol, $cik, $access_number, $freq); + list($response) = $this->marketNewsWithHttpInfo($category, $min_id); return $response; } /** - * Operation financialsReportedWithHttpInfo + * Operation marketNewsWithHttpInfo * - * Financials As Reported + * Market News * - * @param string $symbol Symbol. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) - * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\FinancialsAsReported, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\News[], HTTP status code, HTTP response headers (array of strings) */ - public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $access_number = null, $freq = null) + public function marketNewsWithHttpInfo($category, $min_id = null) { - $request = $this->financialsReportedRequest($symbol, $cik, $access_number, $freq); + $request = $this->marketNewsRequest($category, $min_id); try { $options = $this->createHttpClientOption(); @@ -7054,7 +10979,7 @@ public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $acc } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -7067,36 +10992,34 @@ public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $acc sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\FinancialsAsReported' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\News[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\FinancialsAsReported', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\News[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\FinancialsAsReported'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\News[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7110,7 +11033,7 @@ public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $acc case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\FinancialsAsReported', + '\Finnhub\Model\News[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7121,21 +11044,19 @@ public function financialsReportedWithHttpInfo($symbol = null, $cik = null, $acc } /** - * Operation financialsReportedAsync + * Operation marketNewsAsync * - * Financials As Reported + * Market News * - * @param string $symbol Symbol. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) - * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function financialsReportedAsync($symbol = null, $cik = null, $access_number = null, $freq = null) + public function marketNewsAsync($category, $min_id = null) { - return $this->financialsReportedAsyncWithHttpInfo($symbol, $cik, $access_number, $freq) + return $this->marketNewsAsyncWithHttpInfo($category, $min_id) ->then( function ($response) { return $response[0]; @@ -7144,32 +11065,29 @@ function ($response) { } /** - * Operation financialsReportedAsyncWithHttpInfo + * Operation marketNewsAsyncWithHttpInfo * - * Financials As Reported + * Market News * - * @param string $symbol Symbol. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) - * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function financialsReportedAsyncWithHttpInfo($symbol = null, $cik = null, $access_number = null, $freq = null) + public function marketNewsAsyncWithHttpInfo($category, $min_id = null) { - $returnType = '\Finnhub\Model\FinancialsAsReported'; - $request = $this->financialsReportedRequest($symbol, $cik, $access_number, $freq); + $returnType = '\Finnhub\Model\News[]'; + $request = $this->marketNewsRequest($category, $min_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7189,27 +11107,31 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'financialsReported' + * Create request for operation 'marketNews' * - * @param string $symbol Symbol. (optional) - * @param string $cik CIK. (optional) - * @param string $access_number Access number of a specific report you want to retrieve financials from. (optional) - * @param string $freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>. (optional) + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function financialsReportedRequest($symbol = null, $cik = null, $access_number = null, $freq = null) + public function marketNewsRequest($category, $min_id = null) { + // verify the required parameter 'category' is set + if ($category === null || (is_array($category) && count($category) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $category when calling marketNews' + ); + } - $resourcePath = '/stock/financials-reported'; + $resourcePath = '/news'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7217,38 +11139,22 @@ protected function financialsReportedRequest($symbol = null, $cik = null, $acces $multipart = false; // query params - if (is_array($symbol)) { - $symbol = ObjectSerializer::serializeCollection($symbol, '', true); - } - if ($symbol !== null) { - $queryParams['symbol'] = $symbol; - } - // query params - if (is_array($cik)) { - $cik = ObjectSerializer::serializeCollection($cik, '', true); - } - if ($cik !== null) { - $queryParams['cik'] = $cik; - } - // query params - if (is_array($access_number)) { - $access_number = ObjectSerializer::serializeCollection($access_number, '', true); + if (is_array($category)) { + $category = ObjectSerializer::serializeCollection($category, '', true); } - if ($access_number !== null) { - $queryParams['accessNumber'] = $access_number; + if ($category !== null) { + $queryParams['category'] = $category; } // query params - if (is_array($freq)) { - $freq = ObjectSerializer::serializeCollection($freq, '', true); + if (is_array($min_id)) { + $min_id = ObjectSerializer::serializeCollection($min_id, '', true); } - if ($freq !== null) { - $queryParams['freq'] = $freq; + if ($min_id !== null) { + $queryParams['minId'] = $min_id; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -7262,21 +11168,17 @@ protected function financialsReportedRequest($symbol = null, $cik = null, $acces } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -7317,42 +11219,36 @@ protected function financialsReportedRequest($symbol = null, $cik = null, $acces } /** - * Operation forexCandles + * Operation mutualFundCountryExposure * - * Forex Candles + * Mutual Funds Country Exposure * - * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\ForexCandles + * @return \Finnhub\Model\MutualFundsCountryExposure */ - public function forexCandles($symbol, $resolution, $from, $to) + public function mutualFundCountryExposure($symbol) { - list($response) = $this->forexCandlesWithHttpInfo($symbol, $resolution, $from, $to); + list($response) = $this->mutualFundCountryExposureWithHttpInfo($symbol); return $response; } /** - * Operation forexCandlesWithHttpInfo + * Operation mutualFundCountryExposureWithHttpInfo * - * Forex Candles + * Mutual Funds Country Exposure * - * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\ForexCandles, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MutualFundsCountryExposure, HTTP status code, HTTP response headers (array of strings) */ - public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) + public function mutualFundCountryExposureWithHttpInfo($symbol) { - $request = $this->forexCandlesRequest($symbol, $resolution, $from, $to); + $request = $this->mutualFundCountryExposureRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -7361,7 +11257,7 @@ public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -7374,36 +11270,34 @@ public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\ForexCandles' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\MutualFundsCountryExposure' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\ForexCandles', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MutualFundsCountryExposure', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\ForexCandles'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\MutualFundsCountryExposure'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7417,7 +11311,7 @@ public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\ForexCandles', + '\Finnhub\Model\MutualFundsCountryExposure', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7428,21 +11322,18 @@ public function forexCandlesWithHttpInfo($symbol, $resolution, $from, $to) } /** - * Operation forexCandlesAsync + * Operation mutualFundCountryExposureAsync * - * Forex Candles + * Mutual Funds Country Exposure * - * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexCandlesAsync($symbol, $resolution, $from, $to) + public function mutualFundCountryExposureAsync($symbol) { - return $this->forexCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to) + return $this->mutualFundCountryExposureAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -7451,32 +11342,28 @@ function ($response) { } /** - * Operation forexCandlesAsyncWithHttpInfo + * Operation mutualFundCountryExposureAsyncWithHttpInfo * - * Forex Candles + * Mutual Funds Country Exposure * - * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to) + public function mutualFundCountryExposureAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\ForexCandles'; - $request = $this->forexCandlesRequest($symbol, $resolution, $from, $to); + $returnType = '\Finnhub\Model\MutualFundsCountryExposure'; + $request = $this->mutualFundCountryExposureRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7496,51 +11383,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'forexCandles' + * Create request for operation 'mutualFundCountryExposure' * - * @param string $symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function forexCandlesRequest($symbol, $resolution, $from, $to) + public function mutualFundCountryExposureRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling forexCandles' - ); - } - // verify the required parameter 'resolution' is set - if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $resolution when calling forexCandles' - ); - } - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling forexCandles' - ); - } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling forexCandles' + 'Missing the required parameter $symbol when calling mutualFundCountryExposure' ); } - $resourcePath = '/forex/candle'; + $resourcePath = '/mutual-fund/country'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7554,32 +11420,9 @@ protected function forexCandlesRequest($symbol, $resolution, $from, $to) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($resolution)) { - $resolution = ObjectSerializer::serializeCollection($resolution, '', true); - } - if ($resolution !== null) { - $queryParams['resolution'] = $resolution; - } - // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); - } - if ($from !== null) { - $queryParams['from'] = $from; - } - // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); - } - if ($to !== null) { - $queryParams['to'] = $to; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -7593,21 +11436,17 @@ protected function forexCandlesRequest($symbol, $resolution, $from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -7648,34 +11487,40 @@ protected function forexCandlesRequest($symbol, $resolution, $from, $to) } /** - * Operation forexExchanges + * Operation mutualFundHoldings * - * Forex Exchanges + * Mutual Funds Holdings * + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string[] + * @return \Finnhub\Model\MutualFundsHoldings */ - public function forexExchanges() + public function mutualFundHoldings($symbol = null, $isin = null, $skip = null) { - list($response) = $this->forexExchangesWithHttpInfo(); + list($response) = $this->mutualFundHoldingsWithHttpInfo($symbol, $isin, $skip); return $response; } /** - * Operation forexExchangesWithHttpInfo + * Operation mutualFundHoldingsWithHttpInfo * - * Forex Exchanges + * Mutual Funds Holdings * + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MutualFundsHoldings, HTTP status code, HTTP response headers (array of strings) */ - public function forexExchangesWithHttpInfo() + public function mutualFundHoldingsWithHttpInfo($symbol = null, $isin = null, $skip = null) { - $request = $this->forexExchangesRequest(); + $request = $this->mutualFundHoldingsRequest($symbol, $isin, $skip); try { $options = $this->createHttpClientOption(); @@ -7684,7 +11529,7 @@ public function forexExchangesWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -7697,36 +11542,34 @@ public function forexExchangesWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\MutualFundsHoldings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, 'string[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MutualFundsHoldings', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\MutualFundsHoldings'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7740,7 +11583,7 @@ public function forexExchangesWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string[]', + '\Finnhub\Model\MutualFundsHoldings', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7751,17 +11594,20 @@ public function forexExchangesWithHttpInfo() } /** - * Operation forexExchangesAsync + * Operation mutualFundHoldingsAsync * - * Forex Exchanges + * Mutual Funds Holdings * + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexExchangesAsync() + public function mutualFundHoldingsAsync($symbol = null, $isin = null, $skip = null) { - return $this->forexExchangesAsyncWithHttpInfo() + return $this->mutualFundHoldingsAsyncWithHttpInfo($symbol, $isin, $skip) ->then( function ($response) { return $response[0]; @@ -7770,28 +11616,30 @@ function ($response) { } /** - * Operation forexExchangesAsyncWithHttpInfo + * Operation mutualFundHoldingsAsyncWithHttpInfo * - * Forex Exchanges + * Mutual Funds Holdings * + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexExchangesAsyncWithHttpInfo() + public function mutualFundHoldingsAsyncWithHttpInfo($symbol = null, $isin = null, $skip = null) { - $returnType = 'string[]'; - $request = $this->forexExchangesRequest(); + $returnType = '\Finnhub\Model\MutualFundsHoldings'; + $request = $this->mutualFundHoldingsRequest($symbol, $isin, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -7811,34 +11659,56 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'forexExchanges' + * Create request for operation 'mutualFundHoldings' * + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) + * @param int $skip Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function forexExchangesRequest() + public function mutualFundHoldingsRequest($symbol = null, $isin = null, $skip = null) { - $resourcePath = '/forex/exchange'; + $resourcePath = '/mutual-fund/holdings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + } + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -7852,21 +11722,17 @@ protected function forexExchangesRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -7907,36 +11773,38 @@ protected function forexExchangesRequest() } /** - * Operation forexRates + * Operation mutualFundProfile * - * Forex rates + * Mutual Funds Profile * - * @param string $base Base currency. Default to EUR. (optional) + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Forexrates + * @return \Finnhub\Model\MutualFundsProfile */ - public function forexRates($base = null) + public function mutualFundProfile($symbol = null, $isin = null) { - list($response) = $this->forexRatesWithHttpInfo($base); + list($response) = $this->mutualFundProfileWithHttpInfo($symbol, $isin); return $response; } /** - * Operation forexRatesWithHttpInfo + * Operation mutualFundProfileWithHttpInfo * - * Forex rates + * Mutual Funds Profile * - * @param string $base Base currency. Default to EUR. (optional) + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Forexrates, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MutualFundsProfile, HTTP status code, HTTP response headers (array of strings) */ - public function forexRatesWithHttpInfo($base = null) + public function mutualFundProfileWithHttpInfo($symbol = null, $isin = null) { - $request = $this->forexRatesRequest($base); + $request = $this->mutualFundProfileRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -7945,7 +11813,7 @@ public function forexRatesWithHttpInfo($base = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -7958,36 +11826,34 @@ public function forexRatesWithHttpInfo($base = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Forexrates' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\MutualFundsProfile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Forexrates', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MutualFundsProfile', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Forexrates'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\MutualFundsProfile'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8001,7 +11867,7 @@ public function forexRatesWithHttpInfo($base = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Forexrates', + '\Finnhub\Model\MutualFundsProfile', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8012,18 +11878,19 @@ public function forexRatesWithHttpInfo($base = null) } /** - * Operation forexRatesAsync + * Operation mutualFundProfileAsync * - * Forex rates + * Mutual Funds Profile * - * @param string $base Base currency. Default to EUR. (optional) + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexRatesAsync($base = null) + public function mutualFundProfileAsync($symbol = null, $isin = null) { - return $this->forexRatesAsyncWithHttpInfo($base) + return $this->mutualFundProfileAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -8032,29 +11899,29 @@ function ($response) { } /** - * Operation forexRatesAsyncWithHttpInfo + * Operation mutualFundProfileAsyncWithHttpInfo * - * Forex rates + * Mutual Funds Profile * - * @param string $base Base currency. Default to EUR. (optional) + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexRatesAsyncWithHttpInfo($base = null) + public function mutualFundProfileAsyncWithHttpInfo($symbol = null, $isin = null) { - $returnType = '\Finnhub\Model\Forexrates'; - $request = $this->forexRatesRequest($base); + $returnType = '\Finnhub\Model\MutualFundsProfile'; + $request = $this->mutualFundProfileRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8074,24 +11941,25 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'forexRates' + * Create request for operation 'mutualFundProfile' * - * @param string $base Base currency. Default to EUR. (optional) + * @param string $symbol Fund's symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function forexRatesRequest($base = null) + public function mutualFundProfileRequest($symbol = null, $isin = null) { - $resourcePath = '/forex/rates'; + $resourcePath = '/mutual-fund/profile'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8099,17 +11967,22 @@ protected function forexRatesRequest($base = null) $multipart = false; // query params - if (is_array($base)) { - $base = ObjectSerializer::serializeCollection($base, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($base !== null) { - $queryParams['base'] = $base; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -8123,21 +11996,17 @@ protected function forexRatesRequest($base = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -8178,36 +12047,36 @@ protected function forexRatesRequest($base = null) } /** - * Operation forexSymbols + * Operation mutualFundSectorExposure * - * Forex Symbol + * Mutual-fund Sector Exposure * - * @param string $exchange Exchange you want to get the list of symbols from. (required) + * @param string $symbol Mutual Fund symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\ForexSymbol[] + * @return \Finnhub\Model\MutualFundSectorExposure */ - public function forexSymbols($exchange) + public function mutualFundSectorExposure($symbol) { - list($response) = $this->forexSymbolsWithHttpInfo($exchange); + list($response) = $this->mutualFundSectorExposureWithHttpInfo($symbol); return $response; } /** - * Operation forexSymbolsWithHttpInfo + * Operation mutualFundSectorExposureWithHttpInfo * - * Forex Symbol + * Mutual-fund Sector Exposure * - * @param string $exchange Exchange you want to get the list of symbols from. (required) + * @param string $symbol Mutual Fund symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\ForexSymbol[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MutualFundSectorExposure, HTTP status code, HTTP response headers (array of strings) */ - public function forexSymbolsWithHttpInfo($exchange) + public function mutualFundSectorExposureWithHttpInfo($symbol) { - $request = $this->forexSymbolsRequest($exchange); + $request = $this->mutualFundSectorExposureRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -8216,7 +12085,7 @@ public function forexSymbolsWithHttpInfo($exchange) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -8229,36 +12098,34 @@ public function forexSymbolsWithHttpInfo($exchange) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\ForexSymbol[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\MutualFundSectorExposure' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\ForexSymbol[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MutualFundSectorExposure', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\ForexSymbol[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\MutualFundSectorExposure'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8272,7 +12139,7 @@ public function forexSymbolsWithHttpInfo($exchange) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\ForexSymbol[]', + '\Finnhub\Model\MutualFundSectorExposure', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8283,18 +12150,18 @@ public function forexSymbolsWithHttpInfo($exchange) } /** - * Operation forexSymbolsAsync + * Operation mutualFundSectorExposureAsync * - * Forex Symbol + * Mutual-fund Sector Exposure * - * @param string $exchange Exchange you want to get the list of symbols from. (required) + * @param string $symbol Mutual Fund symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexSymbolsAsync($exchange) + public function mutualFundSectorExposureAsync($symbol) { - return $this->forexSymbolsAsyncWithHttpInfo($exchange) + return $this->mutualFundSectorExposureAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -8303,29 +12170,28 @@ function ($response) { } /** - * Operation forexSymbolsAsyncWithHttpInfo + * Operation mutualFundSectorExposureAsyncWithHttpInfo * - * Forex Symbol + * Mutual-fund Sector Exposure * - * @param string $exchange Exchange you want to get the list of symbols from. (required) + * @param string $symbol Mutual Fund symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forexSymbolsAsyncWithHttpInfo($exchange) + public function mutualFundSectorExposureAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\ForexSymbol[]'; - $request = $this->forexSymbolsRequest($exchange); + $returnType = '\Finnhub\Model\MutualFundSectorExposure'; + $request = $this->mutualFundSectorExposureRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8345,30 +12211,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'forexSymbols' + * Create request for operation 'mutualFundSectorExposure' * - * @param string $exchange Exchange you want to get the list of symbols from. (required) + * @param string $symbol Mutual Fund symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function forexSymbolsRequest($exchange) + public function mutualFundSectorExposureRequest($symbol) { - // verify the required parameter 'exchange' is set - if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $exchange when calling forexSymbols' + 'Missing the required parameter $symbol when calling mutualFundSectorExposure' ); } - $resourcePath = '/forex/symbol'; + $resourcePath = '/mutual-fund/sector'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8376,17 +12242,15 @@ protected function forexSymbolsRequest($exchange) $multipart = false; // query params - if (is_array($exchange)) { - $exchange = ObjectSerializer::serializeCollection($exchange, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($exchange !== null) { - $queryParams['exchange'] = $exchange; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -8400,21 +12264,17 @@ protected function forexSymbolsRequest($exchange) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -8455,38 +12315,36 @@ protected function forexSymbolsRequest($exchange) } /** - * Operation fundOwnership + * Operation newsSentiment * - * Fund Ownership + * News Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * @param string $symbol Company symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\FundOwnership + * @return \Finnhub\Model\NewsSentiment */ - public function fundOwnership($symbol, $limit = null) + public function newsSentiment($symbol) { - list($response) = $this->fundOwnershipWithHttpInfo($symbol, $limit); + list($response) = $this->newsSentimentWithHttpInfo($symbol); return $response; } /** - * Operation fundOwnershipWithHttpInfo + * Operation newsSentimentWithHttpInfo * - * Fund Ownership + * News Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * @param string $symbol Company symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\FundOwnership, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\NewsSentiment, HTTP status code, HTTP response headers (array of strings) */ - public function fundOwnershipWithHttpInfo($symbol, $limit = null) + public function newsSentimentWithHttpInfo($symbol) { - $request = $this->fundOwnershipRequest($symbol, $limit); + $request = $this->newsSentimentRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -8495,7 +12353,7 @@ public function fundOwnershipWithHttpInfo($symbol, $limit = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -8508,36 +12366,34 @@ public function fundOwnershipWithHttpInfo($symbol, $limit = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\FundOwnership' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\NewsSentiment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\FundOwnership', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\NewsSentiment', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\FundOwnership'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\NewsSentiment'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8551,7 +12407,7 @@ public function fundOwnershipWithHttpInfo($symbol, $limit = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\FundOwnership', + '\Finnhub\Model\NewsSentiment', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8562,19 +12418,18 @@ public function fundOwnershipWithHttpInfo($symbol, $limit = null) } /** - * Operation fundOwnershipAsync + * Operation newsSentimentAsync * - * Fund Ownership + * News Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * @param string $symbol Company symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fundOwnershipAsync($symbol, $limit = null) + public function newsSentimentAsync($symbol) { - return $this->fundOwnershipAsyncWithHttpInfo($symbol, $limit) + return $this->newsSentimentAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -8583,30 +12438,28 @@ function ($response) { } /** - * Operation fundOwnershipAsyncWithHttpInfo + * Operation newsSentimentAsyncWithHttpInfo * - * Fund Ownership + * News Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * @param string $symbol Company symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fundOwnershipAsyncWithHttpInfo($symbol, $limit = null) + public function newsSentimentAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\FundOwnership'; - $request = $this->fundOwnershipRequest($symbol, $limit); + $returnType = '\Finnhub\Model\NewsSentiment'; + $request = $this->newsSentimentRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8626,31 +12479,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'fundOwnership' + * Create request for operation 'newsSentiment' * - * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) + * @param string $symbol Company symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fundOwnershipRequest($symbol, $limit = null) + public function newsSentimentRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling fundOwnership' + 'Missing the required parameter $symbol when calling newsSentiment' ); } - $resourcePath = '/stock/fund-ownership'; + $resourcePath = '/news-sentiment'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8664,18 +12516,9 @@ protected function fundOwnershipRequest($symbol, $limit = null) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } - if ($limit !== null) { - $queryParams['limit'] = $limit; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -8689,21 +12532,17 @@ protected function fundOwnershipRequest($symbol, $limit = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -8744,38 +12583,38 @@ protected function fundOwnershipRequest($symbol, $limit = null) } /** - * Operation generalNews + * Operation ownership * - * General News + * Ownership * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\News[] + * @return \Finnhub\Model\Ownership */ - public function generalNews($category, $min_id = null) + public function ownership($symbol, $limit = null) { - list($response) = $this->generalNewsWithHttpInfo($category, $min_id); + list($response) = $this->ownershipWithHttpInfo($symbol, $limit); return $response; } /** - * Operation generalNewsWithHttpInfo + * Operation ownershipWithHttpInfo * - * General News + * Ownership * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\News[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Ownership, HTTP status code, HTTP response headers (array of strings) */ - public function generalNewsWithHttpInfo($category, $min_id = null) + public function ownershipWithHttpInfo($symbol, $limit = null) { - $request = $this->generalNewsRequest($category, $min_id); + $request = $this->ownershipRequest($symbol, $limit); try { $options = $this->createHttpClientOption(); @@ -8784,7 +12623,7 @@ public function generalNewsWithHttpInfo($category, $min_id = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -8797,36 +12636,34 @@ public function generalNewsWithHttpInfo($category, $min_id = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\News[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Ownership' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\News[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Ownership', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\News[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Ownership'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8840,7 +12677,7 @@ public function generalNewsWithHttpInfo($category, $min_id = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\News[]', + '\Finnhub\Model\Ownership', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8851,19 +12688,19 @@ public function generalNewsWithHttpInfo($category, $min_id = null) } /** - * Operation generalNewsAsync + * Operation ownershipAsync * - * General News + * Ownership * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generalNewsAsync($category, $min_id = null) + public function ownershipAsync($symbol, $limit = null) { - return $this->generalNewsAsyncWithHttpInfo($category, $min_id) + return $this->ownershipAsyncWithHttpInfo($symbol, $limit) ->then( function ($response) { return $response[0]; @@ -8872,30 +12709,29 @@ function ($response) { } /** - * Operation generalNewsAsyncWithHttpInfo + * Operation ownershipAsyncWithHttpInfo * - * General News + * Ownership * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generalNewsAsyncWithHttpInfo($category, $min_id = null) + public function ownershipAsyncWithHttpInfo($symbol, $limit = null) { - $returnType = '\Finnhub\Model\News[]'; - $request = $this->generalNewsRequest($category, $min_id); + $returnType = '\Finnhub\Model\Ownership'; + $request = $this->ownershipRequest($symbol, $limit); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -8915,31 +12751,31 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'generalNews' + * Create request for operation 'ownership' * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param string $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $symbol Symbol of the company: AAPL. (required) + * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function generalNewsRequest($category, $min_id = null) + public function ownershipRequest($symbol, $limit = null) { - // verify the required parameter 'category' is set - if ($category === null || (is_array($category) && count($category) === 0)) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category when calling generalNews' + 'Missing the required parameter $symbol when calling ownership' ); } - $resourcePath = '/news'; + $resourcePath = '/stock/ownership'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8947,24 +12783,22 @@ protected function generalNewsRequest($category, $min_id = null) $multipart = false; // query params - if (is_array($category)) { - $category = ObjectSerializer::serializeCollection($category, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($category !== null) { - $queryParams['category'] = $category; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; } // query params - if (is_array($min_id)) { - $min_id = ObjectSerializer::serializeCollection($min_id, '', true); + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); } - if ($min_id !== null) { - $queryParams['minId'] = $min_id; + if ($limit !== null) { + $queryParams['limit'] = $limit; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -8978,21 +12812,17 @@ protected function generalNewsRequest($category, $min_id = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -9033,36 +12863,38 @@ protected function generalNewsRequest($category, $min_id = null) } /** - * Operation indicesConstituents + * Operation patternRecognition * - * Indices Constituents + * Pattern Recognition * - * @param string $symbol symbol (required) + * @param string $symbol Symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\IndicesConstituents + * @return \Finnhub\Model\PatternRecognition */ - public function indicesConstituents($symbol) + public function patternRecognition($symbol, $resolution) { - list($response) = $this->indicesConstituentsWithHttpInfo($symbol); + list($response) = $this->patternRecognitionWithHttpInfo($symbol, $resolution); return $response; } /** - * Operation indicesConstituentsWithHttpInfo + * Operation patternRecognitionWithHttpInfo * - * Indices Constituents + * Pattern Recognition * - * @param string $symbol symbol (required) + * @param string $symbol Symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\IndicesConstituents, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\PatternRecognition, HTTP status code, HTTP response headers (array of strings) */ - public function indicesConstituentsWithHttpInfo($symbol) + public function patternRecognitionWithHttpInfo($symbol, $resolution) { - $request = $this->indicesConstituentsRequest($symbol); + $request = $this->patternRecognitionRequest($symbol, $resolution); try { $options = $this->createHttpClientOption(); @@ -9071,7 +12903,7 @@ public function indicesConstituentsWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -9084,36 +12916,34 @@ public function indicesConstituentsWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\IndicesConstituents' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\PatternRecognition' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\IndicesConstituents', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\PatternRecognition', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\IndicesConstituents'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\PatternRecognition'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9127,7 +12957,7 @@ public function indicesConstituentsWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\IndicesConstituents', + '\Finnhub\Model\PatternRecognition', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9138,18 +12968,19 @@ public function indicesConstituentsWithHttpInfo($symbol) } /** - * Operation indicesConstituentsAsync + * Operation patternRecognitionAsync * - * Indices Constituents + * Pattern Recognition * - * @param string $symbol symbol (required) + * @param string $symbol Symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function indicesConstituentsAsync($symbol) + public function patternRecognitionAsync($symbol, $resolution) { - return $this->indicesConstituentsAsyncWithHttpInfo($symbol) + return $this->patternRecognitionAsyncWithHttpInfo($symbol, $resolution) ->then( function ($response) { return $response[0]; @@ -9158,29 +12989,29 @@ function ($response) { } /** - * Operation indicesConstituentsAsyncWithHttpInfo + * Operation patternRecognitionAsyncWithHttpInfo * - * Indices Constituents + * Pattern Recognition * - * @param string $symbol symbol (required) + * @param string $symbol Symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function indicesConstituentsAsyncWithHttpInfo($symbol) + public function patternRecognitionAsyncWithHttpInfo($symbol, $resolution) { - $returnType = '\Finnhub\Model\IndicesConstituents'; - $request = $this->indicesConstituentsRequest($symbol); + $returnType = '\Finnhub\Model\PatternRecognition'; + $request = $this->patternRecognitionRequest($symbol, $resolution); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9200,30 +13031,37 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'indicesConstituents' + * Create request for operation 'patternRecognition' * - * @param string $symbol symbol (required) + * @param string $symbol Symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function indicesConstituentsRequest($symbol) + public function patternRecognitionRequest($symbol, $resolution) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling indicesConstituents' + 'Missing the required parameter $symbol when calling patternRecognition' + ); + } + // verify the required parameter 'resolution' is set + if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $resolution when calling patternRecognition' ); } - $resourcePath = '/index/constituents'; + $resourcePath = '/scan/pattern'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9237,11 +13075,16 @@ protected function indicesConstituentsRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($resolution)) { + $resolution = ObjectSerializer::serializeCollection($resolution, '', true); + } + if ($resolution !== null) { + $queryParams['resolution'] = $resolution; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -9255,21 +13098,17 @@ protected function indicesConstituentsRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -9310,36 +13149,40 @@ protected function indicesConstituentsRequest($symbol) } /** - * Operation indicesHistoricalConstituents + * Operation pressReleases * - * Indices Historical Constituents + * Major Press Releases * - * @param string $symbol symbol (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From time: 2020-01-01. (optional) + * @param \DateTime $to To time: 2020-01-05. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\IndicesHistoricalConstituents + * @return \Finnhub\Model\MajorPressReleases */ - public function indicesHistoricalConstituents($symbol) + public function pressReleases($symbol, $from = null, $to = null) { - list($response) = $this->indicesHistoricalConstituentsWithHttpInfo($symbol); + list($response) = $this->pressReleasesWithHttpInfo($symbol, $from, $to); return $response; } /** - * Operation indicesHistoricalConstituentsWithHttpInfo + * Operation pressReleasesWithHttpInfo * - * Indices Historical Constituents + * Major Press Releases * - * @param string $symbol symbol (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From time: 2020-01-01. (optional) + * @param \DateTime $to To time: 2020-01-05. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\IndicesHistoricalConstituents, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MajorPressReleases, HTTP status code, HTTP response headers (array of strings) */ - public function indicesHistoricalConstituentsWithHttpInfo($symbol) + public function pressReleasesWithHttpInfo($symbol, $from = null, $to = null) { - $request = $this->indicesHistoricalConstituentsRequest($symbol); + $request = $this->pressReleasesRequest($symbol, $from, $to); try { $options = $this->createHttpClientOption(); @@ -9348,7 +13191,7 @@ public function indicesHistoricalConstituentsWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -9361,36 +13204,34 @@ public function indicesHistoricalConstituentsWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\IndicesHistoricalConstituents' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\MajorPressReleases' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\IndicesHistoricalConstituents', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MajorPressReleases', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\IndicesHistoricalConstituents'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\MajorPressReleases'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9404,7 +13245,7 @@ public function indicesHistoricalConstituentsWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\IndicesHistoricalConstituents', + '\Finnhub\Model\MajorPressReleases', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9415,18 +13256,20 @@ public function indicesHistoricalConstituentsWithHttpInfo($symbol) } /** - * Operation indicesHistoricalConstituentsAsync + * Operation pressReleasesAsync * - * Indices Historical Constituents + * Major Press Releases * - * @param string $symbol symbol (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From time: 2020-01-01. (optional) + * @param \DateTime $to To time: 2020-01-05. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function indicesHistoricalConstituentsAsync($symbol) + public function pressReleasesAsync($symbol, $from = null, $to = null) { - return $this->indicesHistoricalConstituentsAsyncWithHttpInfo($symbol) + return $this->pressReleasesAsyncWithHttpInfo($symbol, $from, $to) ->then( function ($response) { return $response[0]; @@ -9435,29 +13278,30 @@ function ($response) { } /** - * Operation indicesHistoricalConstituentsAsyncWithHttpInfo + * Operation pressReleasesAsyncWithHttpInfo * - * Indices Historical Constituents + * Major Press Releases * - * @param string $symbol symbol (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From time: 2020-01-01. (optional) + * @param \DateTime $to To time: 2020-01-05. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function indicesHistoricalConstituentsAsyncWithHttpInfo($symbol) + public function pressReleasesAsyncWithHttpInfo($symbol, $from = null, $to = null) { - $returnType = '\Finnhub\Model\IndicesHistoricalConstituents'; - $request = $this->indicesHistoricalConstituentsRequest($symbol); + $returnType = '\Finnhub\Model\MajorPressReleases'; + $request = $this->pressReleasesRequest($symbol, $from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9477,30 +13321,32 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'indicesHistoricalConstituents' + * Create request for operation 'pressReleases' * - * @param string $symbol symbol (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From time: 2020-01-01. (optional) + * @param \DateTime $to To time: 2020-01-05. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function indicesHistoricalConstituentsRequest($symbol) + public function pressReleasesRequest($symbol, $from = null, $to = null) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling indicesHistoricalConstituents' + 'Missing the required parameter $symbol when calling pressReleases' ); } - $resourcePath = '/index/historical-constituents'; + $resourcePath = '/press-releases'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9514,11 +13360,23 @@ protected function indicesHistoricalConstituentsRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -9532,21 +13390,17 @@ protected function indicesHistoricalConstituentsRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -9587,38 +13441,36 @@ protected function indicesHistoricalConstituentsRequest($symbol) } /** - * Operation investorsOwnership + * Operation priceTarget * - * Investors Ownership + * Price Target * * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\InvestorsOwnership + * @return \Finnhub\Model\PriceTarget */ - public function investorsOwnership($symbol, $limit = null) + public function priceTarget($symbol) { - list($response) = $this->investorsOwnershipWithHttpInfo($symbol, $limit); + list($response) = $this->priceTargetWithHttpInfo($symbol); return $response; } /** - * Operation investorsOwnershipWithHttpInfo + * Operation priceTargetWithHttpInfo * - * Investors Ownership + * Price Target * * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\InvestorsOwnership, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\PriceTarget, HTTP status code, HTTP response headers (array of strings) */ - public function investorsOwnershipWithHttpInfo($symbol, $limit = null) + public function priceTargetWithHttpInfo($symbol) { - $request = $this->investorsOwnershipRequest($symbol, $limit); + $request = $this->priceTargetRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -9627,7 +13479,7 @@ public function investorsOwnershipWithHttpInfo($symbol, $limit = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -9640,36 +13492,34 @@ public function investorsOwnershipWithHttpInfo($symbol, $limit = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\InvestorsOwnership' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\PriceTarget' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\InvestorsOwnership', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\PriceTarget', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\InvestorsOwnership'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\PriceTarget'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9683,7 +13533,7 @@ public function investorsOwnershipWithHttpInfo($symbol, $limit = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\InvestorsOwnership', + '\Finnhub\Model\PriceTarget', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9694,19 +13544,18 @@ public function investorsOwnershipWithHttpInfo($symbol, $limit = null) } /** - * Operation investorsOwnershipAsync + * Operation priceTargetAsync * - * Investors Ownership + * Price Target * * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function investorsOwnershipAsync($symbol, $limit = null) + public function priceTargetAsync($symbol) { - return $this->investorsOwnershipAsyncWithHttpInfo($symbol, $limit) + return $this->priceTargetAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -9715,30 +13564,28 @@ function ($response) { } /** - * Operation investorsOwnershipAsyncWithHttpInfo + * Operation priceTargetAsyncWithHttpInfo * - * Investors Ownership + * Price Target * * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function investorsOwnershipAsyncWithHttpInfo($symbol, $limit = null) + public function priceTargetAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\InvestorsOwnership'; - $request = $this->investorsOwnershipRequest($symbol, $limit); + $returnType = '\Finnhub\Model\PriceTarget'; + $request = $this->priceTargetRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9758,31 +13605,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'investorsOwnership' + * Create request for operation 'priceTarget' * * @param string $symbol Symbol of the company: AAPL. (required) - * @param int $limit Limit number of results. Leave empty to get the full list. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function investorsOwnershipRequest($symbol, $limit = null) + public function priceTargetRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling investorsOwnership' + 'Missing the required parameter $symbol when calling priceTarget' ); } - $resourcePath = '/stock/investor-ownership'; + $resourcePath = '/stock/price-target'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9796,18 +13642,9 @@ protected function investorsOwnershipRequest($symbol, $limit = null) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } - if ($limit !== null) { - $queryParams['limit'] = $limit; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -9821,21 +13658,17 @@ protected function investorsOwnershipRequest($symbol, $limit = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -9876,38 +13709,36 @@ protected function investorsOwnershipRequest($symbol, $limit = null) } /** - * Operation ipoCalendar + * Operation quote * - * IPO Calendar + * Quote * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @param string $symbol Symbol (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\IPOCalendar + * @return \Finnhub\Model\Quote */ - public function ipoCalendar($from, $to) + public function quote($symbol) { - list($response) = $this->ipoCalendarWithHttpInfo($from, $to); + list($response) = $this->quoteWithHttpInfo($symbol); return $response; } /** - * Operation ipoCalendarWithHttpInfo + * Operation quoteWithHttpInfo * - * IPO Calendar + * Quote * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @param string $symbol Symbol (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\IPOCalendar, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Quote, HTTP status code, HTTP response headers (array of strings) */ - public function ipoCalendarWithHttpInfo($from, $to) + public function quoteWithHttpInfo($symbol) { - $request = $this->ipoCalendarRequest($from, $to); + $request = $this->quoteRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -9916,7 +13747,7 @@ public function ipoCalendarWithHttpInfo($from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -9929,36 +13760,34 @@ public function ipoCalendarWithHttpInfo($from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\IPOCalendar' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Quote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\IPOCalendar', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Quote', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\IPOCalendar'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Quote'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -9972,7 +13801,7 @@ public function ipoCalendarWithHttpInfo($from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\IPOCalendar', + '\Finnhub\Model\Quote', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9983,19 +13812,18 @@ public function ipoCalendarWithHttpInfo($from, $to) } /** - * Operation ipoCalendarAsync + * Operation quoteAsync * - * IPO Calendar + * Quote * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @param string $symbol Symbol (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function ipoCalendarAsync($from, $to) + public function quoteAsync($symbol) { - return $this->ipoCalendarAsyncWithHttpInfo($from, $to) + return $this->quoteAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -10004,30 +13832,28 @@ function ($response) { } /** - * Operation ipoCalendarAsyncWithHttpInfo + * Operation quoteAsyncWithHttpInfo * - * IPO Calendar + * Quote * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @param string $symbol Symbol (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function ipoCalendarAsyncWithHttpInfo($from, $to) + public function quoteAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\IPOCalendar'; - $request = $this->ipoCalendarRequest($from, $to); + $returnType = '\Finnhub\Model\Quote'; + $request = $this->quoteRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10047,37 +13873,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'ipoCalendar' + * Create request for operation 'quote' * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @param string $symbol Symbol (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function ipoCalendarRequest($from, $to) + public function quoteRequest($symbol) { - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling ipoCalendar' - ); - } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling ipoCalendar' + 'Missing the required parameter $symbol when calling quote' ); } - $resourcePath = '/calendar/ipo'; + $resourcePath = '/quote'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10085,24 +13904,15 @@ protected function ipoCalendarRequest($from, $to) $multipart = false; // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); - } - if ($from !== null) { - $queryParams['from'] = $from; - } - // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10116,21 +13926,17 @@ protected function ipoCalendarRequest($from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -10171,40 +13977,36 @@ protected function ipoCalendarRequest($from, $to) } /** - * Operation majorDevelopments + * Operation recommendationTrends * - * Major Developments + * Recommendation Trends * - * @param string $symbol Company symbol. (required) - * @param \DateTime $from From time: 2020-01-01. (optional) - * @param \DateTime $to To time: 2020-01-05. (optional) + * @param string $symbol Symbol of the company: AAPL. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\MajorDevelopments + * @return \Finnhub\Model\RecommendationTrend[] */ - public function majorDevelopments($symbol, $from = null, $to = null) + public function recommendationTrends($symbol) { - list($response) = $this->majorDevelopmentsWithHttpInfo($symbol, $from, $to); + list($response) = $this->recommendationTrendsWithHttpInfo($symbol); return $response; } /** - * Operation majorDevelopmentsWithHttpInfo + * Operation recommendationTrendsWithHttpInfo * - * Major Developments + * Recommendation Trends * - * @param string $symbol Company symbol. (required) - * @param \DateTime $from From time: 2020-01-01. (optional) - * @param \DateTime $to To time: 2020-01-05. (optional) + * @param string $symbol Symbol of the company: AAPL. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\MajorDevelopments, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\RecommendationTrend[], HTTP status code, HTTP response headers (array of strings) */ - public function majorDevelopmentsWithHttpInfo($symbol, $from = null, $to = null) + public function recommendationTrendsWithHttpInfo($symbol) { - $request = $this->majorDevelopmentsRequest($symbol, $from, $to); + $request = $this->recommendationTrendsRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -10213,7 +14015,7 @@ public function majorDevelopmentsWithHttpInfo($symbol, $from = null, $to = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -10226,36 +14028,34 @@ public function majorDevelopmentsWithHttpInfo($symbol, $from = null, $to = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\MajorDevelopments' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\RecommendationTrend[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\MajorDevelopments', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\RecommendationTrend[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\MajorDevelopments'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\RecommendationTrend[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10269,7 +14069,7 @@ public function majorDevelopmentsWithHttpInfo($symbol, $from = null, $to = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\MajorDevelopments', + '\Finnhub\Model\RecommendationTrend[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10280,20 +14080,18 @@ public function majorDevelopmentsWithHttpInfo($symbol, $from = null, $to = null) } /** - * Operation majorDevelopmentsAsync + * Operation recommendationTrendsAsync * - * Major Developments + * Recommendation Trends * - * @param string $symbol Company symbol. (required) - * @param \DateTime $from From time: 2020-01-01. (optional) - * @param \DateTime $to To time: 2020-01-05. (optional) + * @param string $symbol Symbol of the company: AAPL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function majorDevelopmentsAsync($symbol, $from = null, $to = null) + public function recommendationTrendsAsync($symbol) { - return $this->majorDevelopmentsAsyncWithHttpInfo($symbol, $from, $to) + return $this->recommendationTrendsAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -10302,31 +14100,28 @@ function ($response) { } /** - * Operation majorDevelopmentsAsyncWithHttpInfo + * Operation recommendationTrendsAsyncWithHttpInfo * - * Major Developments + * Recommendation Trends * - * @param string $symbol Company symbol. (required) - * @param \DateTime $from From time: 2020-01-01. (optional) - * @param \DateTime $to To time: 2020-01-05. (optional) + * @param string $symbol Symbol of the company: AAPL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function majorDevelopmentsAsyncWithHttpInfo($symbol, $from = null, $to = null) + public function recommendationTrendsAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\MajorDevelopments'; - $request = $this->majorDevelopmentsRequest($symbol, $from, $to); + $returnType = '\Finnhub\Model\RecommendationTrend[]'; + $request = $this->recommendationTrendsRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10346,32 +14141,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'majorDevelopments' + * Create request for operation 'recommendationTrends' * - * @param string $symbol Company symbol. (required) - * @param \DateTime $from From time: 2020-01-01. (optional) - * @param \DateTime $to To time: 2020-01-05. (optional) + * @param string $symbol Symbol of the company: AAPL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function majorDevelopmentsRequest($symbol, $from = null, $to = null) + public function recommendationTrendsRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling majorDevelopments' + 'Missing the required parameter $symbol when calling recommendationTrends' ); } - $resourcePath = '/major-development'; + $resourcePath = '/stock/recommendation'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10385,25 +14178,9 @@ protected function majorDevelopmentsRequest($symbol, $from = null, $to = null) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); - } - if ($from !== null) { - $queryParams['from'] = $from; - } - // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); - } - if ($to !== null) { - $queryParams['to'] = $to; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10417,21 +14194,17 @@ protected function majorDevelopmentsRequest($symbol, $from = null, $to = null) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -10472,36 +14245,38 @@ protected function majorDevelopmentsRequest($symbol, $from = null, $to = null) } /** - * Operation newsSentiment + * Operation revenueBreakdown * - * News Sentiment + * Revenue Breakdown * - * @param string $symbol Company symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\NewsSentiment + * @return \Finnhub\Model\RevenueBreakdown */ - public function newsSentiment($symbol) + public function revenueBreakdown($symbol = null, $cik = null) { - list($response) = $this->newsSentimentWithHttpInfo($symbol); + list($response) = $this->revenueBreakdownWithHttpInfo($symbol, $cik); return $response; } /** - * Operation newsSentimentWithHttpInfo + * Operation revenueBreakdownWithHttpInfo * - * News Sentiment + * Revenue Breakdown * - * @param string $symbol Company symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\NewsSentiment, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\RevenueBreakdown, HTTP status code, HTTP response headers (array of strings) */ - public function newsSentimentWithHttpInfo($symbol) + public function revenueBreakdownWithHttpInfo($symbol = null, $cik = null) { - $request = $this->newsSentimentRequest($symbol); + $request = $this->revenueBreakdownRequest($symbol, $cik); try { $options = $this->createHttpClientOption(); @@ -10510,7 +14285,7 @@ public function newsSentimentWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -10523,36 +14298,34 @@ public function newsSentimentWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\NewsSentiment' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\RevenueBreakdown' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\NewsSentiment', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\RevenueBreakdown', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\NewsSentiment'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\RevenueBreakdown'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10566,7 +14339,7 @@ public function newsSentimentWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\NewsSentiment', + '\Finnhub\Model\RevenueBreakdown', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10577,18 +14350,19 @@ public function newsSentimentWithHttpInfo($symbol) } /** - * Operation newsSentimentAsync + * Operation revenueBreakdownAsync * - * News Sentiment + * Revenue Breakdown * - * @param string $symbol Company symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function newsSentimentAsync($symbol) + public function revenueBreakdownAsync($symbol = null, $cik = null) { - return $this->newsSentimentAsyncWithHttpInfo($symbol) + return $this->revenueBreakdownAsyncWithHttpInfo($symbol, $cik) ->then( function ($response) { return $response[0]; @@ -10597,29 +14371,29 @@ function ($response) { } /** - * Operation newsSentimentAsyncWithHttpInfo + * Operation revenueBreakdownAsyncWithHttpInfo * - * News Sentiment + * Revenue Breakdown * - * @param string $symbol Company symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function newsSentimentAsyncWithHttpInfo($symbol) + public function revenueBreakdownAsyncWithHttpInfo($symbol = null, $cik = null) { - $returnType = '\Finnhub\Model\NewsSentiment'; - $request = $this->newsSentimentRequest($symbol); + $returnType = '\Finnhub\Model\RevenueBreakdown'; + $request = $this->revenueBreakdownRequest($symbol, $cik); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10639,30 +14413,25 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'newsSentiment' + * Create request for operation 'revenueBreakdown' * - * @param string $symbol Company symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $cik CIK. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function newsSentimentRequest($symbol) + public function revenueBreakdownRequest($symbol = null, $cik = null) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling newsSentiment' - ); - } - $resourcePath = '/news-sentiment'; + $resourcePath = '/stock/revenue-breakdown'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10676,11 +14445,16 @@ protected function newsSentimentRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($cik)) { + $cik = ObjectSerializer::serializeCollection($cik, '', true); + } + if ($cik !== null) { + $queryParams['cik'] = $cik; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10694,21 +14468,17 @@ protected function newsSentimentRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -10749,38 +14519,40 @@ protected function newsSentimentRequest($symbol) } /** - * Operation patternRecognition + * Operation similarityIndex * - * Pattern Recognition + * Similarity Index * - * @param string $symbol Symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param string $symbol Symbol. Required if cik is empty (optional) + * @param string $cik CIK. Required if symbol is empty (optional) + * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\PatternRecognition + * @return \Finnhub\Model\SimilarityIndex */ - public function patternRecognition($symbol, $resolution) + public function similarityIndex($symbol = null, $cik = null, $freq = null) { - list($response) = $this->patternRecognitionWithHttpInfo($symbol, $resolution); + list($response) = $this->similarityIndexWithHttpInfo($symbol, $cik, $freq); return $response; } /** - * Operation patternRecognitionWithHttpInfo + * Operation similarityIndexWithHttpInfo * - * Pattern Recognition + * Similarity Index * - * @param string $symbol Symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param string $symbol Symbol. Required if cik is empty (optional) + * @param string $cik CIK. Required if symbol is empty (optional) + * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\PatternRecognition, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\SimilarityIndex, HTTP status code, HTTP response headers (array of strings) */ - public function patternRecognitionWithHttpInfo($symbol, $resolution) + public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = null) { - $request = $this->patternRecognitionRequest($symbol, $resolution); + $request = $this->similarityIndexRequest($symbol, $cik, $freq); try { $options = $this->createHttpClientOption(); @@ -10789,7 +14561,7 @@ public function patternRecognitionWithHttpInfo($symbol, $resolution) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -10802,36 +14574,34 @@ public function patternRecognitionWithHttpInfo($symbol, $resolution) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\PatternRecognition' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\SimilarityIndex' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\PatternRecognition', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\SimilarityIndex', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\PatternRecognition'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\SimilarityIndex'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10845,7 +14615,7 @@ public function patternRecognitionWithHttpInfo($symbol, $resolution) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\PatternRecognition', + '\Finnhub\Model\SimilarityIndex', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10856,19 +14626,20 @@ public function patternRecognitionWithHttpInfo($symbol, $resolution) } /** - * Operation patternRecognitionAsync + * Operation similarityIndexAsync * - * Pattern Recognition + * Similarity Index * - * @param string $symbol Symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param string $symbol Symbol. Required if cik is empty (optional) + * @param string $cik CIK. Required if symbol is empty (optional) + * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patternRecognitionAsync($symbol, $resolution) + public function similarityIndexAsync($symbol = null, $cik = null, $freq = null) { - return $this->patternRecognitionAsyncWithHttpInfo($symbol, $resolution) + return $this->similarityIndexAsyncWithHttpInfo($symbol, $cik, $freq) ->then( function ($response) { return $response[0]; @@ -10877,30 +14648,30 @@ function ($response) { } /** - * Operation patternRecognitionAsyncWithHttpInfo + * Operation similarityIndexAsyncWithHttpInfo * - * Pattern Recognition + * Similarity Index * - * @param string $symbol Symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param string $symbol Symbol. Required if cik is empty (optional) + * @param string $cik CIK. Required if symbol is empty (optional) + * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patternRecognitionAsyncWithHttpInfo($symbol, $resolution) + public function similarityIndexAsyncWithHttpInfo($symbol = null, $cik = null, $freq = null) { - $returnType = '\Finnhub\Model\PatternRecognition'; - $request = $this->patternRecognitionRequest($symbol, $resolution); + $returnType = '\Finnhub\Model\SimilarityIndex'; + $request = $this->similarityIndexRequest($symbol, $cik, $freq); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -10920,37 +14691,26 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'patternRecognition' + * Create request for operation 'similarityIndex' * - * @param string $symbol Symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param string $symbol Symbol. Required if cik is empty (optional) + * @param string $cik CIK. Required if symbol is empty (optional) + * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patternRecognitionRequest($symbol, $resolution) + public function similarityIndexRequest($symbol = null, $cik = null, $freq = null) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling patternRecognition' - ); - } - // verify the required parameter 'resolution' is set - if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $resolution when calling patternRecognition' - ); - } - $resourcePath = '/scan/pattern'; + $resourcePath = '/stock/similarity-index'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10965,17 +14725,22 @@ protected function patternRecognitionRequest($symbol, $resolution) $queryParams['symbol'] = $symbol; } // query params - if (is_array($resolution)) { - $resolution = ObjectSerializer::serializeCollection($resolution, '', true); + if (is_array($cik)) { + $cik = ObjectSerializer::serializeCollection($cik, '', true); } - if ($resolution !== null) { - $queryParams['resolution'] = $resolution; + if ($cik !== null) { + $queryParams['cik'] = $cik; + } + // query params + if (is_array($freq)) { + $freq = ObjectSerializer::serializeCollection($freq, '', true); + } + if ($freq !== null) { + $queryParams['freq'] = $freq; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10989,21 +14754,17 @@ protected function patternRecognitionRequest($symbol, $resolution) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -11044,36 +14805,40 @@ protected function patternRecognitionRequest($symbol, $resolution) } /** - * Operation priceTarget + * Operation socialSentiment * - * Price Target + * Social Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From date <code>YYYY-MM-DD</code>. (optional) + * @param \DateTime $to To date <code>YYYY-MM-DD</code>. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\PriceTarget + * @return \Finnhub\Model\SocialSentiment */ - public function priceTarget($symbol) + public function socialSentiment($symbol, $from = null, $to = null) { - list($response) = $this->priceTargetWithHttpInfo($symbol); + list($response) = $this->socialSentimentWithHttpInfo($symbol, $from, $to); return $response; } /** - * Operation priceTargetWithHttpInfo + * Operation socialSentimentWithHttpInfo * - * Price Target + * Social Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From date <code>YYYY-MM-DD</code>. (optional) + * @param \DateTime $to To date <code>YYYY-MM-DD</code>. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\PriceTarget, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\SocialSentiment, HTTP status code, HTTP response headers (array of strings) */ - public function priceTargetWithHttpInfo($symbol) + public function socialSentimentWithHttpInfo($symbol, $from = null, $to = null) { - $request = $this->priceTargetRequest($symbol); + $request = $this->socialSentimentRequest($symbol, $from, $to); try { $options = $this->createHttpClientOption(); @@ -11082,7 +14847,7 @@ public function priceTargetWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -11095,36 +14860,34 @@ public function priceTargetWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\PriceTarget' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\SocialSentiment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\PriceTarget', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\SocialSentiment', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\PriceTarget'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\SocialSentiment'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11138,7 +14901,7 @@ public function priceTargetWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\PriceTarget', + '\Finnhub\Model\SocialSentiment', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11149,18 +14912,20 @@ public function priceTargetWithHttpInfo($symbol) } /** - * Operation priceTargetAsync + * Operation socialSentimentAsync * - * Price Target + * Social Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From date <code>YYYY-MM-DD</code>. (optional) + * @param \DateTime $to To date <code>YYYY-MM-DD</code>. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function priceTargetAsync($symbol) + public function socialSentimentAsync($symbol, $from = null, $to = null) { - return $this->priceTargetAsyncWithHttpInfo($symbol) + return $this->socialSentimentAsyncWithHttpInfo($symbol, $from, $to) ->then( function ($response) { return $response[0]; @@ -11169,29 +14934,30 @@ function ($response) { } /** - * Operation priceTargetAsyncWithHttpInfo + * Operation socialSentimentAsyncWithHttpInfo * - * Price Target + * Social Sentiment * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From date <code>YYYY-MM-DD</code>. (optional) + * @param \DateTime $to To date <code>YYYY-MM-DD</code>. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function priceTargetAsyncWithHttpInfo($symbol) + public function socialSentimentAsyncWithHttpInfo($symbol, $from = null, $to = null) { - $returnType = '\Finnhub\Model\PriceTarget'; - $request = $this->priceTargetRequest($symbol); + $returnType = '\Finnhub\Model\SocialSentiment'; + $request = $this->socialSentimentRequest($symbol, $from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11211,30 +14977,32 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'priceTarget' + * Create request for operation 'socialSentiment' * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Company symbol. (required) + * @param \DateTime $from From date <code>YYYY-MM-DD</code>. (optional) + * @param \DateTime $to To date <code>YYYY-MM-DD</code>. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function priceTargetRequest($symbol) + public function socialSentimentRequest($symbol, $from = null, $to = null) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling priceTarget' + 'Missing the required parameter $symbol when calling socialSentiment' ); } - $resourcePath = '/stock/price-target'; + $resourcePath = '/stock/social-sentiment'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11248,11 +15016,23 @@ protected function priceTargetRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -11266,21 +15046,17 @@ protected function priceTargetRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -11321,36 +15097,36 @@ protected function priceTargetRequest($symbol) } /** - * Operation quote + * Operation stockBasicDividends * - * Quote + * Dividends 2 (Basic) * - * @param string $symbol Symbol (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Quote + * @return \Finnhub\Model\Dividends2Basic */ - public function quote($symbol) + public function stockBasicDividends($symbol) { - list($response) = $this->quoteWithHttpInfo($symbol); + list($response) = $this->stockBasicDividendsWithHttpInfo($symbol); return $response; } /** - * Operation quoteWithHttpInfo + * Operation stockBasicDividendsWithHttpInfo * - * Quote + * Dividends 2 (Basic) * - * @param string $symbol Symbol (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Quote, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Dividends2Basic, HTTP status code, HTTP response headers (array of strings) */ - public function quoteWithHttpInfo($symbol) + public function stockBasicDividendsWithHttpInfo($symbol) { - $request = $this->quoteRequest($symbol); + $request = $this->stockBasicDividendsRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -11359,7 +15135,7 @@ public function quoteWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -11372,36 +15148,34 @@ public function quoteWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Quote' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Dividends2Basic' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Quote', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Dividends2Basic', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Quote'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Dividends2Basic'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11415,7 +15189,7 @@ public function quoteWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Quote', + '\Finnhub\Model\Dividends2Basic', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11426,18 +15200,18 @@ public function quoteWithHttpInfo($symbol) } /** - * Operation quoteAsync + * Operation stockBasicDividendsAsync * - * Quote + * Dividends 2 (Basic) * - * @param string $symbol Symbol (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function quoteAsync($symbol) + public function stockBasicDividendsAsync($symbol) { - return $this->quoteAsyncWithHttpInfo($symbol) + return $this->stockBasicDividendsAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -11446,29 +15220,28 @@ function ($response) { } /** - * Operation quoteAsyncWithHttpInfo + * Operation stockBasicDividendsAsyncWithHttpInfo * - * Quote + * Dividends 2 (Basic) * - * @param string $symbol Symbol (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function quoteAsyncWithHttpInfo($symbol) + public function stockBasicDividendsAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\Quote'; - $request = $this->quoteRequest($symbol); + $returnType = '\Finnhub\Model\Dividends2Basic'; + $request = $this->stockBasicDividendsRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11488,30 +15261,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'quote' + * Create request for operation 'stockBasicDividends' * - * @param string $symbol Symbol (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function quoteRequest($symbol) + public function stockBasicDividendsRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling quote' + 'Missing the required parameter $symbol when calling stockBasicDividends' ); } - $resourcePath = '/quote'; + $resourcePath = '/stock/dividend2'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11528,8 +15301,6 @@ protected function quoteRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -11543,21 +15314,17 @@ protected function quoteRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -11598,36 +15365,36 @@ protected function quoteRequest($symbol) } /** - * Operation recommendationTrends + * Operation stockBidask * - * Recommendation Trends + * Last Bid-Ask * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\RecommendationTrend[] + * @return \Finnhub\Model\LastBidAsk */ - public function recommendationTrends($symbol) + public function stockBidask($symbol) { - list($response) = $this->recommendationTrendsWithHttpInfo($symbol); + list($response) = $this->stockBidaskWithHttpInfo($symbol); return $response; } /** - * Operation recommendationTrendsWithHttpInfo + * Operation stockBidaskWithHttpInfo * - * Recommendation Trends + * Last Bid-Ask * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Symbol. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\RecommendationTrend[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\LastBidAsk, HTTP status code, HTTP response headers (array of strings) */ - public function recommendationTrendsWithHttpInfo($symbol) + public function stockBidaskWithHttpInfo($symbol) { - $request = $this->recommendationTrendsRequest($symbol); + $request = $this->stockBidaskRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -11636,7 +15403,7 @@ public function recommendationTrendsWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -11649,36 +15416,34 @@ public function recommendationTrendsWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\RecommendationTrend[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\LastBidAsk' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\RecommendationTrend[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\LastBidAsk', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\RecommendationTrend[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\LastBidAsk'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11692,7 +15457,7 @@ public function recommendationTrendsWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\RecommendationTrend[]', + '\Finnhub\Model\LastBidAsk', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11703,18 +15468,18 @@ public function recommendationTrendsWithHttpInfo($symbol) } /** - * Operation recommendationTrendsAsync + * Operation stockBidaskAsync * - * Recommendation Trends + * Last Bid-Ask * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function recommendationTrendsAsync($symbol) + public function stockBidaskAsync($symbol) { - return $this->recommendationTrendsAsyncWithHttpInfo($symbol) + return $this->stockBidaskAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -11723,29 +15488,28 @@ function ($response) { } /** - * Operation recommendationTrendsAsyncWithHttpInfo + * Operation stockBidaskAsyncWithHttpInfo * - * Recommendation Trends + * Last Bid-Ask * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function recommendationTrendsAsyncWithHttpInfo($symbol) + public function stockBidaskAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\RecommendationTrend[]'; - $request = $this->recommendationTrendsRequest($symbol); + $returnType = '\Finnhub\Model\LastBidAsk'; + $request = $this->stockBidaskRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11765,30 +15529,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'recommendationTrends' + * Create request for operation 'stockBidask' * - * @param string $symbol Symbol of the company: AAPL. (required) + * @param string $symbol Symbol. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function recommendationTrendsRequest($symbol) + public function stockBidaskRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling recommendationTrends' + 'Missing the required parameter $symbol when calling stockBidask' ); } - $resourcePath = '/stock/recommendation'; + $resourcePath = '/stock/bidask'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11805,8 +15569,6 @@ protected function recommendationTrendsRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -11820,21 +15582,17 @@ protected function recommendationTrendsRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -11875,40 +15633,44 @@ protected function recommendationTrendsRequest($symbol) } /** - * Operation similarityIndex + * Operation stockCandles * - * Similarity Index + * Stock Candles * - * @param string $symbol Symbol. Required if cik is empty (optional) - * @param string $cik CIK. Required if symbol is empty (optional) - * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) + * @param string $symbol Symbol. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $adjusted DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\SimilarityIndex + * @return \Finnhub\Model\StockCandles */ - public function similarityIndex($symbol = null, $cik = null, $freq = null) + public function stockCandles($symbol, $resolution, $from, $to, $adjusted = null) { - list($response) = $this->similarityIndexWithHttpInfo($symbol, $cik, $freq); + list($response) = $this->stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adjusted); return $response; } /** - * Operation similarityIndexWithHttpInfo + * Operation stockCandlesWithHttpInfo * - * Similarity Index + * Stock Candles * - * @param string $symbol Symbol. Required if cik is empty (optional) - * @param string $cik CIK. Required if symbol is empty (optional) - * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) + * @param string $symbol Symbol. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $adjusted DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\SimilarityIndex, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\StockCandles, HTTP status code, HTTP response headers (array of strings) */ - public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = null) + public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adjusted = null) { - $request = $this->similarityIndexRequest($symbol, $cik, $freq); + $request = $this->stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted); try { $options = $this->createHttpClientOption(); @@ -11917,7 +15679,7 @@ public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -11930,36 +15692,34 @@ public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\SimilarityIndex' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\StockCandles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\SimilarityIndex', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\StockCandles', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\SimilarityIndex'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\StockCandles'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -11973,7 +15733,7 @@ public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\SimilarityIndex', + '\Finnhub\Model\StockCandles', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11984,20 +15744,22 @@ public function similarityIndexWithHttpInfo($symbol = null, $cik = null, $freq = } /** - * Operation similarityIndexAsync + * Operation stockCandlesAsync * - * Similarity Index + * Stock Candles * - * @param string $symbol Symbol. Required if cik is empty (optional) - * @param string $cik CIK. Required if symbol is empty (optional) - * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) + * @param string $symbol Symbol. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $adjusted DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function similarityIndexAsync($symbol = null, $cik = null, $freq = null) + public function stockCandlesAsync($symbol, $resolution, $from, $to, $adjusted = null) { - return $this->similarityIndexAsyncWithHttpInfo($symbol, $cik, $freq) + return $this->stockCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to, $adjusted) ->then( function ($response) { return $response[0]; @@ -12006,31 +15768,32 @@ function ($response) { } /** - * Operation similarityIndexAsyncWithHttpInfo + * Operation stockCandlesAsyncWithHttpInfo * - * Similarity Index + * Stock Candles * - * @param string $symbol Symbol. Required if cik is empty (optional) - * @param string $cik CIK. Required if symbol is empty (optional) - * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) + * @param string $symbol Symbol. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $adjusted DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function similarityIndexAsyncWithHttpInfo($symbol = null, $cik = null, $freq = null) + public function stockCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to, $adjusted = null) { - $returnType = '\Finnhub\Model\SimilarityIndex'; - $request = $this->similarityIndexRequest($symbol, $cik, $freq); + $returnType = '\Finnhub\Model\StockCandles'; + $request = $this->stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12050,26 +15813,52 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'similarityIndex' + * Create request for operation 'stockCandles' * - * @param string $symbol Symbol. Required if cik is empty (optional) - * @param string $cik CIK. Required if symbol is empty (optional) - * @param string $freq <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code> (optional) + * @param string $symbol Symbol. (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $adjusted DEPRECATED: this option has been deprecated. All Daily data will be adjusted for Splits and intraday data will remain unadjusted. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function similarityIndexRequest($symbol = null, $cik = null, $freq = null) + public function stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted = null) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling stockCandles' + ); + } + // verify the required parameter 'resolution' is set + if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $resolution when calling stockCandles' + ); + } + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling stockCandles' + ); + } + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to when calling stockCandles' + ); + } - $resourcePath = '/stock/similarity-index'; + $resourcePath = '/stock/candle'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12084,24 +15873,36 @@ protected function similarityIndexRequest($symbol = null, $cik = null, $freq = n $queryParams['symbol'] = $symbol; } // query params - if (is_array($cik)) { - $cik = ObjectSerializer::serializeCollection($cik, '', true); + if (is_array($resolution)) { + $resolution = ObjectSerializer::serializeCollection($resolution, '', true); } - if ($cik !== null) { - $queryParams['cik'] = $cik; + if ($resolution !== null) { + $queryParams['resolution'] = $resolution; } // query params - if (is_array($freq)) { - $freq = ObjectSerializer::serializeCollection($freq, '', true); + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); } - if ($freq !== null) { - $queryParams['freq'] = $freq; + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + // query params + if (is_array($adjusted)) { + $adjusted = ObjectSerializer::serializeCollection($adjusted, '', true); + } + if ($adjusted !== null) { + $queryParams['adjusted'] = $adjusted; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -12115,21 +15916,17 @@ protected function similarityIndexRequest($symbol = null, $cik = null, $freq = n } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -12170,36 +15967,40 @@ protected function similarityIndexRequest($symbol = null, $cik = null, $freq = n } /** - * Operation stockBidask + * Operation stockDividends * - * Last Bid-Ask + * Dividends * * @param string $symbol Symbol. (required) + * @param \DateTime $from YYYY-MM-DD. (required) + * @param \DateTime $to YYYY-MM-DD. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\LastBidAsk + * @return \Finnhub\Model\Dividends[] */ - public function stockBidask($symbol) + public function stockDividends($symbol, $from, $to) { - list($response) = $this->stockBidaskWithHttpInfo($symbol); + list($response) = $this->stockDividendsWithHttpInfo($symbol, $from, $to); return $response; } /** - * Operation stockBidaskWithHttpInfo + * Operation stockDividendsWithHttpInfo * - * Last Bid-Ask + * Dividends * * @param string $symbol Symbol. (required) + * @param \DateTime $from YYYY-MM-DD. (required) + * @param \DateTime $to YYYY-MM-DD. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\LastBidAsk, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Dividends[], HTTP status code, HTTP response headers (array of strings) */ - public function stockBidaskWithHttpInfo($symbol) + public function stockDividendsWithHttpInfo($symbol, $from, $to) { - $request = $this->stockBidaskRequest($symbol); + $request = $this->stockDividendsRequest($symbol, $from, $to); try { $options = $this->createHttpClientOption(); @@ -12208,7 +16009,7 @@ public function stockBidaskWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -12221,36 +16022,34 @@ public function stockBidaskWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\LastBidAsk' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Dividends[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\LastBidAsk', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Dividends[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\LastBidAsk'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Dividends[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12264,7 +16063,7 @@ public function stockBidaskWithHttpInfo($symbol) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\LastBidAsk', + '\Finnhub\Model\Dividends[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12275,18 +16074,20 @@ public function stockBidaskWithHttpInfo($symbol) } /** - * Operation stockBidaskAsync + * Operation stockDividendsAsync * - * Last Bid-Ask + * Dividends * * @param string $symbol Symbol. (required) + * @param \DateTime $from YYYY-MM-DD. (required) + * @param \DateTime $to YYYY-MM-DD. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockBidaskAsync($symbol) + public function stockDividendsAsync($symbol, $from, $to) { - return $this->stockBidaskAsyncWithHttpInfo($symbol) + return $this->stockDividendsAsyncWithHttpInfo($symbol, $from, $to) ->then( function ($response) { return $response[0]; @@ -12295,29 +16096,30 @@ function ($response) { } /** - * Operation stockBidaskAsyncWithHttpInfo + * Operation stockDividendsAsyncWithHttpInfo * - * Last Bid-Ask + * Dividends * * @param string $symbol Symbol. (required) + * @param \DateTime $from YYYY-MM-DD. (required) + * @param \DateTime $to YYYY-MM-DD. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockBidaskAsyncWithHttpInfo($symbol) + public function stockDividendsAsyncWithHttpInfo($symbol, $from, $to) { - $returnType = '\Finnhub\Model\LastBidAsk'; - $request = $this->stockBidaskRequest($symbol); + $returnType = '\Finnhub\Model\Dividends[]'; + $request = $this->stockDividendsRequest($symbol, $from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12337,30 +16139,44 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockBidask' + * Create request for operation 'stockDividends' * * @param string $symbol Symbol. (required) + * @param \DateTime $from YYYY-MM-DD. (required) + * @param \DateTime $to YYYY-MM-DD. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockBidaskRequest($symbol) + public function stockDividendsRequest($symbol, $from, $to) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling stockBidask' + 'Missing the required parameter $symbol when calling stockDividends' + ); + } + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling stockDividends' + ); + } + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to when calling stockDividends' ); } - $resourcePath = '/stock/bidask'; + $resourcePath = '/stock/dividend'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12374,11 +16190,23 @@ protected function stockBidaskRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -12391,22 +16219,18 @@ protected function stockBidaskRequest($symbol) ); } - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + // for model (json/xml) + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -12447,44 +16271,42 @@ protected function stockBidaskRequest($symbol) } /** - * Operation stockCandles + * Operation stockNbbo * - * Stock Candles + * Historical NBBO * * @param string $symbol Symbol. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. (optional) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\StockCandles + * @return \Finnhub\Model\HistoricalNBBO */ - public function stockCandles($symbol, $resolution, $from, $to, $adjusted = null) + public function stockNbbo($symbol, $date, $limit, $skip) { - list($response) = $this->stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adjusted); + list($response) = $this->stockNbboWithHttpInfo($symbol, $date, $limit, $skip); return $response; } /** - * Operation stockCandlesWithHttpInfo + * Operation stockNbboWithHttpInfo * - * Stock Candles + * Historical NBBO * * @param string $symbol Symbol. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. (optional) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\StockCandles, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\HistoricalNBBO, HTTP status code, HTTP response headers (array of strings) */ - public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adjusted = null) + public function stockNbboWithHttpInfo($symbol, $date, $limit, $skip) { - $request = $this->stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted); + $request = $this->stockNbboRequest($symbol, $date, $limit, $skip); try { $options = $this->createHttpClientOption(); @@ -12493,7 +16315,7 @@ public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adju } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -12506,36 +16328,34 @@ public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adju sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\StockCandles' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\HistoricalNBBO' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\StockCandles', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\HistoricalNBBO', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\StockCandles'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\HistoricalNBBO'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12549,7 +16369,7 @@ public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adju case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\StockCandles', + '\Finnhub\Model\HistoricalNBBO', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12560,22 +16380,21 @@ public function stockCandlesWithHttpInfo($symbol, $resolution, $from, $to, $adju } /** - * Operation stockCandlesAsync + * Operation stockNbboAsync * - * Stock Candles + * Historical NBBO * * @param string $symbol Symbol. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. (optional) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockCandlesAsync($symbol, $resolution, $from, $to, $adjusted = null) + public function stockNbboAsync($symbol, $date, $limit, $skip) { - return $this->stockCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to, $adjusted) + return $this->stockNbboAsyncWithHttpInfo($symbol, $date, $limit, $skip) ->then( function ($response) { return $response[0]; @@ -12584,33 +16403,31 @@ function ($response) { } /** - * Operation stockCandlesAsyncWithHttpInfo + * Operation stockNbboAsyncWithHttpInfo * - * Stock Candles + * Historical NBBO * * @param string $symbol Symbol. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. (optional) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockCandlesAsyncWithHttpInfo($symbol, $resolution, $from, $to, $adjusted = null) + public function stockNbboAsyncWithHttpInfo($symbol, $date, $limit, $skip) { - $returnType = '\Finnhub\Model\StockCandles'; - $request = $this->stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted); + $returnType = '\Finnhub\Model\HistoricalNBBO'; + $request = $this->stockNbboRequest($symbol, $date, $limit, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12630,52 +16447,51 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockCandles' + * Create request for operation 'stockNbbo' * * @param string $symbol Symbol. (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data. (optional) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockCandlesRequest($symbol, $resolution, $from, $to, $adjusted = null) + public function stockNbboRequest($symbol, $date, $limit, $skip) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling stockCandles' + 'Missing the required parameter $symbol when calling stockNbbo' ); } - // verify the required parameter 'resolution' is set - if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $resolution when calling stockCandles' + 'Missing the required parameter $date when calling stockNbbo' ); } - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { + // verify the required parameter 'limit' is set + if ($limit === null || (is_array($limit) && count($limit) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling stockCandles' + 'Missing the required parameter $limit when calling stockNbbo' ); } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // verify the required parameter 'skip' is set + if ($skip === null || (is_array($skip) && count($skip) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling stockCandles' + 'Missing the required parameter $skip when calling stockNbbo' ); } - $resourcePath = '/stock/candle'; + $resourcePath = '/stock/bbo'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12690,38 +16506,29 @@ protected function stockCandlesRequest($symbol, $resolution, $from, $to, $adjust $queryParams['symbol'] = $symbol; } // query params - if (is_array($resolution)) { - $resolution = ObjectSerializer::serializeCollection($resolution, '', true); - } - if ($resolution !== null) { - $queryParams['resolution'] = $resolution; - } - // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); + if (is_array($date)) { + $date = ObjectSerializer::serializeCollection($date, '', true); } - if ($from !== null) { - $queryParams['from'] = $from; + if ($date !== null) { + $queryParams['date'] = $date; } // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($limit !== null) { + $queryParams['limit'] = $limit; } // query params - if (is_array($adjusted)) { - $adjusted = ObjectSerializer::serializeCollection($adjusted, '', true); + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); } - if ($adjusted !== null) { - $queryParams['adjusted'] = $adjusted; + if ($skip !== null) { + $queryParams['skip'] = $skip; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -12735,21 +16542,17 @@ protected function stockCandlesRequest($symbol, $resolution, $from, $to, $adjust } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -12790,9 +16593,9 @@ protected function stockCandlesRequest($symbol, $resolution, $from, $to, $adjust } /** - * Operation stockDividends + * Operation stockSplits * - * Dividends + * Splits * * @param string $symbol Symbol. (required) * @param \DateTime $from YYYY-MM-DD. (required) @@ -12800,18 +16603,18 @@ protected function stockCandlesRequest($symbol, $resolution, $from, $to, $adjust * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Dividends[] + * @return \Finnhub\Model\Split[] */ - public function stockDividends($symbol, $from, $to) + public function stockSplits($symbol, $from, $to) { - list($response) = $this->stockDividendsWithHttpInfo($symbol, $from, $to); + list($response) = $this->stockSplitsWithHttpInfo($symbol, $from, $to); return $response; } /** - * Operation stockDividendsWithHttpInfo + * Operation stockSplitsWithHttpInfo * - * Dividends + * Splits * * @param string $symbol Symbol. (required) * @param \DateTime $from YYYY-MM-DD. (required) @@ -12819,11 +16622,11 @@ public function stockDividends($symbol, $from, $to) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Dividends[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Split[], HTTP status code, HTTP response headers (array of strings) */ - public function stockDividendsWithHttpInfo($symbol, $from, $to) + public function stockSplitsWithHttpInfo($symbol, $from, $to) { - $request = $this->stockDividendsRequest($symbol, $from, $to); + $request = $this->stockSplitsRequest($symbol, $from, $to); try { $options = $this->createHttpClientOption(); @@ -12832,7 +16635,7 @@ public function stockDividendsWithHttpInfo($symbol, $from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -12845,36 +16648,34 @@ public function stockDividendsWithHttpInfo($symbol, $from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Dividends[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Split[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Dividends[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Split[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Dividends[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Split[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12888,7 +16689,7 @@ public function stockDividendsWithHttpInfo($symbol, $from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Dividends[]', + '\Finnhub\Model\Split[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12899,9 +16700,9 @@ public function stockDividendsWithHttpInfo($symbol, $from, $to) } /** - * Operation stockDividendsAsync + * Operation stockSplitsAsync * - * Dividends + * Splits * * @param string $symbol Symbol. (required) * @param \DateTime $from YYYY-MM-DD. (required) @@ -12910,9 +16711,9 @@ public function stockDividendsWithHttpInfo($symbol, $from, $to) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockDividendsAsync($symbol, $from, $to) + public function stockSplitsAsync($symbol, $from, $to) { - return $this->stockDividendsAsyncWithHttpInfo($symbol, $from, $to) + return $this->stockSplitsAsyncWithHttpInfo($symbol, $from, $to) ->then( function ($response) { return $response[0]; @@ -12921,9 +16722,9 @@ function ($response) { } /** - * Operation stockDividendsAsyncWithHttpInfo + * Operation stockSplitsAsyncWithHttpInfo * - * Dividends + * Splits * * @param string $symbol Symbol. (required) * @param \DateTime $from YYYY-MM-DD. (required) @@ -12932,20 +16733,19 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockDividendsAsyncWithHttpInfo($symbol, $from, $to) + public function stockSplitsAsyncWithHttpInfo($symbol, $from, $to) { - $returnType = '\Finnhub\Model\Dividends[]'; - $request = $this->stockDividendsRequest($symbol, $from, $to); + $returnType = '\Finnhub\Model\Split[]'; + $request = $this->stockSplitsRequest($symbol, $from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -12965,14 +16765,14 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockDividends' + * Create request for operation 'stockSplits' * * @param string $symbol Symbol. (required) * @param \DateTime $from YYYY-MM-DD. (required) @@ -12981,28 +16781,28 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockDividendsRequest($symbol, $from, $to) + public function stockSplitsRequest($symbol, $from, $to) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling stockDividends' + 'Missing the required parameter $symbol when calling stockSplits' ); } // verify the required parameter 'from' is set if ($from === null || (is_array($from) && count($from) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling stockDividends' + 'Missing the required parameter $from when calling stockSplits' ); } // verify the required parameter 'to' is set if ($to === null || (is_array($to) && count($to) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling stockDividends' + 'Missing the required parameter $to when calling stockSplits' ); } - $resourcePath = '/stock/dividend'; + $resourcePath = '/stock/split'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13033,8 +16833,6 @@ protected function stockDividendsRequest($symbol, $from, $to) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -13048,21 +16846,17 @@ protected function stockDividendsRequest($symbol, $from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -13103,40 +16897,42 @@ protected function stockDividendsRequest($symbol, $from, $to) } /** - * Operation stockSplits + * Operation stockSymbols * - * Splits + * Stock Symbol * - * @param string $symbol Symbol. (required) - * @param \DateTime $from YYYY-MM-DD. (required) - * @param \DateTime $to YYYY-MM-DD. (required) + * @param string $exchange Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $mic Filter by MIC code. (optional) + * @param string $security_type Filter by security type used by OpenFigi standard. (optional) + * @param string $currency Filter by currency. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Split[] + * @return \Finnhub\Model\Stock[] */ - public function stockSplits($symbol, $from, $to) + public function stockSymbols($exchange, $mic = null, $security_type = null, $currency = null) { - list($response) = $this->stockSplitsWithHttpInfo($symbol, $from, $to); + list($response) = $this->stockSymbolsWithHttpInfo($exchange, $mic, $security_type, $currency); return $response; } /** - * Operation stockSplitsWithHttpInfo + * Operation stockSymbolsWithHttpInfo * - * Splits + * Stock Symbol * - * @param string $symbol Symbol. (required) - * @param \DateTime $from YYYY-MM-DD. (required) - * @param \DateTime $to YYYY-MM-DD. (required) + * @param string $exchange Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $mic Filter by MIC code. (optional) + * @param string $security_type Filter by security type used by OpenFigi standard. (optional) + * @param string $currency Filter by currency. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Split[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\Stock[], HTTP status code, HTTP response headers (array of strings) */ - public function stockSplitsWithHttpInfo($symbol, $from, $to) + public function stockSymbolsWithHttpInfo($exchange, $mic = null, $security_type = null, $currency = null) { - $request = $this->stockSplitsRequest($symbol, $from, $to); + $request = $this->stockSymbolsRequest($exchange, $mic, $security_type, $currency); try { $options = $this->createHttpClientOption(); @@ -13145,7 +16941,7 @@ public function stockSplitsWithHttpInfo($symbol, $from, $to) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -13158,36 +16954,34 @@ public function stockSplitsWithHttpInfo($symbol, $from, $to) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Split[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\Stock[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Split[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\Stock[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Split[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\Stock[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13201,7 +16995,7 @@ public function stockSplitsWithHttpInfo($symbol, $from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Split[]', + '\Finnhub\Model\Stock[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13212,20 +17006,21 @@ public function stockSplitsWithHttpInfo($symbol, $from, $to) } /** - * Operation stockSplitsAsync + * Operation stockSymbolsAsync * - * Splits + * Stock Symbol * - * @param string $symbol Symbol. (required) - * @param \DateTime $from YYYY-MM-DD. (required) - * @param \DateTime $to YYYY-MM-DD. (required) + * @param string $exchange Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $mic Filter by MIC code. (optional) + * @param string $security_type Filter by security type used by OpenFigi standard. (optional) + * @param string $currency Filter by currency. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockSplitsAsync($symbol, $from, $to) + public function stockSymbolsAsync($exchange, $mic = null, $security_type = null, $currency = null) { - return $this->stockSplitsAsyncWithHttpInfo($symbol, $from, $to) + return $this->stockSymbolsAsyncWithHttpInfo($exchange, $mic, $security_type, $currency) ->then( function ($response) { return $response[0]; @@ -13234,31 +17029,31 @@ function ($response) { } /** - * Operation stockSplitsAsyncWithHttpInfo + * Operation stockSymbolsAsyncWithHttpInfo * - * Splits + * Stock Symbol * - * @param string $symbol Symbol. (required) - * @param \DateTime $from YYYY-MM-DD. (required) - * @param \DateTime $to YYYY-MM-DD. (required) + * @param string $exchange Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $mic Filter by MIC code. (optional) + * @param string $security_type Filter by security type used by OpenFigi standard. (optional) + * @param string $currency Filter by currency. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockSplitsAsyncWithHttpInfo($symbol, $from, $to) + public function stockSymbolsAsyncWithHttpInfo($exchange, $mic = null, $security_type = null, $currency = null) { - $returnType = '\Finnhub\Model\Split[]'; - $request = $this->stockSplitsRequest($symbol, $from, $to); + $returnType = '\Finnhub\Model\Stock[]'; + $request = $this->stockSymbolsRequest($exchange, $mic, $security_type, $currency); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13278,44 +17073,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockSplits' + * Create request for operation 'stockSymbols' * - * @param string $symbol Symbol. (required) - * @param \DateTime $from YYYY-MM-DD. (required) - * @param \DateTime $to YYYY-MM-DD. (required) + * @param string $exchange Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $mic Filter by MIC code. (optional) + * @param string $security_type Filter by security type used by OpenFigi standard. (optional) + * @param string $currency Filter by currency. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockSplitsRequest($symbol, $from, $to) + public function stockSymbolsRequest($exchange, $mic = null, $security_type = null, $currency = null) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling stockSplits' - ); - } - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling stockSplits' - ); - } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // verify the required parameter 'exchange' is set + if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling stockSplits' + 'Missing the required parameter $exchange when calling stockSymbols' ); } - $resourcePath = '/stock/split'; + $resourcePath = '/stock/symbol'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13323,31 +17107,36 @@ protected function stockSplitsRequest($symbol, $from, $to) $multipart = false; // query params - if (is_array($symbol)) { - $symbol = ObjectSerializer::serializeCollection($symbol, '', true); + if (is_array($exchange)) { + $exchange = ObjectSerializer::serializeCollection($exchange, '', true); + } + if ($exchange !== null) { + $queryParams['exchange'] = $exchange; + } + // query params + if (is_array($mic)) { + $mic = ObjectSerializer::serializeCollection($mic, '', true); } - if ($symbol !== null) { - $queryParams['symbol'] = $symbol; + if ($mic !== null) { + $queryParams['mic'] = $mic; } // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); + if (is_array($security_type)) { + $security_type = ObjectSerializer::serializeCollection($security_type, '', true); } - if ($from !== null) { - $queryParams['from'] = $from; + if ($security_type !== null) { + $queryParams['securityType'] = $security_type; } // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); + if (is_array($currency)) { + $currency = ObjectSerializer::serializeCollection($currency, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($currency !== null) { + $queryParams['currency'] = $currency; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -13361,21 +17150,17 @@ protected function stockSplitsRequest($symbol, $from, $to) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -13416,36 +17201,42 @@ protected function stockSplitsRequest($symbol, $from, $to) } /** - * Operation stockSymbols + * Operation stockTick * - * Stock Symbol + * Tick Data * - * @param string $exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $symbol Symbol. (required) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\Stock[] + * @return \Finnhub\Model\TickData */ - public function stockSymbols($exchange) + public function stockTick($symbol, $date, $limit, $skip) { - list($response) = $this->stockSymbolsWithHttpInfo($exchange); + list($response) = $this->stockTickWithHttpInfo($symbol, $date, $limit, $skip); return $response; } /** - * Operation stockSymbolsWithHttpInfo + * Operation stockTickWithHttpInfo * - * Stock Symbol + * Tick Data * - * @param string $exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $symbol Symbol. (required) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\Stock[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\TickData, HTTP status code, HTTP response headers (array of strings) */ - public function stockSymbolsWithHttpInfo($exchange) + public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) { - $request = $this->stockSymbolsRequest($exchange); + $request = $this->stockTickRequest($symbol, $date, $limit, $skip); try { $options = $this->createHttpClientOption(); @@ -13454,7 +17245,7 @@ public function stockSymbolsWithHttpInfo($exchange) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -13467,36 +17258,34 @@ public function stockSymbolsWithHttpInfo($exchange) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\Stock[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\TickData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\Stock[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\TickData', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\Stock[]'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\TickData'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13510,7 +17299,7 @@ public function stockSymbolsWithHttpInfo($exchange) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\Stock[]', + '\Finnhub\Model\TickData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13521,18 +17310,21 @@ public function stockSymbolsWithHttpInfo($exchange) } /** - * Operation stockSymbolsAsync + * Operation stockTickAsync * - * Stock Symbol + * Tick Data * - * @param string $exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $symbol Symbol. (required) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockSymbolsAsync($exchange) + public function stockTickAsync($symbol, $date, $limit, $skip) { - return $this->stockSymbolsAsyncWithHttpInfo($exchange) + return $this->stockTickAsyncWithHttpInfo($symbol, $date, $limit, $skip) ->then( function ($response) { return $response[0]; @@ -13541,29 +17333,31 @@ function ($response) { } /** - * Operation stockSymbolsAsyncWithHttpInfo + * Operation stockTickAsyncWithHttpInfo * - * Stock Symbol + * Tick Data * - * @param string $exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $symbol Symbol. (required) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockSymbolsAsyncWithHttpInfo($exchange) + public function stockTickAsyncWithHttpInfo($symbol, $date, $limit, $skip) { - $returnType = '\Finnhub\Model\Stock[]'; - $request = $this->stockSymbolsRequest($exchange); + $returnType = '\Finnhub\Model\TickData'; + $request = $this->stockTickRequest($symbol, $date, $limit, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13583,30 +17377,51 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockSymbols' + * Create request for operation 'stockTick' * - * @param string $exchange Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param string $symbol Symbol. (required) + * @param \DateTime $date Date: 2020-04-02. (required) + * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) + * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockSymbolsRequest($exchange) + public function stockTickRequest($symbol, $date, $limit, $skip) { - // verify the required parameter 'exchange' is set - if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $exchange when calling stockSymbols' + 'Missing the required parameter $symbol when calling stockTick' + ); + } + // verify the required parameter 'date' is set + if ($date === null || (is_array($date) && count($date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $date when calling stockTick' + ); + } + // verify the required parameter 'limit' is set + if ($limit === null || (is_array($limit) && count($limit) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $limit when calling stockTick' + ); + } + // verify the required parameter 'skip' is set + if ($skip === null || (is_array($skip) && count($skip) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $skip when calling stockTick' ); } - $resourcePath = '/stock/symbol'; + $resourcePath = '/stock/tick'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13614,17 +17429,36 @@ protected function stockSymbolsRequest($exchange) $multipart = false; // query params - if (is_array($exchange)) { - $exchange = ObjectSerializer::serializeCollection($exchange, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($exchange !== null) { - $queryParams['exchange'] = $exchange; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($date)) { + $date = ObjectSerializer::serializeCollection($date, '', true); + } + if ($date !== null) { + $queryParams['date'] = $date; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -13638,21 +17472,17 @@ protected function stockSymbolsRequest($exchange) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -13693,42 +17523,36 @@ protected function stockSymbolsRequest($exchange) } /** - * Operation stockTick + * Operation supplyChainRelationships * - * Tick Data + * Supply Chain Relationships * * @param string $symbol Symbol. (required) - * @param \DateTime $date Date: 2020-04-02. (required) - * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) - * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\TickData + * @return \Finnhub\Model\SupplyChainRelationships */ - public function stockTick($symbol, $date, $limit, $skip) + public function supplyChainRelationships($symbol) { - list($response) = $this->stockTickWithHttpInfo($symbol, $date, $limit, $skip); + list($response) = $this->supplyChainRelationshipsWithHttpInfo($symbol); return $response; } /** - * Operation stockTickWithHttpInfo + * Operation supplyChainRelationshipsWithHttpInfo * - * Tick Data + * Supply Chain Relationships * * @param string $symbol Symbol. (required) - * @param \DateTime $date Date: 2020-04-02. (required) - * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) - * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\TickData, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\SupplyChainRelationships, HTTP status code, HTTP response headers (array of strings) */ - public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) + public function supplyChainRelationshipsWithHttpInfo($symbol) { - $request = $this->stockTickRequest($symbol, $date, $limit, $skip); + $request = $this->supplyChainRelationshipsRequest($symbol); try { $options = $this->createHttpClientOption(); @@ -13737,7 +17561,7 @@ public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -13750,36 +17574,34 @@ public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\TickData' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\SupplyChainRelationships' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\TickData', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\SupplyChainRelationships', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\TickData'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\SupplyChainRelationships'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13793,7 +17615,7 @@ public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\TickData', + '\Finnhub\Model\SupplyChainRelationships', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13804,21 +17626,18 @@ public function stockTickWithHttpInfo($symbol, $date, $limit, $skip) } /** - * Operation stockTickAsync + * Operation supplyChainRelationshipsAsync * - * Tick Data + * Supply Chain Relationships * * @param string $symbol Symbol. (required) - * @param \DateTime $date Date: 2020-04-02. (required) - * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) - * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockTickAsync($symbol, $date, $limit, $skip) + public function supplyChainRelationshipsAsync($symbol) { - return $this->stockTickAsyncWithHttpInfo($symbol, $date, $limit, $skip) + return $this->supplyChainRelationshipsAsyncWithHttpInfo($symbol) ->then( function ($response) { return $response[0]; @@ -13827,32 +17646,28 @@ function ($response) { } /** - * Operation stockTickAsyncWithHttpInfo + * Operation supplyChainRelationshipsAsyncWithHttpInfo * - * Tick Data + * Supply Chain Relationships * * @param string $symbol Symbol. (required) - * @param \DateTime $date Date: 2020-04-02. (required) - * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) - * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function stockTickAsyncWithHttpInfo($symbol, $date, $limit, $skip) + public function supplyChainRelationshipsAsyncWithHttpInfo($symbol) { - $returnType = '\Finnhub\Model\TickData'; - $request = $this->stockTickRequest($symbol, $date, $limit, $skip); + $returnType = '\Finnhub\Model\SupplyChainRelationships'; + $request = $this->supplyChainRelationshipsRequest($symbol); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -13872,51 +17687,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'stockTick' + * Create request for operation 'supplyChainRelationships' * * @param string $symbol Symbol. (required) - * @param \DateTime $date Date: 2020-04-02. (required) - * @param int $limit Limit number of ticks returned. Maximum value: <code>25000</code> (required) - * @param int $skip Number of ticks to skip. Use this parameter to loop through the entire data. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function stockTickRequest($symbol, $date, $limit, $skip) + public function supplyChainRelationshipsRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling stockTick' - ); - } - // verify the required parameter 'date' is set - if ($date === null || (is_array($date) && count($date) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $date when calling stockTick' - ); - } - // verify the required parameter 'limit' is set - if ($limit === null || (is_array($limit) && count($limit) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $limit when calling stockTick' - ); - } - // verify the required parameter 'skip' is set - if ($skip === null || (is_array($skip) && count($skip) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $skip when calling stockTick' + 'Missing the required parameter $symbol when calling supplyChainRelationships' ); } - $resourcePath = '/stock/tick'; + $resourcePath = '/stock/supply-chain'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13930,32 +17724,9 @@ protected function stockTickRequest($symbol, $date, $limit, $skip) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } - // query params - if (is_array($date)) { - $date = ObjectSerializer::serializeCollection($date, '', true); - } - if ($date !== null) { - $queryParams['date'] = $date; - } - // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } - if ($limit !== null) { - $queryParams['limit'] = $limit; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -13969,21 +17740,17 @@ protected function stockTickRequest($symbol, $date, $limit, $skip) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -14064,7 +17831,7 @@ public function supportResistanceWithHttpInfo($symbol, $resolution) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -14077,21 +17844,20 @@ public function supportResistanceWithHttpInfo($symbol, $resolution) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\SupportResistance' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14102,11 +17868,10 @@ public function supportResistanceWithHttpInfo($symbol, $resolution) } $returnType = '\Finnhub\Model\SupportResistance'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14171,11 +17936,10 @@ public function supportResistanceAsyncWithHttpInfo($symbol, $resolution) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14195,7 +17959,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -14210,7 +17974,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function supportResistanceRequest($symbol, $resolution) + public function supportResistanceRequest($symbol, $resolution) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -14249,8 +18013,6 @@ protected function supportResistanceRequest($symbol, $resolution) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -14264,21 +18026,17 @@ protected function supportResistanceRequest($symbol, $resolution) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -14319,46 +18077,36 @@ protected function supportResistanceRequest($symbol, $resolution) } /** - * Operation technicalIndicator + * Operation symbolSearch * - * Technical Indicators + * Symbol Lookup * - * @param string $symbol symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) - * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) + * @param string $q Query text can be symbol, name, isin, or cusip. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Finnhub\Model\SymbolLookup */ - public function technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) + public function symbolSearch($q) { - list($response) = $this->technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields); + list($response) = $this->symbolSearchWithHttpInfo($q); return $response; } /** - * Operation technicalIndicatorWithHttpInfo + * Operation symbolSearchWithHttpInfo * - * Technical Indicators + * Symbol Lookup * - * @param string $symbol symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) - * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) + * @param string $q Query text can be symbol, name, isin, or cusip. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\SymbolLookup, HTTP status code, HTTP response headers (array of strings) */ - public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) + public function symbolSearchWithHttpInfo($q) { - $request = $this->technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields); + $request = $this->symbolSearchRequest($q); try { $options = $this->createHttpClientOption(); @@ -14367,7 +18115,7 @@ public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -14380,36 +18128,34 @@ public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\Finnhub\Model\SymbolLookup' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\SymbolLookup', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'object'; - $responseBody = $response->getBody(); + $returnType = '\Finnhub\Model\SymbolLookup'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14423,7 +18169,7 @@ public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Finnhub\Model\SymbolLookup', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14434,23 +18180,18 @@ public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, } /** - * Operation technicalIndicatorAsync + * Operation symbolSearchAsync * - * Technical Indicators + * Symbol Lookup * - * @param string $symbol symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) - * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) + * @param string $q Query text can be symbol, name, isin, or cusip. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function technicalIndicatorAsync($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) + public function symbolSearchAsync($q) { - return $this->technicalIndicatorAsyncWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields) + return $this->symbolSearchAsyncWithHttpInfo($q) ->then( function ($response) { return $response[0]; @@ -14459,34 +18200,28 @@ function ($response) { } /** - * Operation technicalIndicatorAsyncWithHttpInfo + * Operation symbolSearchAsyncWithHttpInfo * - * Technical Indicators + * Symbol Lookup * - * @param string $symbol symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) - * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) + * @param string $q Query text can be symbol, name, isin, or cusip. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function technicalIndicatorAsyncWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) + public function symbolSearchAsyncWithHttpInfo($q) { - $returnType = 'object'; - $request = $this->technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields); + $returnType = '\Finnhub\Model\SymbolLookup'; + $request = $this->symbolSearchRequest($q); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14506,59 +18241,30 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'technicalIndicator' + * Create request for operation 'symbolSearch' * - * @param string $symbol symbol (required) - * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) - * @param int $from UNIX timestamp. Interval initial value. (required) - * @param int $to UNIX timestamp. Interval end value. (required) - * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) - * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) + * @param string $q Query text can be symbol, name, isin, or cusip. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) + public function symbolSearchRequest($q) { - // verify the required parameter 'symbol' is set - if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $symbol when calling technicalIndicator' - ); - } - // verify the required parameter 'resolution' is set - if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $resolution when calling technicalIndicator' - ); - } - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling technicalIndicator' - ); - } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // verify the required parameter 'q' is set + if ($q === null || (is_array($q) && count($q) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling technicalIndicator' - ); - } - // verify the required parameter 'indicator' is set - if ($indicator === null || (is_array($indicator) && count($indicator) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $indicator when calling technicalIndicator' + 'Missing the required parameter $q when calling symbolSearch' ); } - $resourcePath = '/indicator'; + $resourcePath = '/search'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14566,48 +18272,15 @@ protected function technicalIndicatorRequest($symbol, $resolution, $from, $to, $ $multipart = false; // query params - if (is_array($symbol)) { - $symbol = ObjectSerializer::serializeCollection($symbol, '', true); - } - if ($symbol !== null) { - $queryParams['symbol'] = $symbol; - } - // query params - if (is_array($resolution)) { - $resolution = ObjectSerializer::serializeCollection($resolution, '', true); - } - if ($resolution !== null) { - $queryParams['resolution'] = $resolution; - } - // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); - } - if ($from !== null) { - $queryParams['from'] = $from; - } - // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); - } - if ($to !== null) { - $queryParams['to'] = $to; - } - // query params - if (is_array($indicator)) { - $indicator = ObjectSerializer::serializeCollection($indicator, '', true); + if (is_array($q)) { + $q = ObjectSerializer::serializeCollection($q, '', true); } - if ($indicator !== null) { - $queryParams['indicator'] = $indicator; + if ($q !== null) { + $queryParams['q'] = $q; } - // body params - $_tempBody = null; - if (isset($indicator_fields)) { - $_tempBody = $indicator_fields; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -14616,26 +18289,22 @@ protected function technicalIndicatorRequest($symbol, $resolution, $from, $to, $ } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -14668,7 +18337,7 @@ protected function technicalIndicatorRequest($symbol, $resolution, $from, $to, $ $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14676,36 +18345,46 @@ protected function technicalIndicatorRequest($symbol, $resolution, $from, $to, $ } /** - * Operation transcripts + * Operation technicalIndicator * - * Earnings Call Transcripts + * Technical Indicators * - * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) + * @param string $symbol symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\EarningsCallTranscripts + * @return object */ - public function transcripts($id) + public function technicalIndicator($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) { - list($response) = $this->transcriptsWithHttpInfo($id); + list($response) = $this->technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields); return $response; } /** - * Operation transcriptsWithHttpInfo + * Operation technicalIndicatorWithHttpInfo * - * Earnings Call Transcripts + * Technical Indicators * - * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) + * @param string $symbol symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\EarningsCallTranscripts, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function transcriptsWithHttpInfo($id) + public function technicalIndicatorWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) { - $request = $this->transcriptsRequest($id); + $request = $this->technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields); try { $options = $this->createHttpClientOption(); @@ -14714,7 +18393,7 @@ public function transcriptsWithHttpInfo($id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -14727,36 +18406,34 @@ public function transcriptsWithHttpInfo($id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Finnhub\Model\EarningsCallTranscripts' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\EarningsCallTranscripts', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\EarningsCallTranscripts'; - $responseBody = $response->getBody(); + $returnType = 'object'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14770,7 +18447,7 @@ public function transcriptsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\EarningsCallTranscripts', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14781,18 +18458,23 @@ public function transcriptsWithHttpInfo($id) } /** - * Operation transcriptsAsync + * Operation technicalIndicatorAsync * - * Earnings Call Transcripts + * Technical Indicators * - * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) + * @param string $symbol symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transcriptsAsync($id) + public function technicalIndicatorAsync($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) { - return $this->transcriptsAsyncWithHttpInfo($id) + return $this->technicalIndicatorAsyncWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields) ->then( function ($response) { return $response[0]; @@ -14801,29 +18483,33 @@ function ($response) { } /** - * Operation transcriptsAsyncWithHttpInfo + * Operation technicalIndicatorAsyncWithHttpInfo * - * Earnings Call Transcripts + * Technical Indicators * - * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) + * @param string $symbol symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transcriptsAsyncWithHttpInfo($id) + public function technicalIndicatorAsyncWithHttpInfo($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) { - $returnType = '\Finnhub\Model\EarningsCallTranscripts'; - $request = $this->transcriptsRequest($id); + $returnType = 'object'; + $request = $this->technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -14843,30 +18529,59 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'transcripts' + * Create request for operation 'technicalIndicator' * - * @param string $id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>. (required) + * @param string $symbol symbol (required) + * @param string $resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange. (required) + * @param int $from UNIX timestamp. Interval initial value. (required) + * @param int $to UNIX timestamp. Interval end value. (required) + * @param string $indicator Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>. (required) + * @param object $indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function transcriptsRequest($id) + public function technicalIndicatorRequest($symbol, $resolution, $from, $to, $indicator, $indicator_fields = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'symbol' is set + if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $symbol when calling technicalIndicator' + ); + } + // verify the required parameter 'resolution' is set + if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $resolution when calling technicalIndicator' + ); + } + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling technicalIndicator' + ); + } + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling transcripts' + 'Missing the required parameter $to when calling technicalIndicator' + ); + } + // verify the required parameter 'indicator' is set + if ($indicator === null || (is_array($indicator) && count($indicator) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indicator when calling technicalIndicator' ); } - $resourcePath = '/stock/transcripts'; + $resourcePath = '/indicator'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14874,17 +18589,43 @@ protected function transcriptsRequest($id) $multipart = false; // query params - if (is_array($id)) { - $id = ObjectSerializer::serializeCollection($id, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($id !== null) { - $queryParams['id'] = $id; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($resolution)) { + $resolution = ObjectSerializer::serializeCollection($resolution, '', true); + } + if ($resolution !== null) { + $queryParams['resolution'] = $resolution; + } + // query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, '', true); + } + if ($from !== null) { + $queryParams['from'] = $from; + } + // query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, '', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + // query params + if (is_array($indicator)) { + $indicator = ObjectSerializer::serializeCollection($indicator, '', true); + } + if ($indicator !== null) { + $queryParams['indicator'] = $indicator; } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -14893,26 +18634,28 @@ protected function transcriptsRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($indicator_fields)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($indicator_fields)); } else { - $httpBody = $_tempBody; + $httpBody = $indicator_fields; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -14945,7 +18688,7 @@ protected function transcriptsRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14991,7 +18734,7 @@ public function transcriptsListWithHttpInfo($symbol) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -15004,21 +18747,20 @@ public function transcriptsListWithHttpInfo($symbol) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\EarningsCallTranscriptsList' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15029,11 +18771,10 @@ public function transcriptsListWithHttpInfo($symbol) } $returnType = '\Finnhub\Model\EarningsCallTranscriptsList'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15096,11 +18837,10 @@ public function transcriptsListAsyncWithHttpInfo($symbol) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15120,7 +18860,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -15134,7 +18874,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function transcriptsListRequest($symbol) + public function transcriptsListRequest($symbol) { // verify the required parameter 'symbol' is set if ($symbol === null || (is_array($symbol) && count($symbol) === 0)) { @@ -15160,8 +18900,6 @@ protected function transcriptsListRequest($symbol) - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -15175,21 +18913,17 @@ protected function transcriptsListRequest($symbol) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -15272,7 +19006,7 @@ public function upgradeDowngradeWithHttpInfo($symbol = null, $from = null, $to = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); @@ -15285,21 +19019,20 @@ public function upgradeDowngradeWithHttpInfo($symbol = null, $from = null, $to = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\Finnhub\Model\UpgradeDowngrade[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15310,11 +19043,10 @@ public function upgradeDowngradeWithHttpInfo($symbol = null, $from = null, $to = } $returnType = '\Finnhub\Model\UpgradeDowngrade[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15381,11 +19113,10 @@ public function upgradeDowngradeAsyncWithHttpInfo($symbol = null, $from = null, ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = (string) $responseBody; + $content = (string) $response->getBody(); } return [ @@ -15405,7 +19136,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -15421,7 +19152,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function upgradeDowngradeRequest($symbol = null, $from = null, $to = null) + public function upgradeDowngradeRequest($symbol = null, $from = null, $to = null) { $resourcePath = '/stock/upgrade-downgrade'; @@ -15455,8 +19186,6 @@ protected function upgradeDowngradeRequest($symbol = null, $from = null, $to = n - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -15470,21 +19199,17 @@ protected function upgradeDowngradeRequest($symbol = null, $from = null, $to = n } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/ApiException.php b/lib/ApiException.php index c723008..5bd0324 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ getTempFolderPath() . PHP_EOL; return $report; @@ -408,7 +410,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -431,29 +433,29 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return an array of host settings + * @return array an array of host settings */ public function getHostSettings() { - return array( - array( - "url" => "https://finnhub.io/api/v1", - "description" => "No description provided", - ) - ); + return [ + [ + "url" => "https://finnhub.io/api/v1", + "description" => "No description provided", + ] + ]; } /** * Returns URL based on the index and variables * - * @param index array index of the host settings - * @param variables hash of variable and the corresponding value (optional) - * @return URL based on host settings + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ public function getHostFromSettings($index, $variables = null) { if (null === $variables) { - $variables = array(); + $variables = []; } $hosts = $this->getHostSettings(); @@ -467,9 +469,9 @@ public function getHostFromSettings($index, $variables = null) $url = $host["url"]; // go through variable and assign a value - foreach ($host["variables"] as $name => $variable) { + foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index ed8f42c..d4013f9 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AggregateIndicators implements ModelInterface, ArrayAccess +class AggregateIndicators implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class AggregateIndicators implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'technical_analysis' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['technical_analysis'] = isset($data['technical_analysis']) ? $data['technical_analysis'] : null; - $this->container['trend'] = isset($data['trend']) ? $data['trend'] : null; + $this->container['technical_analysis'] = $data['technical_analysis'] ?? null; + $this->container['trend'] = $data['trend'] ?? null; } /** @@ -225,7 +226,7 @@ public function getTechnicalAnalysis() * * @param \Finnhub\Model\TechnicalAnalysis|null $technical_analysis technical_analysis * - * @return $this + * @return self */ public function setTechnicalAnalysis($technical_analysis) { @@ -249,7 +250,7 @@ public function getTrend() * * @param \Finnhub\Model\Trend|null $trend trend * - * @return $this + * @return self */ public function setTrend($trend) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/BasicFinancials.php b/lib/Model/BasicFinancials.php index fc46c0e..bcd8174 100644 --- a/lib/Model/BasicFinancials.php +++ b/lib/Model/BasicFinancials.php @@ -2,7 +2,7 @@ /** * BasicFinancials * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class BasicFinancials implements ModelInterface, ArrayAccess +class BasicFinancials implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -59,6 +61,7 @@ class BasicFinancials implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'symbol' => 'string', 'metric_type' => 'string', + 'series' => 'object', 'metric' => 'object' ]; @@ -66,10 +69,13 @@ class BasicFinancials implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, 'metric_type' => null, + 'series' => null, 'metric' => null ]; @@ -102,6 +108,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'symbol' => 'symbol', 'metric_type' => 'metricType', + 'series' => 'series', 'metric' => 'metric' ]; @@ -113,6 +120,7 @@ public static function openAPIFormats() protected static $setters = [ 'symbol' => 'setSymbol', 'metric_type' => 'setMetricType', + 'series' => 'setSeries', 'metric' => 'setMetric' ]; @@ -124,6 +132,7 @@ public static function openAPIFormats() protected static $getters = [ 'symbol' => 'getSymbol', 'metric_type' => 'getMetricType', + 'series' => 'getSeries', 'metric' => 'getMetric' ]; @@ -168,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['metric_type'] = isset($data['metric_type']) ? $data['metric_type'] : null; - $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['metric_type'] = $data['metric_type'] ?? null; + $this->container['series'] = $data['series'] ?? null; + $this->container['metric'] = $data['metric'] ?? null; } /** @@ -231,7 +238,7 @@ public function getSymbol() * * @param string|null $symbol Symbol of the company. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -255,7 +262,7 @@ public function getMetricType() * * @param string|null $metric_type Metric type. * - * @return $this + * @return self */ public function setMetricType($metric_type) { @@ -264,6 +271,30 @@ public function setMetricType($metric_type) return $this; } + /** + * Gets series + * + * @return object|null + */ + public function getSeries() + { + return $this->container['series']; + } + + /** + * Sets series + * + * @param object|null $series series + * + * @return self + */ + public function setSeries($series) + { + $this->container['series'] = $series; + + return $this; + } + /** * Gets metric * @@ -279,7 +310,7 @@ public function getMetric() * * @param object|null $metric metric * - * @return $this + * @return self */ public function setMetric($metric) { @@ -304,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/BreakdownItem.php b/lib/Model/BreakdownItem.php new file mode 100644 index 0000000..c824aa5 --- /dev/null +++ b/lib/Model/BreakdownItem.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BreakdownItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BreakdownItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'access_number' => 'string', + 'breakdown' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'access_number' => null, + 'breakdown' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'access_number' => 'accessNumber', + 'breakdown' => 'breakdown' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'access_number' => 'setAccessNumber', + 'breakdown' => 'setBreakdown' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'access_number' => 'getAccessNumber', + 'breakdown' => 'getBreakdown' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_number'] = $data['access_number'] ?? null; + $this->container['breakdown'] = $data['breakdown'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets access_number + * + * @return string|null + */ + public function getAccessNumber() + { + return $this->container['access_number']; + } + + /** + * Sets access_number + * + * @param string|null $access_number Access number of the report from which the data is sourced. + * + * @return self + */ + public function setAccessNumber($access_number) + { + $this->container['access_number'] = $access_number; + + return $this; + } + + /** + * Gets breakdown + * + * @return object|null + */ + public function getBreakdown() + { + return $this->container['breakdown']; + } + + /** + * Sets breakdown + * + * @param object|null $breakdown breakdown + * + * @return self + */ + public function setBreakdown($breakdown) + { + $this->container['breakdown'] = $breakdown; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Company.php b/lib/Model/Company.php index 1fd55da..10063ae 100644 --- a/lib/Model/Company.php +++ b/lib/Model/Company.php @@ -2,7 +2,7 @@ /** * Company * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Company implements ModelInterface, ArrayAccess +class Company implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +72,8 @@ class Company implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null, @@ -188,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -207,13 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['age'] = isset($data['age']) ? $data['age'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['since'] = isset($data['since']) ? $data['since'] : null; - $this->container['sex'] = isset($data['sex']) ? $data['sex'] : null; - $this->container['compensation'] = isset($data['compensation']) ? $data['compensation'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['name'] = $data['name'] ?? null; + $this->container['age'] = $data['age'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['since'] = $data['since'] ?? null; + $this->container['sex'] = $data['sex'] ?? null; + $this->container['compensation'] = $data['compensation'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; } /** @@ -255,7 +256,7 @@ public function getName() * * @param string|null $name Executive name * - * @return $this + * @return self */ public function setName($name) { @@ -279,7 +280,7 @@ public function getAge() * * @param int|null $age Age * - * @return $this + * @return self */ public function setAge($age) { @@ -303,7 +304,7 @@ public function getTitle() * * @param string|null $title Title * - * @return $this + * @return self */ public function setTitle($title) { @@ -327,7 +328,7 @@ public function getSince() * * @param string|null $since Year appointed * - * @return $this + * @return self */ public function setSince($since) { @@ -351,7 +352,7 @@ public function getSex() * * @param string|null $sex Sex * - * @return $this + * @return self */ public function setSex($sex) { @@ -375,7 +376,7 @@ public function getCompensation() * * @param int|null $compensation Total compensation * - * @return $this + * @return self */ public function setCompensation($compensation) { @@ -399,7 +400,7 @@ public function getCurrency() * * @param string|null $currency Compensation currency * - * @return $this + * @return self */ public function setCurrency($currency) { @@ -424,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -460,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CompanyExecutive.php b/lib/Model/CompanyExecutive.php index 22e511f..884436c 100644 --- a/lib/Model/CompanyExecutive.php +++ b/lib/Model/CompanyExecutive.php @@ -2,7 +2,7 @@ /** * CompanyExecutive * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CompanyExecutive implements ModelInterface, ArrayAccess +class CompanyExecutive implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class CompanyExecutive implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['executive'] = isset($data['executive']) ? $data['executive'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['executive'] = $data['executive'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getExecutive() * * @param object[]|null $executive Array of company's executives and members of the Board. * - * @return $this + * @return self */ public function setExecutive($executive) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CompanyNewsStatistics.php b/lib/Model/CompanyNewsStatistics.php index 5320ac3..88b9eec 100644 --- a/lib/Model/CompanyNewsStatistics.php +++ b/lib/Model/CompanyNewsStatistics.php @@ -2,7 +2,7 @@ /** * CompanyNewsStatistics * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CompanyNewsStatistics implements ModelInterface, ArrayAccess +class CompanyNewsStatistics implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class CompanyNewsStatistics implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'articles_in_last_week' => 'int64', @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['articles_in_last_week'] = isset($data['articles_in_last_week']) ? $data['articles_in_last_week'] : null; - $this->container['buzz'] = isset($data['buzz']) ? $data['buzz'] : null; - $this->container['weekly_average'] = isset($data['weekly_average']) ? $data['weekly_average'] : null; + $this->container['articles_in_last_week'] = $data['articles_in_last_week'] ?? null; + $this->container['buzz'] = $data['buzz'] ?? null; + $this->container['weekly_average'] = $data['weekly_average'] ?? null; } /** @@ -231,7 +232,7 @@ public function getArticlesInLastWeek() * * @param int|null $articles_in_last_week * - * @return $this + * @return self */ public function setArticlesInLastWeek($articles_in_last_week) { @@ -255,7 +256,7 @@ public function getBuzz() * * @param float|null $buzz * - * @return $this + * @return self */ public function setBuzz($buzz) { @@ -279,7 +280,7 @@ public function getWeeklyAverage() * * @param float|null $weekly_average * - * @return $this + * @return self */ public function setWeeklyAverage($weekly_average) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CompanyProfile.php b/lib/Model/CompanyProfile.php index 5d96ea1..175d173 100644 --- a/lib/Model/CompanyProfile.php +++ b/lib/Model/CompanyProfile.php @@ -2,7 +2,7 @@ /** * CompanyProfile * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CompanyProfile implements ModelInterface, ArrayAccess +class CompanyProfile implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -91,6 +93,8 @@ class CompanyProfile implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'address' => null, @@ -293,9 +297,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -312,34 +313,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['address'] = isset($data['address']) ? $data['address'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['cusip'] = isset($data['cusip']) ? $data['cusip'] : null; - $this->container['sedol'] = isset($data['sedol']) ? $data['sedol'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['exchange'] = isset($data['exchange']) ? $data['exchange'] : null; - $this->container['ggroup'] = isset($data['ggroup']) ? $data['ggroup'] : null; - $this->container['gind'] = isset($data['gind']) ? $data['gind'] : null; - $this->container['gsector'] = isset($data['gsector']) ? $data['gsector'] : null; - $this->container['gsubind'] = isset($data['gsubind']) ? $data['gsubind'] : null; - $this->container['isin'] = isset($data['isin']) ? $data['isin'] : null; - $this->container['naics_national_industry'] = isset($data['naics_national_industry']) ? $data['naics_national_industry'] : null; - $this->container['naics'] = isset($data['naics']) ? $data['naics'] : null; - $this->container['naics_sector'] = isset($data['naics_sector']) ? $data['naics_sector'] : null; - $this->container['naics_subsector'] = isset($data['naics_subsector']) ? $data['naics_subsector'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['ticker'] = isset($data['ticker']) ? $data['ticker'] : null; - $this->container['weburl'] = isset($data['weburl']) ? $data['weburl'] : null; - $this->container['ipo'] = isset($data['ipo']) ? $data['ipo'] : null; - $this->container['market_capitalization'] = isset($data['market_capitalization']) ? $data['market_capitalization'] : null; - $this->container['share_outstanding'] = isset($data['share_outstanding']) ? $data['share_outstanding'] : null; - $this->container['employee_total'] = isset($data['employee_total']) ? $data['employee_total'] : null; - $this->container['logo'] = isset($data['logo']) ? $data['logo'] : null; - $this->container['finnhub_industry'] = isset($data['finnhub_industry']) ? $data['finnhub_industry'] : null; + $this->container['address'] = $data['address'] ?? null; + $this->container['city'] = $data['city'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['cusip'] = $data['cusip'] ?? null; + $this->container['sedol'] = $data['sedol'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['exchange'] = $data['exchange'] ?? null; + $this->container['ggroup'] = $data['ggroup'] ?? null; + $this->container['gind'] = $data['gind'] ?? null; + $this->container['gsector'] = $data['gsector'] ?? null; + $this->container['gsubind'] = $data['gsubind'] ?? null; + $this->container['isin'] = $data['isin'] ?? null; + $this->container['naics_national_industry'] = $data['naics_national_industry'] ?? null; + $this->container['naics'] = $data['naics'] ?? null; + $this->container['naics_sector'] = $data['naics_sector'] ?? null; + $this->container['naics_subsector'] = $data['naics_subsector'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['state'] = $data['state'] ?? null; + $this->container['ticker'] = $data['ticker'] ?? null; + $this->container['weburl'] = $data['weburl'] ?? null; + $this->container['ipo'] = $data['ipo'] ?? null; + $this->container['market_capitalization'] = $data['market_capitalization'] ?? null; + $this->container['share_outstanding'] = $data['share_outstanding'] ?? null; + $this->container['employee_total'] = $data['employee_total'] ?? null; + $this->container['logo'] = $data['logo'] ?? null; + $this->container['finnhub_industry'] = $data['finnhub_industry'] ?? null; } /** @@ -381,7 +382,7 @@ public function getAddress() * * @param string|null $address Address of company's headquarter. * - * @return $this + * @return self */ public function setAddress($address) { @@ -405,7 +406,7 @@ public function getCity() * * @param string|null $city City of company's headquarter. * - * @return $this + * @return self */ public function setCity($city) { @@ -429,7 +430,7 @@ public function getCountry() * * @param string|null $country Country of company's headquarter. * - * @return $this + * @return self */ public function setCountry($country) { @@ -453,7 +454,7 @@ public function getCurrency() * * @param string|null $currency Currency used in company filings. * - * @return $this + * @return self */ public function setCurrency($currency) { @@ -477,7 +478,7 @@ public function getCusip() * * @param string|null $cusip CUSIP number. * - * @return $this + * @return self */ public function setCusip($cusip) { @@ -501,7 +502,7 @@ public function getSedol() * * @param string|null $sedol Sedol number. * - * @return $this + * @return self */ public function setSedol($sedol) { @@ -525,7 +526,7 @@ public function getDescription() * * @param string|null $description Company business summary. * - * @return $this + * @return self */ public function setDescription($description) { @@ -549,7 +550,7 @@ public function getExchange() * * @param string|null $exchange Listed exchange. * - * @return $this + * @return self */ public function setExchange($exchange) { @@ -573,7 +574,7 @@ public function getGgroup() * * @param string|null $ggroup GICS industry group. * - * @return $this + * @return self */ public function setGgroup($ggroup) { @@ -597,7 +598,7 @@ public function getGind() * * @param string|null $gind GICS industry. * - * @return $this + * @return self */ public function setGind($gind) { @@ -621,7 +622,7 @@ public function getGsector() * * @param string|null $gsector GICS sector. * - * @return $this + * @return self */ public function setGsector($gsector) { @@ -645,7 +646,7 @@ public function getGsubind() * * @param string|null $gsubind GICS sub-industry. * - * @return $this + * @return self */ public function setGsubind($gsubind) { @@ -669,7 +670,7 @@ public function getIsin() * * @param string|null $isin ISIN number. * - * @return $this + * @return self */ public function setIsin($isin) { @@ -693,7 +694,7 @@ public function getNaicsNationalIndustry() * * @param string|null $naics_national_industry NAICS national industry. * - * @return $this + * @return self */ public function setNaicsNationalIndustry($naics_national_industry) { @@ -717,7 +718,7 @@ public function getNaics() * * @param string|null $naics NAICS industry. * - * @return $this + * @return self */ public function setNaics($naics) { @@ -741,7 +742,7 @@ public function getNaicsSector() * * @param string|null $naics_sector NAICS sector. * - * @return $this + * @return self */ public function setNaicsSector($naics_sector) { @@ -765,7 +766,7 @@ public function getNaicsSubsector() * * @param string|null $naics_subsector NAICS subsector. * - * @return $this + * @return self */ public function setNaicsSubsector($naics_subsector) { @@ -789,7 +790,7 @@ public function getName() * * @param string|null $name Company name. * - * @return $this + * @return self */ public function setName($name) { @@ -813,7 +814,7 @@ public function getPhone() * * @param string|null $phone Company phone number. * - * @return $this + * @return self */ public function setPhone($phone) { @@ -837,7 +838,7 @@ public function getState() * * @param string|null $state State of company's headquarter. * - * @return $this + * @return self */ public function setState($state) { @@ -861,7 +862,7 @@ public function getTicker() * * @param string|null $ticker Company symbol/ticker as used on the listed exchange. * - * @return $this + * @return self */ public function setTicker($ticker) { @@ -885,7 +886,7 @@ public function getWeburl() * * @param string|null $weburl Company website. * - * @return $this + * @return self */ public function setWeburl($weburl) { @@ -909,7 +910,7 @@ public function getIpo() * * @param \DateTime|null $ipo IPO date. * - * @return $this + * @return self */ public function setIpo($ipo) { @@ -933,7 +934,7 @@ public function getMarketCapitalization() * * @param float|null $market_capitalization Market Capitalization. * - * @return $this + * @return self */ public function setMarketCapitalization($market_capitalization) { @@ -957,7 +958,7 @@ public function getShareOutstanding() * * @param float|null $share_outstanding Number of oustanding shares. * - * @return $this + * @return self */ public function setShareOutstanding($share_outstanding) { @@ -981,7 +982,7 @@ public function getEmployeeTotal() * * @param int|null $employee_total Number of employee. * - * @return $this + * @return self */ public function setEmployeeTotal($employee_total) { @@ -1005,7 +1006,7 @@ public function getLogo() * * @param string|null $logo Logo image. * - * @return $this + * @return self */ public function setLogo($logo) { @@ -1029,7 +1030,7 @@ public function getFinnhubIndustry() * * @param string|null $finnhub_industry Finnhub industry classification. * - * @return $this + * @return self */ public function setFinnhubIndustry($finnhub_industry) { @@ -1054,18 +1055,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -1090,6 +1091,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CompanyProfile2.php b/lib/Model/CompanyProfile2.php index 6ab73a7..6b48ae3 100644 --- a/lib/Model/CompanyProfile2.php +++ b/lib/Model/CompanyProfile2.php @@ -2,7 +2,7 @@ /** * CompanyProfile2 * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CompanyProfile2 implements ModelInterface, ArrayAccess +class CompanyProfile2 implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -75,6 +77,8 @@ class CompanyProfile2 implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'country' => null, @@ -213,9 +217,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -232,18 +233,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['exchange'] = isset($data['exchange']) ? $data['exchange'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['ticker'] = isset($data['ticker']) ? $data['ticker'] : null; - $this->container['ipo'] = isset($data['ipo']) ? $data['ipo'] : null; - $this->container['market_capitalization'] = isset($data['market_capitalization']) ? $data['market_capitalization'] : null; - $this->container['share_outstanding'] = isset($data['share_outstanding']) ? $data['share_outstanding'] : null; - $this->container['logo'] = isset($data['logo']) ? $data['logo'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; - $this->container['weburl'] = isset($data['weburl']) ? $data['weburl'] : null; - $this->container['finnhub_industry'] = isset($data['finnhub_industry']) ? $data['finnhub_industry'] : null; + $this->container['country'] = $data['country'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['exchange'] = $data['exchange'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['ticker'] = $data['ticker'] ?? null; + $this->container['ipo'] = $data['ipo'] ?? null; + $this->container['market_capitalization'] = $data['market_capitalization'] ?? null; + $this->container['share_outstanding'] = $data['share_outstanding'] ?? null; + $this->container['logo'] = $data['logo'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['weburl'] = $data['weburl'] ?? null; + $this->container['finnhub_industry'] = $data['finnhub_industry'] ?? null; } /** @@ -285,7 +286,7 @@ public function getCountry() * * @param string|null $country Country of company's headquarter. * - * @return $this + * @return self */ public function setCountry($country) { @@ -309,7 +310,7 @@ public function getCurrency() * * @param string|null $currency Currency used in company filings. * - * @return $this + * @return self */ public function setCurrency($currency) { @@ -333,7 +334,7 @@ public function getExchange() * * @param string|null $exchange Listed exchange. * - * @return $this + * @return self */ public function setExchange($exchange) { @@ -357,7 +358,7 @@ public function getName() * * @param string|null $name Company name. * - * @return $this + * @return self */ public function setName($name) { @@ -381,7 +382,7 @@ public function getTicker() * * @param string|null $ticker Company symbol/ticker as used on the listed exchange. * - * @return $this + * @return self */ public function setTicker($ticker) { @@ -405,7 +406,7 @@ public function getIpo() * * @param \DateTime|null $ipo IPO date. * - * @return $this + * @return self */ public function setIpo($ipo) { @@ -429,7 +430,7 @@ public function getMarketCapitalization() * * @param float|null $market_capitalization Market Capitalization. * - * @return $this + * @return self */ public function setMarketCapitalization($market_capitalization) { @@ -453,7 +454,7 @@ public function getShareOutstanding() * * @param float|null $share_outstanding Number of oustanding shares. * - * @return $this + * @return self */ public function setShareOutstanding($share_outstanding) { @@ -477,7 +478,7 @@ public function getLogo() * * @param string|null $logo Logo image. * - * @return $this + * @return self */ public function setLogo($logo) { @@ -501,7 +502,7 @@ public function getPhone() * * @param string|null $phone Company phone number. * - * @return $this + * @return self */ public function setPhone($phone) { @@ -525,7 +526,7 @@ public function getWeburl() * * @param string|null $weburl Company website. * - * @return $this + * @return self */ public function setWeburl($weburl) { @@ -549,7 +550,7 @@ public function getFinnhubIndustry() * * @param string|null $finnhub_industry Finnhub industry classification. * - * @return $this + * @return self */ public function setFinnhubIndustry($finnhub_industry) { @@ -574,18 +575,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -610,6 +611,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CountryMetadata.php b/lib/Model/CountryMetadata.php index b592d48..a717138 100644 --- a/lib/Model/CountryMetadata.php +++ b/lib/Model/CountryMetadata.php @@ -2,7 +2,7 @@ /** * CountryMetadata * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CountryMetadata implements ModelInterface, ArrayAccess +class CountryMetadata implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +71,8 @@ class CountryMetadata implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'country' => null, @@ -183,9 +187,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +203,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['code2'] = isset($data['code2']) ? $data['code2'] : null; - $this->container['code3'] = isset($data['code3']) ? $data['code3'] : null; - $this->container['code_no'] = isset($data['code_no']) ? $data['code_no'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['currency_code'] = isset($data['currency_code']) ? $data['currency_code'] : null; + $this->container['country'] = $data['country'] ?? null; + $this->container['code2'] = $data['code2'] ?? null; + $this->container['code3'] = $data['code3'] ?? null; + $this->container['code_no'] = $data['code_no'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['currency_code'] = $data['currency_code'] ?? null; } /** @@ -249,7 +250,7 @@ public function getCountry() * * @param string|null $country Country name * - * @return $this + * @return self */ public function setCountry($country) { @@ -273,7 +274,7 @@ public function getCode2() * * @param string|null $code2 Alpha 2 code * - * @return $this + * @return self */ public function setCode2($code2) { @@ -297,7 +298,7 @@ public function getCode3() * * @param string|null $code3 Alpha 3 code * - * @return $this + * @return self */ public function setCode3($code3) { @@ -321,7 +322,7 @@ public function getCodeNo() * * @param string|null $code_no UN code * - * @return $this + * @return self */ public function setCodeNo($code_no) { @@ -345,7 +346,7 @@ public function getCurrency() * * @param string|null $currency Currency name * - * @return $this + * @return self */ public function setCurrency($currency) { @@ -369,7 +370,7 @@ public function getCurrencyCode() * * @param string|null $currency_code Currency code * - * @return $this + * @return self */ public function setCurrencyCode($currency_code) { @@ -394,18 +395,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -430,6 +431,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CovidInfo.php b/lib/Model/CovidInfo.php index 358508e..6892197 100644 --- a/lib/Model/CovidInfo.php +++ b/lib/Model/CovidInfo.php @@ -2,7 +2,7 @@ /** * CovidInfo * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CovidInfo implements ModelInterface, ArrayAccess +class CovidInfo implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +69,8 @@ class CovidInfo implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'state' => null, @@ -173,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['case'] = isset($data['case']) ? $data['case'] : null; - $this->container['death'] = isset($data['death']) ? $data['death'] : null; - $this->container['updated'] = isset($data['updated']) ? $data['updated'] : null; + $this->container['state'] = $data['state'] ?? null; + $this->container['case'] = $data['case'] ?? null; + $this->container['death'] = $data['death'] ?? null; + $this->container['updated'] = $data['updated'] ?? null; } /** @@ -237,7 +238,7 @@ public function getState() * * @param string|null $state State. * - * @return $this + * @return self */ public function setState($state) { @@ -261,7 +262,7 @@ public function getCase() * * @param float|null $case Number of confirmed cases. * - * @return $this + * @return self */ public function setCase($case) { @@ -285,7 +286,7 @@ public function getDeath() * * @param float|null $death Number of confirmed deaths. * - * @return $this + * @return self */ public function setDeath($death) { @@ -309,7 +310,7 @@ public function getUpdated() * * @param \DateTime|null $updated Updated time. * - * @return $this + * @return self */ public function setUpdated($updated) { @@ -334,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CryptoCandles.php b/lib/Model/CryptoCandles.php index cd9deb0..3ddf465 100644 --- a/lib/Model/CryptoCandles.php +++ b/lib/Model/CryptoCandles.php @@ -2,7 +2,7 @@ /** * CryptoCandles * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CryptoCandles implements ModelInterface, ArrayAccess +class CryptoCandles implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +72,8 @@ class CryptoCandles implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'o' => 'float', @@ -188,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -207,13 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['o'] = isset($data['o']) ? $data['o'] : null; - $this->container['h'] = isset($data['h']) ? $data['h'] : null; - $this->container['l'] = isset($data['l']) ? $data['l'] : null; - $this->container['c'] = isset($data['c']) ? $data['c'] : null; - $this->container['v'] = isset($data['v']) ? $data['v'] : null; - $this->container['t'] = isset($data['t']) ? $data['t'] : null; - $this->container['s'] = isset($data['s']) ? $data['s'] : null; + $this->container['o'] = $data['o'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['l'] = $data['l'] ?? null; + $this->container['c'] = $data['c'] ?? null; + $this->container['v'] = $data['v'] ?? null; + $this->container['t'] = $data['t'] ?? null; + $this->container['s'] = $data['s'] ?? null; } /** @@ -255,7 +256,7 @@ public function getO() * * @param float[]|null $o List of open prices for returned candles. * - * @return $this + * @return self */ public function setO($o) { @@ -279,7 +280,7 @@ public function getH() * * @param float[]|null $h List of high prices for returned candles. * - * @return $this + * @return self */ public function setH($h) { @@ -303,7 +304,7 @@ public function getL() * * @param float[]|null $l List of low prices for returned candles. * - * @return $this + * @return self */ public function setL($l) { @@ -327,7 +328,7 @@ public function getC() * * @param float[]|null $c List of close prices for returned candles. * - * @return $this + * @return self */ public function setC($c) { @@ -351,7 +352,7 @@ public function getV() * * @param float[]|null $v List of volume data for returned candles. * - * @return $this + * @return self */ public function setV($v) { @@ -375,7 +376,7 @@ public function getT() * * @param int[]|null $t List of timestamp for returned candles. * - * @return $this + * @return self */ public function setT($t) { @@ -399,7 +400,7 @@ public function getS() * * @param string|null $s Status of the response. This field can either be ok or no_data. * - * @return $this + * @return self */ public function setS($s) { @@ -424,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -460,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/CryptoSymbol.php b/lib/Model/CryptoSymbol.php index 98df154..08021b6 100644 --- a/lib/Model/CryptoSymbol.php +++ b/lib/Model/CryptoSymbol.php @@ -2,7 +2,7 @@ /** * CryptoSymbol * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class CryptoSymbol implements ModelInterface, ArrayAccess +class CryptoSymbol implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class CryptoSymbol implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['display_symbol'] = isset($data['display_symbol']) ? $data['display_symbol'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['description'] = $data['description'] ?? null; + $this->container['display_symbol'] = $data['display_symbol'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -231,7 +232,7 @@ public function getDescription() * * @param string|null $description Symbol description * - * @return $this + * @return self */ public function setDescription($description) { @@ -255,7 +256,7 @@ public function getDisplaySymbol() * * @param string|null $display_symbol Display symbol name. * - * @return $this + * @return self */ public function setDisplaySymbol($display_symbol) { @@ -279,7 +280,7 @@ public function getSymbol() * * @param string|null $symbol Unique symbol used to identify this symbol used in /crypto/candle endpoint. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Development.php b/lib/Model/Development.php index 39eb92b..c76089a 100644 --- a/lib/Model/Development.php +++ b/lib/Model/Development.php @@ -2,7 +2,7 @@ /** * Development * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Development implements ModelInterface, ArrayAccess +class Development implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -60,19 +62,23 @@ class Development implements ModelInterface, ArrayAccess 'symbol' => 'string', 'datetime' => '\DateTime', 'headline' => 'string', - 'description' => 'string' + 'description' => 'string', + 'url' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, 'datetime' => 'date-time', 'headline' => null, - 'description' => null + 'description' => null, + 'url' => null ]; /** @@ -105,7 +111,8 @@ public static function openAPIFormats() 'symbol' => 'symbol', 'datetime' => 'datetime', 'headline' => 'headline', - 'description' => 'description' + 'description' => 'description', + 'url' => 'url' ]; /** @@ -117,7 +124,8 @@ public static function openAPIFormats() 'symbol' => 'setSymbol', 'datetime' => 'setDatetime', 'headline' => 'setHeadline', - 'description' => 'setDescription' + 'description' => 'setDescription', + 'url' => 'setUrl' ]; /** @@ -129,7 +137,8 @@ public static function openAPIFormats() 'symbol' => 'getSymbol', 'datetime' => 'getDatetime', 'headline' => 'getHeadline', - 'description' => 'getDescription' + 'description' => 'getDescription', + 'url' => 'getUrl' ]; /** @@ -173,9 +182,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +198,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['datetime'] = isset($data['datetime']) ? $data['datetime'] : null; - $this->container['headline'] = isset($data['headline']) ? $data['headline'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['datetime'] = $data['datetime'] ?? null; + $this->container['headline'] = $data['headline'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -237,7 +244,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -261,7 +268,7 @@ public function getDatetime() * * @param \DateTime|null $datetime Published time in YYYY-MM-DD HH:MM:SS format. * - * @return $this + * @return self */ public function setDatetime($datetime) { @@ -285,7 +292,7 @@ public function getHeadline() * * @param string|null $headline Development headline. * - * @return $this + * @return self */ public function setHeadline($headline) { @@ -309,7 +316,7 @@ public function getDescription() * * @param string|null $description Development description. * - * @return $this + * @return self */ public function setDescription($description) { @@ -317,6 +324,30 @@ public function setDescription($description) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url URL. + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -334,18 +365,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +401,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Dividends.php b/lib/Model/Dividends.php index 01e8bc9..b99fcb3 100644 --- a/lib/Model/Dividends.php +++ b/lib/Model/Dividends.php @@ -2,7 +2,7 @@ /** * Dividends * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Dividends implements ModelInterface, ArrayAccess +class Dividends implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +73,8 @@ class Dividends implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -193,9 +197,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -212,14 +213,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; - $this->container['adjusted_amount'] = isset($data['adjusted_amount']) ? $data['adjusted_amount'] : null; - $this->container['pay_date'] = isset($data['pay_date']) ? $data['pay_date'] : null; - $this->container['record_date'] = isset($data['record_date']) ? $data['record_date'] : null; - $this->container['declaration_date'] = isset($data['declaration_date']) ? $data['declaration_date'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['date'] = $data['date'] ?? null; + $this->container['amount'] = $data['amount'] ?? null; + $this->container['adjusted_amount'] = $data['adjusted_amount'] ?? null; + $this->container['pay_date'] = $data['pay_date'] ?? null; + $this->container['record_date'] = $data['record_date'] ?? null; + $this->container['declaration_date'] = $data['declaration_date'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; } /** @@ -261,7 +262,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -285,7 +286,7 @@ public function getDate() * * @param \DateTime|null $date Ex-Dividend date. * - * @return $this + * @return self */ public function setDate($date) { @@ -309,7 +310,7 @@ public function getAmount() * * @param float|null $amount Amount in local currency. * - * @return $this + * @return self */ public function setAmount($amount) { @@ -333,7 +334,7 @@ public function getAdjustedAmount() * * @param float|null $adjusted_amount Adjusted dividend. * - * @return $this + * @return self */ public function setAdjustedAmount($adjusted_amount) { @@ -357,7 +358,7 @@ public function getPayDate() * * @param \DateTime|null $pay_date Pay date. * - * @return $this + * @return self */ public function setPayDate($pay_date) { @@ -381,7 +382,7 @@ public function getRecordDate() * * @param \DateTime|null $record_date Record date. * - * @return $this + * @return self */ public function setRecordDate($record_date) { @@ -405,7 +406,7 @@ public function getDeclarationDate() * * @param \DateTime|null $declaration_date Declaration date. * - * @return $this + * @return self */ public function setDeclarationDate($declaration_date) { @@ -429,7 +430,7 @@ public function getCurrency() * * @param string|null $currency Currency. * - * @return $this + * @return self */ public function setCurrency($currency) { @@ -454,18 +455,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -490,6 +491,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Dividends2Basic.php b/lib/Model/Dividends2Basic.php new file mode 100644 index 0000000..e3822ed --- /dev/null +++ b/lib/Model/Dividends2Basic.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Dividends2Basic implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Dividends2(Basic)'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ETFCountryExposureData.php b/lib/Model/ETFCountryExposureData.php new file mode 100644 index 0000000..bf82c3b --- /dev/null +++ b/lib/Model/ETFCountryExposureData.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ETFCountryExposureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ETFCountryExposureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country' => 'string', + 'exposure' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country' => null, + 'exposure' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'exposure' => 'exposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'exposure' => 'setExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'exposure' => 'getExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country'] = $data['country'] ?? null; + $this->container['exposure'] = $data['exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets exposure + * + * @return float|null + */ + public function getExposure() + { + return $this->container['exposure']; + } + + /** + * Sets exposure + * + * @param float|null $exposure Percent of exposure. + * + * @return self + */ + public function setExposure($exposure) + { + $this->container['exposure'] = $exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ETFHoldingsData.php b/lib/Model/ETFHoldingsData.php new file mode 100644 index 0000000..1278a1c --- /dev/null +++ b/lib/Model/ETFHoldingsData.php @@ -0,0 +1,500 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ETFHoldingsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ETFHoldingsData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'name' => 'string', + 'isin' => 'string', + 'cusip' => 'string', + 'share' => 'float', + 'percent' => 'float', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'name' => null, + 'isin' => null, + 'cusip' => null, + 'share' => 'float', + 'percent' => 'float', + 'value' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'name' => 'name', + 'isin' => 'isin', + 'cusip' => 'cusip', + 'share' => 'share', + 'percent' => 'percent', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'name' => 'setName', + 'isin' => 'setIsin', + 'cusip' => 'setCusip', + 'share' => 'setShare', + 'percent' => 'setPercent', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'name' => 'getName', + 'isin' => 'getIsin', + 'cusip' => 'getCusip', + 'share' => 'getShare', + 'percent' => 'getPercent', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['isin'] = $data['isin'] ?? null; + $this->container['cusip'] = $data['cusip'] ?? null; + $this->container['share'] = $data['share'] ?? null; + $this->container['percent'] = $data['percent'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol description + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Security name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets isin + * + * @return string|null + */ + public function getIsin() + { + return $this->container['isin']; + } + + /** + * Sets isin + * + * @param string|null $isin ISIN. + * + * @return self + */ + public function setIsin($isin) + { + $this->container['isin'] = $isin; + + return $this; + } + + /** + * Gets cusip + * + * @return string|null + */ + public function getCusip() + { + return $this->container['cusip']; + } + + /** + * Sets cusip + * + * @param string|null $cusip CUSIP. + * + * @return self + */ + public function setCusip($cusip) + { + $this->container['cusip'] = $cusip; + + return $this; + } + + /** + * Gets share + * + * @return float|null + */ + public function getShare() + { + return $this->container['share']; + } + + /** + * Sets share + * + * @param float|null $share Number of shares owned by the ETF. + * + * @return self + */ + public function setShare($share) + { + $this->container['share'] = $share; + + return $this; + } + + /** + * Gets percent + * + * @return float|null + */ + public function getPercent() + { + return $this->container['percent']; + } + + /** + * Sets percent + * + * @param float|null $percent Portfolio's percent + * + * @return self + */ + public function setPercent($percent) + { + $this->container['percent'] = $percent; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Market value + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ETFProfileData.php b/lib/Model/ETFProfileData.php new file mode 100644 index 0000000..e56798c --- /dev/null +++ b/lib/Model/ETFProfileData.php @@ -0,0 +1,830 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ETFProfileData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ETFProfileData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'asset_class' => 'string', + 'investment_segment' => 'string', + 'aum' => 'float', + 'nav' => 'float', + 'nav_currency' => 'string', + 'expense_ratio' => 'float', + 'tracking_index' => 'string', + 'etf_company' => 'string', + 'domicile' => 'string', + 'inception_date' => '\DateTime', + 'website' => 'string', + 'isin' => 'string', + 'cusip' => 'string', + 'price_to_earnings' => 'float', + 'price_to_book' => 'float', + 'avg_volume' => 'float', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'asset_class' => null, + 'investment_segment' => null, + 'aum' => 'float', + 'nav' => 'float', + 'nav_currency' => null, + 'expense_ratio' => 'float', + 'tracking_index' => null, + 'etf_company' => null, + 'domicile' => null, + 'inception_date' => 'date', + 'website' => null, + 'isin' => null, + 'cusip' => null, + 'price_to_earnings' => 'float', + 'price_to_book' => 'float', + 'avg_volume' => 'float', + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'asset_class' => 'assetClass', + 'investment_segment' => 'investmentSegment', + 'aum' => 'aum', + 'nav' => 'nav', + 'nav_currency' => 'navCurrency', + 'expense_ratio' => 'expenseRatio', + 'tracking_index' => 'trackingIndex', + 'etf_company' => 'etfCompany', + 'domicile' => 'domicile', + 'inception_date' => 'inceptionDate', + 'website' => 'website', + 'isin' => 'isin', + 'cusip' => 'cusip', + 'price_to_earnings' => 'priceToEarnings', + 'price_to_book' => 'priceToBook', + 'avg_volume' => 'avgVolume', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'asset_class' => 'setAssetClass', + 'investment_segment' => 'setInvestmentSegment', + 'aum' => 'setAum', + 'nav' => 'setNav', + 'nav_currency' => 'setNavCurrency', + 'expense_ratio' => 'setExpenseRatio', + 'tracking_index' => 'setTrackingIndex', + 'etf_company' => 'setEtfCompany', + 'domicile' => 'setDomicile', + 'inception_date' => 'setInceptionDate', + 'website' => 'setWebsite', + 'isin' => 'setIsin', + 'cusip' => 'setCusip', + 'price_to_earnings' => 'setPriceToEarnings', + 'price_to_book' => 'setPriceToBook', + 'avg_volume' => 'setAvgVolume', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'asset_class' => 'getAssetClass', + 'investment_segment' => 'getInvestmentSegment', + 'aum' => 'getAum', + 'nav' => 'getNav', + 'nav_currency' => 'getNavCurrency', + 'expense_ratio' => 'getExpenseRatio', + 'tracking_index' => 'getTrackingIndex', + 'etf_company' => 'getEtfCompany', + 'domicile' => 'getDomicile', + 'inception_date' => 'getInceptionDate', + 'website' => 'getWebsite', + 'isin' => 'getIsin', + 'cusip' => 'getCusip', + 'price_to_earnings' => 'getPriceToEarnings', + 'price_to_book' => 'getPriceToBook', + 'avg_volume' => 'getAvgVolume', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['asset_class'] = $data['asset_class'] ?? null; + $this->container['investment_segment'] = $data['investment_segment'] ?? null; + $this->container['aum'] = $data['aum'] ?? null; + $this->container['nav'] = $data['nav'] ?? null; + $this->container['nav_currency'] = $data['nav_currency'] ?? null; + $this->container['expense_ratio'] = $data['expense_ratio'] ?? null; + $this->container['tracking_index'] = $data['tracking_index'] ?? null; + $this->container['etf_company'] = $data['etf_company'] ?? null; + $this->container['domicile'] = $data['domicile'] ?? null; + $this->container['inception_date'] = $data['inception_date'] ?? null; + $this->container['website'] = $data['website'] ?? null; + $this->container['isin'] = $data['isin'] ?? null; + $this->container['cusip'] = $data['cusip'] ?? null; + $this->container['price_to_earnings'] = $data['price_to_earnings'] ?? null; + $this->container['price_to_book'] = $data['price_to_book'] ?? null; + $this->container['avg_volume'] = $data['avg_volume'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets asset_class + * + * @return string|null + */ + public function getAssetClass() + { + return $this->container['asset_class']; + } + + /** + * Sets asset_class + * + * @param string|null $asset_class Asset Class. + * + * @return self + */ + public function setAssetClass($asset_class) + { + $this->container['asset_class'] = $asset_class; + + return $this; + } + + /** + * Gets investment_segment + * + * @return string|null + */ + public function getInvestmentSegment() + { + return $this->container['investment_segment']; + } + + /** + * Sets investment_segment + * + * @param string|null $investment_segment Investment Segment. + * + * @return self + */ + public function setInvestmentSegment($investment_segment) + { + $this->container['investment_segment'] = $investment_segment; + + return $this; + } + + /** + * Gets aum + * + * @return float|null + */ + public function getAum() + { + return $this->container['aum']; + } + + /** + * Sets aum + * + * @param float|null $aum AUM. + * + * @return self + */ + public function setAum($aum) + { + $this->container['aum'] = $aum; + + return $this; + } + + /** + * Gets nav + * + * @return float|null + */ + public function getNav() + { + return $this->container['nav']; + } + + /** + * Sets nav + * + * @param float|null $nav NAV. + * + * @return self + */ + public function setNav($nav) + { + $this->container['nav'] = $nav; + + return $this; + } + + /** + * Gets nav_currency + * + * @return string|null + */ + public function getNavCurrency() + { + return $this->container['nav_currency']; + } + + /** + * Sets nav_currency + * + * @param string|null $nav_currency NAV currency. + * + * @return self + */ + public function setNavCurrency($nav_currency) + { + $this->container['nav_currency'] = $nav_currency; + + return $this; + } + + /** + * Gets expense_ratio + * + * @return float|null + */ + public function getExpenseRatio() + { + return $this->container['expense_ratio']; + } + + /** + * Sets expense_ratio + * + * @param float|null $expense_ratio Expense ratio. + * + * @return self + */ + public function setExpenseRatio($expense_ratio) + { + $this->container['expense_ratio'] = $expense_ratio; + + return $this; + } + + /** + * Gets tracking_index + * + * @return string|null + */ + public function getTrackingIndex() + { + return $this->container['tracking_index']; + } + + /** + * Sets tracking_index + * + * @param string|null $tracking_index Tracking Index. + * + * @return self + */ + public function setTrackingIndex($tracking_index) + { + $this->container['tracking_index'] = $tracking_index; + + return $this; + } + + /** + * Gets etf_company + * + * @return string|null + */ + public function getEtfCompany() + { + return $this->container['etf_company']; + } + + /** + * Sets etf_company + * + * @param string|null $etf_company ETF issuer. + * + * @return self + */ + public function setEtfCompany($etf_company) + { + $this->container['etf_company'] = $etf_company; + + return $this; + } + + /** + * Gets domicile + * + * @return string|null + */ + public function getDomicile() + { + return $this->container['domicile']; + } + + /** + * Sets domicile + * + * @param string|null $domicile ETF domicile. + * + * @return self + */ + public function setDomicile($domicile) + { + $this->container['domicile'] = $domicile; + + return $this; + } + + /** + * Gets inception_date + * + * @return \DateTime|null + */ + public function getInceptionDate() + { + return $this->container['inception_date']; + } + + /** + * Sets inception_date + * + * @param \DateTime|null $inception_date Inception date. + * + * @return self + */ + public function setInceptionDate($inception_date) + { + $this->container['inception_date'] = $inception_date; + + return $this; + } + + /** + * Gets website + * + * @return string|null + */ + public function getWebsite() + { + return $this->container['website']; + } + + /** + * Sets website + * + * @param string|null $website ETF's website. + * + * @return self + */ + public function setWebsite($website) + { + $this->container['website'] = $website; + + return $this; + } + + /** + * Gets isin + * + * @return string|null + */ + public function getIsin() + { + return $this->container['isin']; + } + + /** + * Sets isin + * + * @param string|null $isin ISIN. + * + * @return self + */ + public function setIsin($isin) + { + $this->container['isin'] = $isin; + + return $this; + } + + /** + * Gets cusip + * + * @return string|null + */ + public function getCusip() + { + return $this->container['cusip']; + } + + /** + * Sets cusip + * + * @param string|null $cusip CUSIP. + * + * @return self + */ + public function setCusip($cusip) + { + $this->container['cusip'] = $cusip; + + return $this; + } + + /** + * Gets price_to_earnings + * + * @return float|null + */ + public function getPriceToEarnings() + { + return $this->container['price_to_earnings']; + } + + /** + * Sets price_to_earnings + * + * @param float|null $price_to_earnings P/E. + * + * @return self + */ + public function setPriceToEarnings($price_to_earnings) + { + $this->container['price_to_earnings'] = $price_to_earnings; + + return $this; + } + + /** + * Gets price_to_book + * + * @return float|null + */ + public function getPriceToBook() + { + return $this->container['price_to_book']; + } + + /** + * Sets price_to_book + * + * @param float|null $price_to_book P/B. + * + * @return self + */ + public function setPriceToBook($price_to_book) + { + $this->container['price_to_book'] = $price_to_book; + + return $this; + } + + /** + * Gets avg_volume + * + * @return float|null + */ + public function getAvgVolume() + { + return $this->container['avg_volume']; + } + + /** + * Sets avg_volume + * + * @param float|null $avg_volume 30-day average volume. + * + * @return self + */ + public function setAvgVolume($avg_volume) + { + $this->container['avg_volume'] = $avg_volume; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description ETF's description. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ETFSectorExposureData.php b/lib/Model/ETFSectorExposureData.php new file mode 100644 index 0000000..4f1248e --- /dev/null +++ b/lib/Model/ETFSectorExposureData.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ETFSectorExposureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ETFSectorExposureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'industry' => 'string', + 'exposure' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'industry' => null, + 'exposure' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'industry' => 'industry', + 'exposure' => 'exposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'industry' => 'setIndustry', + 'exposure' => 'setExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'industry' => 'getIndustry', + 'exposure' => 'getExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['industry'] = $data['industry'] ?? null; + $this->container['exposure'] = $data['exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets industry + * + * @return string|null + */ + public function getIndustry() + { + return $this->container['industry']; + } + + /** + * Sets industry + * + * @param string|null $industry Industry + * + * @return self + */ + public function setIndustry($industry) + { + $this->container['industry'] = $industry; + + return $this; + } + + /** + * Gets exposure + * + * @return float|null + */ + public function getExposure() + { + return $this->container['exposure']; + } + + /** + * Sets exposure + * + * @param float|null $exposure Percent of exposure. + * + * @return self + */ + public function setExposure($exposure) + { + $this->container['exposure'] = $exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ETFsCountryExposure.php b/lib/Model/ETFsCountryExposure.php index 90232bd..dd1f703 100644 --- a/lib/Model/ETFsCountryExposure.php +++ b/lib/Model/ETFsCountryExposure.php @@ -2,7 +2,7 @@ /** * ETFsCountryExposure * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ETFsCountryExposure implements ModelInterface, ArrayAccess +class ETFsCountryExposure implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,17 +60,19 @@ class ETFsCountryExposure implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'symbol' => 'string', - 'holdings' => 'object[]' + 'country_exposure' => 'object[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, - 'holdings' => null + 'country_exposure' => null ]; /** @@ -99,7 +103,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'symbol' => 'symbol', - 'holdings' => 'holdings' + 'country_exposure' => 'countryExposure' ]; /** @@ -109,7 +113,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'symbol' => 'setSymbol', - 'holdings' => 'setHoldings' + 'country_exposure' => 'setCountryExposure' ]; /** @@ -119,7 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'symbol' => 'getSymbol', - 'holdings' => 'getHoldings' + 'country_exposure' => 'getCountryExposure' ]; /** @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['holdings'] = isset($data['holdings']) ? $data['holdings'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['country_exposure'] = $data['country_exposure'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol ETF symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -235,25 +236,25 @@ public function setSymbol($symbol) } /** - * Gets holdings + * Gets country_exposure * * @return object[]|null */ - public function getHoldings() + public function getCountryExposure() { - return $this->container['holdings']; + return $this->container['country_exposure']; } /** - * Sets holdings + * Sets country_exposure * - * @param object[]|null $holdings Array of countries and and exposure levels. + * @param object[]|null $country_exposure Array of countries and and exposure levels. * - * @return $this + * @return self */ - public function setHoldings($holdings) + public function setCountryExposure($country_exposure) { - $this->container['holdings'] = $holdings; + $this->container['country_exposure'] = $country_exposure; return $this; } @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/ETFsHoldings.php b/lib/Model/ETFsHoldings.php index 262e883..b57285d 100644 --- a/lib/Model/ETFsHoldings.php +++ b/lib/Model/ETFsHoldings.php @@ -2,7 +2,7 @@ /** * ETFsHoldings * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ETFsHoldings implements ModelInterface, ArrayAccess +class ETFsHoldings implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,6 +60,8 @@ class ETFsHoldings implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'symbol' => 'string', + 'at_date' => '\DateTime', + 'number_of_holdings' => 'int', 'holdings' => 'object[]' ]; @@ -65,9 +69,13 @@ class ETFsHoldings implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, + 'at_date' => 'date', + 'number_of_holdings' => 'int64', 'holdings' => null ]; @@ -99,6 +107,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'symbol' => 'symbol', + 'at_date' => 'atDate', + 'number_of_holdings' => 'numberOfHoldings', 'holdings' => 'holdings' ]; @@ -109,6 +119,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'symbol' => 'setSymbol', + 'at_date' => 'setAtDate', + 'number_of_holdings' => 'setNumberOfHoldings', 'holdings' => 'setHoldings' ]; @@ -119,6 +131,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'symbol' => 'getSymbol', + 'at_date' => 'getAtDate', + 'number_of_holdings' => 'getNumberOfHoldings', 'holdings' => 'getHoldings' ]; @@ -163,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['holdings'] = isset($data['holdings']) ? $data['holdings'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['at_date'] = $data['at_date'] ?? null; + $this->container['number_of_holdings'] = $data['number_of_holdings'] ?? null; + $this->container['holdings'] = $data['holdings'] ?? null; } /** @@ -225,7 +238,7 @@ public function getSymbol() * * @param string|null $symbol ETF symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -234,6 +247,54 @@ public function setSymbol($symbol) return $this; } + /** + * Gets at_date + * + * @return \DateTime|null + */ + public function getAtDate() + { + return $this->container['at_date']; + } + + /** + * Sets at_date + * + * @param \DateTime|null $at_date Holdings update date. + * + * @return self + */ + public function setAtDate($at_date) + { + $this->container['at_date'] = $at_date; + + return $this; + } + + /** + * Gets number_of_holdings + * + * @return int|null + */ + public function getNumberOfHoldings() + { + return $this->container['number_of_holdings']; + } + + /** + * Sets number_of_holdings + * + * @param int|null $number_of_holdings Number of holdings. + * + * @return self + */ + public function setNumberOfHoldings($number_of_holdings) + { + $this->container['number_of_holdings'] = $number_of_holdings; + + return $this; + } + /** * Gets holdings * @@ -249,7 +310,7 @@ public function getHoldings() * * @param object[]|null $holdings Array of holdings. * - * @return $this + * @return self */ public function setHoldings($holdings) { @@ -274,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/ETFsProfile.php b/lib/Model/ETFsProfile.php index 06efefd..d240977 100644 --- a/lib/Model/ETFsProfile.php +++ b/lib/Model/ETFsProfile.php @@ -2,7 +2,7 @@ /** * ETFsProfile * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ETFsProfile implements ModelInterface, ArrayAccess +class ETFsProfile implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,13 +60,15 @@ class ETFsProfile implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'symbol' => 'string', - 'profile' => 'object' + 'profile' => '\Finnhub\Model\ETFProfileData' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['profile'] = isset($data['profile']) ? $data['profile'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['profile'] = $data['profile'] ?? null; } /** @@ -223,9 +224,9 @@ public function getSymbol() /** * Sets symbol * - * @param string|null $symbol Use symbol returned in /forex/symbol endpoint for this field. + * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -237,7 +238,7 @@ public function setSymbol($symbol) /** * Gets profile * - * @return object|null + * @return \Finnhub\Model\ETFProfileData|null */ public function getProfile() { @@ -247,9 +248,9 @@ public function getProfile() /** * Sets profile * - * @param object|null $profile profile + * @param \Finnhub\Model\ETFProfileData|null $profile profile * - * @return $this + * @return self */ public function setProfile($profile) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/ETFsSectorExposure.php b/lib/Model/ETFsSectorExposure.php new file mode 100644 index 0000000..f9c1e09 --- /dev/null +++ b/lib/Model/ETFsSectorExposure.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ETFsSectorExposure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ETFsSectorExposure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'sector_exposure' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'sector_exposure' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'sector_exposure' => 'sectorExposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'sector_exposure' => 'setSectorExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'sector_exposure' => 'getSectorExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['sector_exposure'] = $data['sector_exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol ETF symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets sector_exposure + * + * @return object[]|null + */ + public function getSectorExposure() + { + return $this->container['sector_exposure']; + } + + /** + * Sets sector_exposure + * + * @param object[]|null $sector_exposure Array of industries and exposure levels. + * + * @return self + */ + public function setSectorExposure($sector_exposure) + { + $this->container['sector_exposure'] = $sector_exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EarningEstimate.php b/lib/Model/EarningEstimate.php index 678a92f..df26627 100644 --- a/lib/Model/EarningEstimate.php +++ b/lib/Model/EarningEstimate.php @@ -2,7 +2,7 @@ /** * EarningEstimate * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningEstimate implements ModelInterface, ArrayAccess +class EarningEstimate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +70,8 @@ class EarningEstimate implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'eps_avg' => 'float', @@ -178,9 +182,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +198,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['eps_avg'] = isset($data['eps_avg']) ? $data['eps_avg'] : null; - $this->container['eps_high'] = isset($data['eps_high']) ? $data['eps_high'] : null; - $this->container['eps_low'] = isset($data['eps_low']) ? $data['eps_low'] : null; - $this->container['number_analysts'] = isset($data['number_analysts']) ? $data['number_analysts'] : null; - $this->container['period'] = isset($data['period']) ? $data['period'] : null; + $this->container['eps_avg'] = $data['eps_avg'] ?? null; + $this->container['eps_high'] = $data['eps_high'] ?? null; + $this->container['eps_low'] = $data['eps_low'] ?? null; + $this->container['number_analysts'] = $data['number_analysts'] ?? null; + $this->container['period'] = $data['period'] ?? null; } /** @@ -241,9 +242,9 @@ public function getEpsAvg() /** * Sets eps_avg * - * @param float|null $eps_avg Average EPS estimates. + * @param float|null $eps_avg Average EPS estimates including Finnhub's proprietary estimates. * - * @return $this + * @return self */ public function setEpsAvg($eps_avg) { @@ -267,7 +268,7 @@ public function getEpsHigh() * * @param float|null $eps_high Highest estimate. * - * @return $this + * @return self */ public function setEpsHigh($eps_high) { @@ -291,7 +292,7 @@ public function getEpsLow() * * @param float|null $eps_low Lowest estimate. * - * @return $this + * @return self */ public function setEpsLow($eps_low) { @@ -315,7 +316,7 @@ public function getNumberAnalysts() * * @param int|null $number_analysts Number of Analysts. * - * @return $this + * @return self */ public function setNumberAnalysts($number_analysts) { @@ -339,7 +340,7 @@ public function getPeriod() * * @param \DateTime|null $period Period. * - * @return $this + * @return self */ public function setPeriod($period) { @@ -364,18 +365,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +401,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningRelease.php b/lib/Model/EarningRelease.php index 478cfab..964d7c2 100644 --- a/lib/Model/EarningRelease.php +++ b/lib/Model/EarningRelease.php @@ -2,7 +2,7 @@ /** * EarningRelease * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningRelease implements ModelInterface, ArrayAccess +class EarningRelease implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -72,6 +74,8 @@ class EarningRelease implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -198,9 +202,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -217,15 +218,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['hour'] = isset($data['hour']) ? $data['hour'] : null; - $this->container['year'] = isset($data['year']) ? $data['year'] : null; - $this->container['quarter'] = isset($data['quarter']) ? $data['quarter'] : null; - $this->container['eps_estimate'] = isset($data['eps_estimate']) ? $data['eps_estimate'] : null; - $this->container['eps_actual'] = isset($data['eps_actual']) ? $data['eps_actual'] : null; - $this->container['revenue_estimate'] = isset($data['revenue_estimate']) ? $data['revenue_estimate'] : null; - $this->container['revenue_actual'] = isset($data['revenue_actual']) ? $data['revenue_actual'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['date'] = $data['date'] ?? null; + $this->container['hour'] = $data['hour'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; + $this->container['eps_estimate'] = $data['eps_estimate'] ?? null; + $this->container['eps_actual'] = $data['eps_actual'] ?? null; + $this->container['revenue_estimate'] = $data['revenue_estimate'] ?? null; + $this->container['revenue_actual'] = $data['revenue_actual'] ?? null; } /** @@ -267,7 +268,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -291,7 +292,7 @@ public function getDate() * * @param \DateTime|null $date Date. * - * @return $this + * @return self */ public function setDate($date) { @@ -315,7 +316,7 @@ public function getHour() * * @param string|null $hour Indicates whether the earnings is announced before market open(bmo), after market close(amc), or during market hour(dmh). * - * @return $this + * @return self */ public function setHour($hour) { @@ -339,7 +340,7 @@ public function getYear() * * @param int|null $year Earnings year. * - * @return $this + * @return self */ public function setYear($year) { @@ -363,7 +364,7 @@ public function getQuarter() * * @param int|null $quarter Earnings quarter. * - * @return $this + * @return self */ public function setQuarter($quarter) { @@ -387,7 +388,7 @@ public function getEpsEstimate() * * @param float|null $eps_estimate EPS estimate. * - * @return $this + * @return self */ public function setEpsEstimate($eps_estimate) { @@ -411,7 +412,7 @@ public function getEpsActual() * * @param float|null $eps_actual EPS actual. * - * @return $this + * @return self */ public function setEpsActual($eps_actual) { @@ -433,9 +434,9 @@ public function getRevenueEstimate() /** * Sets revenue_estimate * - * @param int|null $revenue_estimate Revenue estimate. + * @param int|null $revenue_estimate Revenue estimate including Finnhub's proprietary estimates. * - * @return $this + * @return self */ public function setRevenueEstimate($revenue_estimate) { @@ -459,7 +460,7 @@ public function getRevenueActual() * * @param int|null $revenue_actual Revenue actual. * - * @return $this + * @return self */ public function setRevenueActual($revenue_actual) { @@ -484,18 +485,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -520,6 +521,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningResult.php b/lib/Model/EarningResult.php index 2802bc9..bc2770f 100644 --- a/lib/Model/EarningResult.php +++ b/lib/Model/EarningResult.php @@ -2,7 +2,7 @@ /** * EarningResult * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningResult implements ModelInterface, ArrayAccess +class EarningResult implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -59,6 +61,8 @@ class EarningResult implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'actual' => 'float', 'estimate' => 'float', + 'surprise' => 'float', + 'surprise_percent' => 'float', 'period' => '\DateTime', 'symbol' => 'string' ]; @@ -67,10 +71,14 @@ class EarningResult implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'actual' => 'float', 'estimate' => 'float', + 'surprise' => 'float', + 'surprise_percent' => 'float', 'period' => 'date', 'symbol' => null ]; @@ -104,6 +112,8 @@ public static function openAPIFormats() protected static $attributeMap = [ 'actual' => 'actual', 'estimate' => 'estimate', + 'surprise' => 'surprise', + 'surprise_percent' => 'surprisePercent', 'period' => 'period', 'symbol' => 'symbol' ]; @@ -116,6 +126,8 @@ public static function openAPIFormats() protected static $setters = [ 'actual' => 'setActual', 'estimate' => 'setEstimate', + 'surprise' => 'setSurprise', + 'surprise_percent' => 'setSurprisePercent', 'period' => 'setPeriod', 'symbol' => 'setSymbol' ]; @@ -128,6 +140,8 @@ public static function openAPIFormats() protected static $getters = [ 'actual' => 'getActual', 'estimate' => 'getEstimate', + 'surprise' => 'getSurprise', + 'surprise_percent' => 'getSurprisePercent', 'period' => 'getPeriod', 'symbol' => 'getSymbol' ]; @@ -173,9 +187,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +203,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['actual'] = isset($data['actual']) ? $data['actual'] : null; - $this->container['estimate'] = isset($data['estimate']) ? $data['estimate'] : null; - $this->container['period'] = isset($data['period']) ? $data['period'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['actual'] = $data['actual'] ?? null; + $this->container['estimate'] = $data['estimate'] ?? null; + $this->container['surprise'] = $data['surprise'] ?? null; + $this->container['surprise_percent'] = $data['surprise_percent'] ?? null; + $this->container['period'] = $data['period'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -237,7 +250,7 @@ public function getActual() * * @param float|null $actual Actual earning result. * - * @return $this + * @return self */ public function setActual($actual) { @@ -261,7 +274,7 @@ public function getEstimate() * * @param float|null $estimate Estimated earning. * - * @return $this + * @return self */ public function setEstimate($estimate) { @@ -270,6 +283,54 @@ public function setEstimate($estimate) return $this; } + /** + * Gets surprise + * + * @return float|null + */ + public function getSurprise() + { + return $this->container['surprise']; + } + + /** + * Sets surprise + * + * @param float|null $surprise Surprise - The difference between actual and estimate. + * + * @return self + */ + public function setSurprise($surprise) + { + $this->container['surprise'] = $surprise; + + return $this; + } + + /** + * Gets surprise_percent + * + * @return float|null + */ + public function getSurprisePercent() + { + return $this->container['surprise_percent']; + } + + /** + * Sets surprise_percent + * + * @param float|null $surprise_percent Surprise percent. + * + * @return self + */ + public function setSurprisePercent($surprise_percent) + { + $this->container['surprise_percent'] = $surprise_percent; + + return $this; + } + /** * Gets period * @@ -285,7 +346,7 @@ public function getPeriod() * * @param \DateTime|null $period Reported period. * - * @return $this + * @return self */ public function setPeriod($period) { @@ -309,7 +370,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -334,18 +395,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +431,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningsCalendar.php b/lib/Model/EarningsCalendar.php index e79b5ae..23e88f3 100644 --- a/lib/Model/EarningsCalendar.php +++ b/lib/Model/EarningsCalendar.php @@ -2,7 +2,7 @@ /** * EarningsCalendar * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningsCalendar implements ModelInterface, ArrayAccess +class EarningsCalendar implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,6 +66,8 @@ class EarningsCalendar implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'earnings_calendar' => null @@ -158,9 +162,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['earnings_calendar'] = isset($data['earnings_calendar']) ? $data['earnings_calendar'] : null; + $this->container['earnings_calendar'] = $data['earnings_calendar'] ?? null; } /** @@ -219,7 +220,7 @@ public function getEarningsCalendar() * * @param object[]|null $earnings_calendar Array of earnings release. * - * @return $this + * @return self */ public function setEarningsCalendar($earnings_calendar) { @@ -244,18 +245,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -280,6 +281,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningsCallTranscripts.php b/lib/Model/EarningsCallTranscripts.php index 034d503..5a89a08 100644 --- a/lib/Model/EarningsCallTranscripts.php +++ b/lib/Model/EarningsCallTranscripts.php @@ -2,7 +2,7 @@ /** * EarningsCallTranscripts * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningsCallTranscripts implements ModelInterface, ArrayAccess +class EarningsCallTranscripts implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -72,6 +74,8 @@ class EarningsCallTranscripts implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -198,9 +202,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -217,15 +218,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['transcript'] = isset($data['transcript']) ? $data['transcript'] : null; - $this->container['participant'] = isset($data['participant']) ? $data['participant'] : null; - $this->container['audio'] = isset($data['audio']) ? $data['audio'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['year'] = isset($data['year']) ? $data['year'] : null; - $this->container['quarter'] = isset($data['quarter']) ? $data['quarter'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['transcript'] = $data['transcript'] ?? null; + $this->container['participant'] = $data['participant'] ?? null; + $this->container['audio'] = $data['audio'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['time'] = $data['time'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -267,7 +268,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -291,7 +292,7 @@ public function getTranscript() * * @param object[]|null $transcript Transcript content. * - * @return $this + * @return self */ public function setTranscript($transcript) { @@ -315,7 +316,7 @@ public function getParticipant() * * @param object[]|null $participant Participant list * - * @return $this + * @return self */ public function setParticipant($participant) { @@ -339,7 +340,7 @@ public function getAudio() * * @param string|null $audio Audio link. * - * @return $this + * @return self */ public function setAudio($audio) { @@ -363,7 +364,7 @@ public function getId() * * @param string|null $id Transcript's ID. * - * @return $this + * @return self */ public function setId($id) { @@ -387,7 +388,7 @@ public function getTitle() * * @param string|null $title Title. * - * @return $this + * @return self */ public function setTitle($title) { @@ -411,7 +412,7 @@ public function getTime() * * @param \DateTime|null $time Time of the event. * - * @return $this + * @return self */ public function setTime($time) { @@ -435,7 +436,7 @@ public function getYear() * * @param int|null $year Year of earnings result in the case of earnings call transcript. * - * @return $this + * @return self */ public function setYear($year) { @@ -459,7 +460,7 @@ public function getQuarter() * * @param int|null $quarter Quarter of earnings result in the case of earnings call transcript. * - * @return $this + * @return self */ public function setQuarter($quarter) { @@ -484,18 +485,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -520,6 +521,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningsCallTranscriptsList.php b/lib/Model/EarningsCallTranscriptsList.php index cba93e2..8a6e142 100644 --- a/lib/Model/EarningsCallTranscriptsList.php +++ b/lib/Model/EarningsCallTranscriptsList.php @@ -2,7 +2,7 @@ /** * EarningsCallTranscriptsList * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningsCallTranscriptsList implements ModelInterface, ArrayAccess +class EarningsCallTranscriptsList implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class EarningsCallTranscriptsList implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['transcripts'] = isset($data['transcripts']) ? $data['transcripts'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['transcripts'] = $data['transcripts'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getTranscripts() * * @param object[]|null $transcripts Array of transcripts' metadata * - * @return $this + * @return self */ public function setTranscripts($transcripts) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EarningsEstimates.php b/lib/Model/EarningsEstimates.php index bf9a1fb..4eb6d11 100644 --- a/lib/Model/EarningsEstimates.php +++ b/lib/Model/EarningsEstimates.php @@ -2,7 +2,7 @@ /** * EarningsEstimates * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EarningsEstimates implements ModelInterface, ArrayAccess +class EarningsEstimates implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class EarningsEstimates implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'data' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['freq'] = isset($data['freq']) ? $data['freq'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['data'] = $data['data'] ?? null; + $this->container['freq'] = $data['freq'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -231,7 +232,7 @@ public function getData() * * @param object[]|null $data List of estimates * - * @return $this + * @return self */ public function setData($data) { @@ -255,7 +256,7 @@ public function getFreq() * * @param string|null $freq Frequency: annual or quarterly. * - * @return $this + * @return self */ public function setFreq($freq) { @@ -279,7 +280,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EconomicCalendar.php b/lib/Model/EconomicCalendar.php index 3768696..6a02fab 100644 --- a/lib/Model/EconomicCalendar.php +++ b/lib/Model/EconomicCalendar.php @@ -2,7 +2,7 @@ /** * EconomicCalendar * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EconomicCalendar implements ModelInterface, ArrayAccess +class EconomicCalendar implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,6 +66,8 @@ class EconomicCalendar implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'economic_calendar' => null @@ -158,9 +162,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['economic_calendar'] = isset($data['economic_calendar']) ? $data['economic_calendar'] : null; + $this->container['economic_calendar'] = $data['economic_calendar'] ?? null; } /** @@ -219,7 +220,7 @@ public function getEconomicCalendar() * * @param object[]|null $economic_calendar Array of economic events. * - * @return $this + * @return self */ public function setEconomicCalendar($economic_calendar) { @@ -244,18 +245,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -280,6 +281,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EconomicCode.php b/lib/Model/EconomicCode.php index ace5e7c..ed06ce7 100644 --- a/lib/Model/EconomicCode.php +++ b/lib/Model/EconomicCode.php @@ -2,7 +2,7 @@ /** * EconomicCode * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EconomicCode implements ModelInterface, ArrayAccess +class EconomicCode implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +69,8 @@ class EconomicCode implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'code' => null, @@ -173,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['unit'] = isset($data['unit']) ? $data['unit'] : null; + $this->container['code'] = $data['code'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; } /** @@ -237,7 +238,7 @@ public function getCode() * * @param string|null $code Finnhub economic code used to get historical data * - * @return $this + * @return self */ public function setCode($code) { @@ -261,7 +262,7 @@ public function getCountry() * * @param string|null $country Country * - * @return $this + * @return self */ public function setCountry($country) { @@ -285,7 +286,7 @@ public function getName() * * @param string|null $name Indicator name * - * @return $this + * @return self */ public function setName($name) { @@ -309,7 +310,7 @@ public function getUnit() * * @param string|null $unit Unit * - * @return $this + * @return self */ public function setUnit($unit) { @@ -334,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EconomicData.php b/lib/Model/EconomicData.php index c5b2b80..6634b3a 100644 --- a/lib/Model/EconomicData.php +++ b/lib/Model/EconomicData.php @@ -2,7 +2,7 @@ /** * EconomicData * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EconomicData implements ModelInterface, ArrayAccess +class EconomicData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class EconomicData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'data' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['data'] = $data['data'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -225,7 +226,7 @@ public function getData() * * @param object[]|null $data Array of economic data for requested code. * - * @return $this + * @return self */ public function setData($data) { @@ -249,7 +250,7 @@ public function getCode() * * @param string|null $code Finnhub economic code * - * @return $this + * @return self */ public function setCode($code) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/EconomicEvent.php b/lib/Model/EconomicEvent.php index d2f91c6..5237275 100644 --- a/lib/Model/EconomicEvent.php +++ b/lib/Model/EconomicEvent.php @@ -2,7 +2,7 @@ /** * EconomicEvent * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class EconomicEvent implements ModelInterface, ArrayAccess +class EconomicEvent implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +73,8 @@ class EconomicEvent implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'actual' => 'float', @@ -193,9 +197,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -212,14 +213,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['actual'] = isset($data['actual']) ? $data['actual'] : null; - $this->container['prev'] = isset($data['prev']) ? $data['prev'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['unit'] = isset($data['unit']) ? $data['unit'] : null; - $this->container['estimate'] = isset($data['estimate']) ? $data['estimate'] : null; - $this->container['event'] = isset($data['event']) ? $data['event'] : null; - $this->container['impact'] = isset($data['impact']) ? $data['impact'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['actual'] = $data['actual'] ?? null; + $this->container['prev'] = $data['prev'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['estimate'] = $data['estimate'] ?? null; + $this->container['event'] = $data['event'] ?? null; + $this->container['impact'] = $data['impact'] ?? null; + $this->container['time'] = $data['time'] ?? null; } /** @@ -261,7 +262,7 @@ public function getActual() * * @param float|null $actual Actual release * - * @return $this + * @return self */ public function setActual($actual) { @@ -285,7 +286,7 @@ public function getPrev() * * @param float|null $prev Previous release * - * @return $this + * @return self */ public function setPrev($prev) { @@ -309,7 +310,7 @@ public function getCountry() * * @param string|null $country Country * - * @return $this + * @return self */ public function setCountry($country) { @@ -333,7 +334,7 @@ public function getUnit() * * @param string|null $unit Unit * - * @return $this + * @return self */ public function setUnit($unit) { @@ -357,7 +358,7 @@ public function getEstimate() * * @param float|null $estimate Estimate * - * @return $this + * @return self */ public function setEstimate($estimate) { @@ -381,7 +382,7 @@ public function getEvent() * * @param string|null $event Event * - * @return $this + * @return self */ public function setEvent($event) { @@ -405,7 +406,7 @@ public function getImpact() * * @param string|null $impact Impact level * - * @return $this + * @return self */ public function setImpact($impact) { @@ -429,7 +430,7 @@ public function getTime() * * @param string|null $time Release time * - * @return $this + * @return self */ public function setTime($time) { @@ -454,18 +455,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -490,6 +491,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Estimate.php b/lib/Model/Estimate.php index 1d7a07b..ebc5d82 100644 --- a/lib/Model/Estimate.php +++ b/lib/Model/Estimate.php @@ -2,7 +2,7 @@ /** * Estimate * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Estimate implements ModelInterface, ArrayAccess +class Estimate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +70,8 @@ class Estimate implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'revenue_avg' => 'int64', @@ -178,9 +182,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +198,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['revenue_avg'] = isset($data['revenue_avg']) ? $data['revenue_avg'] : null; - $this->container['revenue_high'] = isset($data['revenue_high']) ? $data['revenue_high'] : null; - $this->container['revenue_low'] = isset($data['revenue_low']) ? $data['revenue_low'] : null; - $this->container['number_analysts'] = isset($data['number_analysts']) ? $data['number_analysts'] : null; - $this->container['period'] = isset($data['period']) ? $data['period'] : null; + $this->container['revenue_avg'] = $data['revenue_avg'] ?? null; + $this->container['revenue_high'] = $data['revenue_high'] ?? null; + $this->container['revenue_low'] = $data['revenue_low'] ?? null; + $this->container['number_analysts'] = $data['number_analysts'] ?? null; + $this->container['period'] = $data['period'] ?? null; } /** @@ -241,9 +242,9 @@ public function getRevenueAvg() /** * Sets revenue_avg * - * @param int|null $revenue_avg Average revenue estimates. + * @param int|null $revenue_avg Average revenue estimates including Finnhub's proprietary estimates. * - * @return $this + * @return self */ public function setRevenueAvg($revenue_avg) { @@ -267,7 +268,7 @@ public function getRevenueHigh() * * @param int|null $revenue_high Highest estimate. * - * @return $this + * @return self */ public function setRevenueHigh($revenue_high) { @@ -291,7 +292,7 @@ public function getRevenueLow() * * @param int|null $revenue_low Lowest estimate. * - * @return $this + * @return self */ public function setRevenueLow($revenue_low) { @@ -315,7 +316,7 @@ public function getNumberAnalysts() * * @param int|null $number_analysts Number of Analysts. * - * @return $this + * @return self */ public function setNumberAnalysts($number_analysts) { @@ -339,7 +340,7 @@ public function getPeriod() * * @param \DateTime|null $period Period. * - * @return $this + * @return self */ public function setPeriod($period) { @@ -364,18 +365,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +401,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/FDAComitteeMeeting.php b/lib/Model/FDAComitteeMeeting.php new file mode 100644 index 0000000..41b93b7 --- /dev/null +++ b/lib/Model/FDAComitteeMeeting.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FDAComitteeMeeting implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FDAComitteeMeeting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from_date' => '\DateTime', + 'to_date' => '\DateTime', + 'event_description' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_date' => 'date-time', + 'to_date' => 'date-time', + 'event_description' => null, + 'url' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_date' => 'fromDate', + 'to_date' => 'toDate', + 'event_description' => 'eventDescription', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_date' => 'setFromDate', + 'to_date' => 'setToDate', + 'event_description' => 'setEventDescription', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_date' => 'getFromDate', + 'to_date' => 'getToDate', + 'event_description' => 'getEventDescription', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['from_date'] = $data['from_date'] ?? null; + $this->container['to_date'] = $data['to_date'] ?? null; + $this->container['event_description'] = $data['event_description'] ?? null; + $this->container['url'] = $data['url'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from_date + * + * @return \DateTime|null + */ + public function getFromDate() + { + return $this->container['from_date']; + } + + /** + * Sets from_date + * + * @param \DateTime|null $from_date Start time of the event in EST. + * + * @return self + */ + public function setFromDate($from_date) + { + $this->container['from_date'] = $from_date; + + return $this; + } + + /** + * Gets to_date + * + * @return \DateTime|null + */ + public function getToDate() + { + return $this->container['to_date']; + } + + /** + * Sets to_date + * + * @param \DateTime|null $to_date End time of the event in EST. + * + * @return self + */ + public function setToDate($to_date) + { + $this->container['to_date'] = $to_date; + + return $this; + } + + /** + * Gets event_description + * + * @return string|null + */ + public function getEventDescription() + { + return $this->container['event_description']; + } + + /** + * Sets event_description + * + * @param string|null $event_description Event's description. + * + * @return self + */ + public function setEventDescription($event_description) + { + $this->container['event_description'] = $event_description; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url URL. + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Filing.php b/lib/Model/Filing.php index 979f9f9..c112eb3 100644 --- a/lib/Model/Filing.php +++ b/lib/Model/Filing.php @@ -2,7 +2,7 @@ /** * Filing * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Filing implements ModelInterface, ArrayAccess +class Filing implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +73,8 @@ class Filing implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'access_number' => null, @@ -193,9 +197,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -212,14 +213,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['access_number'] = isset($data['access_number']) ? $data['access_number'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['cik'] = isset($data['cik']) ? $data['cik'] : null; - $this->container['form'] = isset($data['form']) ? $data['form'] : null; - $this->container['filed_date'] = isset($data['filed_date']) ? $data['filed_date'] : null; - $this->container['accepted_date'] = isset($data['accepted_date']) ? $data['accepted_date'] : null; - $this->container['report_url'] = isset($data['report_url']) ? $data['report_url'] : null; - $this->container['filing_url'] = isset($data['filing_url']) ? $data['filing_url'] : null; + $this->container['access_number'] = $data['access_number'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['form'] = $data['form'] ?? null; + $this->container['filed_date'] = $data['filed_date'] ?? null; + $this->container['accepted_date'] = $data['accepted_date'] ?? null; + $this->container['report_url'] = $data['report_url'] ?? null; + $this->container['filing_url'] = $data['filing_url'] ?? null; } /** @@ -261,7 +262,7 @@ public function getAccessNumber() * * @param string|null $access_number Access number. * - * @return $this + * @return self */ public function setAccessNumber($access_number) { @@ -285,7 +286,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -309,7 +310,7 @@ public function getCik() * * @param string|null $cik CIK. * - * @return $this + * @return self */ public function setCik($cik) { @@ -333,7 +334,7 @@ public function getForm() * * @param string|null $form Form type. * - * @return $this + * @return self */ public function setForm($form) { @@ -357,7 +358,7 @@ public function getFiledDate() * * @param \DateTime|null $filed_date Filed date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setFiledDate($filed_date) { @@ -381,7 +382,7 @@ public function getAcceptedDate() * * @param \DateTime|null $accepted_date Accepted date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setAcceptedDate($accepted_date) { @@ -405,7 +406,7 @@ public function getReportUrl() * * @param string|null $report_url Report's URL. * - * @return $this + * @return self */ public function setReportUrl($report_url) { @@ -429,7 +430,7 @@ public function getFilingUrl() * * @param string|null $filing_url Filing's URL. * - * @return $this + * @return self */ public function setFilingUrl($filing_url) { @@ -454,18 +455,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -490,6 +491,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/FilingSentiment.php b/lib/Model/FilingSentiment.php new file mode 100644 index 0000000..63465fb --- /dev/null +++ b/lib/Model/FilingSentiment.php @@ -0,0 +1,560 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FilingSentiment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FilingSentiment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negative' => 'float', + 'positive' => 'float', + 'polarity' => 'float', + 'litigious' => 'float', + 'uncertainty' => 'float', + 'constraining' => 'float', + 'modal_weak' => 'float', + 'modal_strong' => 'float', + 'modal_moderate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negative' => 'float', + 'positive' => 'float', + 'polarity' => 'float', + 'litigious' => 'float', + 'uncertainty' => 'float', + 'constraining' => 'float', + 'modal_weak' => 'float', + 'modal_strong' => 'float', + 'modal_moderate' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negative' => 'negative', + 'positive' => 'positive', + 'polarity' => 'polarity', + 'litigious' => 'litigious', + 'uncertainty' => 'uncertainty', + 'constraining' => 'constraining', + 'modal_weak' => 'modal-weak', + 'modal_strong' => 'modal-strong', + 'modal_moderate' => 'modal-moderate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negative' => 'setNegative', + 'positive' => 'setPositive', + 'polarity' => 'setPolarity', + 'litigious' => 'setLitigious', + 'uncertainty' => 'setUncertainty', + 'constraining' => 'setConstraining', + 'modal_weak' => 'setModalWeak', + 'modal_strong' => 'setModalStrong', + 'modal_moderate' => 'setModalModerate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negative' => 'getNegative', + 'positive' => 'getPositive', + 'polarity' => 'getPolarity', + 'litigious' => 'getLitigious', + 'uncertainty' => 'getUncertainty', + 'constraining' => 'getConstraining', + 'modal_weak' => 'getModalWeak', + 'modal_strong' => 'getModalStrong', + 'modal_moderate' => 'getModalModerate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['negative'] = $data['negative'] ?? null; + $this->container['positive'] = $data['positive'] ?? null; + $this->container['polarity'] = $data['polarity'] ?? null; + $this->container['litigious'] = $data['litigious'] ?? null; + $this->container['uncertainty'] = $data['uncertainty'] ?? null; + $this->container['constraining'] = $data['constraining'] ?? null; + $this->container['modal_weak'] = $data['modal_weak'] ?? null; + $this->container['modal_strong'] = $data['modal_strong'] ?? null; + $this->container['modal_moderate'] = $data['modal_moderate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negative + * + * @return float|null + */ + public function getNegative() + { + return $this->container['negative']; + } + + /** + * Sets negative + * + * @param float|null $negative % of negative words in the filing. + * + * @return self + */ + public function setNegative($negative) + { + $this->container['negative'] = $negative; + + return $this; + } + + /** + * Gets positive + * + * @return float|null + */ + public function getPositive() + { + return $this->container['positive']; + } + + /** + * Sets positive + * + * @param float|null $positive % of positive words in the filing. + * + * @return self + */ + public function setPositive($positive) + { + $this->container['positive'] = $positive; + + return $this; + } + + /** + * Gets polarity + * + * @return float|null + */ + public function getPolarity() + { + return $this->container['polarity']; + } + + /** + * Sets polarity + * + * @param float|null $polarity % of polarity words in the filing. + * + * @return self + */ + public function setPolarity($polarity) + { + $this->container['polarity'] = $polarity; + + return $this; + } + + /** + * Gets litigious + * + * @return float|null + */ + public function getLitigious() + { + return $this->container['litigious']; + } + + /** + * Sets litigious + * + * @param float|null $litigious % of litigious words in the filing. + * + * @return self + */ + public function setLitigious($litigious) + { + $this->container['litigious'] = $litigious; + + return $this; + } + + /** + * Gets uncertainty + * + * @return float|null + */ + public function getUncertainty() + { + return $this->container['uncertainty']; + } + + /** + * Sets uncertainty + * + * @param float|null $uncertainty % of uncertainty words in the filing. + * + * @return self + */ + public function setUncertainty($uncertainty) + { + $this->container['uncertainty'] = $uncertainty; + + return $this; + } + + /** + * Gets constraining + * + * @return float|null + */ + public function getConstraining() + { + return $this->container['constraining']; + } + + /** + * Sets constraining + * + * @param float|null $constraining % of constraining words in the filing. + * + * @return self + */ + public function setConstraining($constraining) + { + $this->container['constraining'] = $constraining; + + return $this; + } + + /** + * Gets modal_weak + * + * @return float|null + */ + public function getModalWeak() + { + return $this->container['modal_weak']; + } + + /** + * Sets modal_weak + * + * @param float|null $modal_weak % of modal-weak words in the filing. + * + * @return self + */ + public function setModalWeak($modal_weak) + { + $this->container['modal_weak'] = $modal_weak; + + return $this; + } + + /** + * Gets modal_strong + * + * @return float|null + */ + public function getModalStrong() + { + return $this->container['modal_strong']; + } + + /** + * Sets modal_strong + * + * @param float|null $modal_strong % of modal-strong words in the filing. + * + * @return self + */ + public function setModalStrong($modal_strong) + { + $this->container['modal_strong'] = $modal_strong; + + return $this; + } + + /** + * Gets modal_moderate + * + * @return float|null + */ + public function getModalModerate() + { + return $this->container['modal_moderate']; + } + + /** + * Sets modal_moderate + * + * @param float|null $modal_moderate % of modal-moderate words in the filing. + * + * @return self + */ + public function setModalModerate($modal_moderate) + { + $this->container['modal_moderate'] = $modal_moderate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FinancialStatements.php b/lib/Model/FinancialStatements.php index 9e9c069..e55c039 100644 --- a/lib/Model/FinancialStatements.php +++ b/lib/Model/FinancialStatements.php @@ -2,7 +2,7 @@ /** * FinancialStatements * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class FinancialStatements implements ModelInterface, ArrayAccess +class FinancialStatements implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class FinancialStatements implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['financials'] = isset($data['financials']) ? $data['financials'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['financials'] = $data['financials'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Symbol of the company. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getFinancials() * * @param object[]|null $financials An array of map of key, value pairs containing the data for each period. * - * @return $this + * @return self */ public function setFinancials($financials) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/FinancialsAsReported.php b/lib/Model/FinancialsAsReported.php index 65c61fe..0afc94f 100644 --- a/lib/Model/FinancialsAsReported.php +++ b/lib/Model/FinancialsAsReported.php @@ -2,7 +2,7 @@ /** * FinancialsAsReported * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class FinancialsAsReported implements ModelInterface, ArrayAccess +class FinancialsAsReported implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class FinancialsAsReported implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['cik'] = isset($data['cik']) ? $data['cik'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['data'] = $data['data'] ?? null; } /** @@ -231,7 +232,7 @@ public function getSymbol() * * @param string|null $symbol Symbol * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -255,7 +256,7 @@ public function getCik() * * @param string|null $cik CIK * - * @return $this + * @return self */ public function setCik($cik) { @@ -279,7 +280,7 @@ public function getData() * * @param object[]|null $data Array of filings. * - * @return $this + * @return self */ public function setData($data) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/ForexCandles.php b/lib/Model/ForexCandles.php index aaa758d..edee69c 100644 --- a/lib/Model/ForexCandles.php +++ b/lib/Model/ForexCandles.php @@ -2,7 +2,7 @@ /** * ForexCandles * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ForexCandles implements ModelInterface, ArrayAccess +class ForexCandles implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +72,8 @@ class ForexCandles implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'o' => 'float', @@ -188,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -207,13 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['o'] = isset($data['o']) ? $data['o'] : null; - $this->container['h'] = isset($data['h']) ? $data['h'] : null; - $this->container['l'] = isset($data['l']) ? $data['l'] : null; - $this->container['c'] = isset($data['c']) ? $data['c'] : null; - $this->container['v'] = isset($data['v']) ? $data['v'] : null; - $this->container['t'] = isset($data['t']) ? $data['t'] : null; - $this->container['s'] = isset($data['s']) ? $data['s'] : null; + $this->container['o'] = $data['o'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['l'] = $data['l'] ?? null; + $this->container['c'] = $data['c'] ?? null; + $this->container['v'] = $data['v'] ?? null; + $this->container['t'] = $data['t'] ?? null; + $this->container['s'] = $data['s'] ?? null; } /** @@ -255,7 +256,7 @@ public function getO() * * @param float[]|null $o List of open prices for returned candles. * - * @return $this + * @return self */ public function setO($o) { @@ -279,7 +280,7 @@ public function getH() * * @param float[]|null $h List of high prices for returned candles. * - * @return $this + * @return self */ public function setH($h) { @@ -303,7 +304,7 @@ public function getL() * * @param float[]|null $l List of low prices for returned candles. * - * @return $this + * @return self */ public function setL($l) { @@ -327,7 +328,7 @@ public function getC() * * @param float[]|null $c List of close prices for returned candles. * - * @return $this + * @return self */ public function setC($c) { @@ -351,7 +352,7 @@ public function getV() * * @param float[]|null $v List of volume data for returned candles. * - * @return $this + * @return self */ public function setV($v) { @@ -375,7 +376,7 @@ public function getT() * * @param float[]|null $t List of timestamp for returned candles. * - * @return $this + * @return self */ public function setT($t) { @@ -399,7 +400,7 @@ public function getS() * * @param string|null $s Status of the response. This field can either be ok or no_data. * - * @return $this + * @return self */ public function setS($s) { @@ -424,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -460,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/ForexSymbol.php b/lib/Model/ForexSymbol.php index a719bde..765d1a2 100644 --- a/lib/Model/ForexSymbol.php +++ b/lib/Model/ForexSymbol.php @@ -2,7 +2,7 @@ /** * ForexSymbol * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class ForexSymbol implements ModelInterface, ArrayAccess +class ForexSymbol implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class ForexSymbol implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['display_symbol'] = isset($data['display_symbol']) ? $data['display_symbol'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['description'] = $data['description'] ?? null; + $this->container['display_symbol'] = $data['display_symbol'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -231,7 +232,7 @@ public function getDescription() * * @param string|null $description Symbol description * - * @return $this + * @return self */ public function setDescription($description) { @@ -255,7 +256,7 @@ public function getDisplaySymbol() * * @param string|null $display_symbol Display symbol name. * - * @return $this + * @return self */ public function setDisplaySymbol($display_symbol) { @@ -279,7 +280,7 @@ public function getSymbol() * * @param string|null $symbol Unique symbol used to identify this symbol used in /forex/candle endpoint. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Forexrates.php b/lib/Model/Forexrates.php index c8d8456..b037d30 100644 --- a/lib/Model/Forexrates.php +++ b/lib/Model/Forexrates.php @@ -2,7 +2,7 @@ /** * Forexrates * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Forexrates implements ModelInterface, ArrayAccess +class Forexrates implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class Forexrates implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'base' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['base'] = isset($data['base']) ? $data['base'] : null; - $this->container['quote'] = isset($data['quote']) ? $data['quote'] : null; + $this->container['base'] = $data['base'] ?? null; + $this->container['quote'] = $data['quote'] ?? null; } /** @@ -225,7 +226,7 @@ public function getBase() * * @param string|null $base Base currency. * - * @return $this + * @return self */ public function setBase($base) { @@ -249,7 +250,7 @@ public function getQuote() * * @param object|null $quote quote * - * @return $this + * @return self */ public function setQuote($quote) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/FundOwnership.php b/lib/Model/FundOwnership.php index 8c64d27..40ab0d5 100644 --- a/lib/Model/FundOwnership.php +++ b/lib/Model/FundOwnership.php @@ -2,7 +2,7 @@ /** * FundOwnership * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class FundOwnership implements ModelInterface, ArrayAccess +class FundOwnership implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class FundOwnership implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['ownership'] = isset($data['ownership']) ? $data['ownership'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['ownership'] = $data['ownership'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Symbol of the company. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getOwnership() * * @param object[]|null $ownership Array of investors with detailed information about their holdings. * - * @return $this + * @return self */ public function setOwnership($ownership) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/HistoricalNBBO.php b/lib/Model/HistoricalNBBO.php new file mode 100644 index 0000000..8596568 --- /dev/null +++ b/lib/Model/HistoricalNBBO.php @@ -0,0 +1,650 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalNBBO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HistoricalNBBO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 's' => 'string', + 'skip' => 'int', + 'count' => 'int', + 'total' => 'int', + 'av' => 'float[]', + 'a' => 'float[]', + 'ax' => 'string[]', + 'bv' => 'float[]', + 'b' => 'float[]', + 'bx' => 'string[]', + 't' => 'int[]', + 'c' => 'string[][]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 's' => null, + 'skip' => 'int64', + 'count' => 'int64', + 'total' => 'int64', + 'av' => 'float', + 'a' => 'float', + 'ax' => null, + 'bv' => 'float', + 'b' => 'float', + 'bx' => null, + 't' => 'int64', + 'c' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 's' => 's', + 'skip' => 'skip', + 'count' => 'count', + 'total' => 'total', + 'av' => 'av', + 'a' => 'a', + 'ax' => 'ax', + 'bv' => 'bv', + 'b' => 'b', + 'bx' => 'bx', + 't' => 't', + 'c' => 'c' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 's' => 'setS', + 'skip' => 'setSkip', + 'count' => 'setCount', + 'total' => 'setTotal', + 'av' => 'setAv', + 'a' => 'setA', + 'ax' => 'setAx', + 'bv' => 'setBv', + 'b' => 'setB', + 'bx' => 'setBx', + 't' => 'setT', + 'c' => 'setC' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 's' => 'getS', + 'skip' => 'getSkip', + 'count' => 'getCount', + 'total' => 'getTotal', + 'av' => 'getAv', + 'a' => 'getA', + 'ax' => 'getAx', + 'bv' => 'getBv', + 'b' => 'getB', + 'bx' => 'getBx', + 't' => 'getT', + 'c' => 'getC' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['s'] = $data['s'] ?? null; + $this->container['skip'] = $data['skip'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['total'] = $data['total'] ?? null; + $this->container['av'] = $data['av'] ?? null; + $this->container['a'] = $data['a'] ?? null; + $this->container['ax'] = $data['ax'] ?? null; + $this->container['bv'] = $data['bv'] ?? null; + $this->container['b'] = $data['b'] ?? null; + $this->container['bx'] = $data['bx'] ?? null; + $this->container['t'] = $data['t'] ?? null; + $this->container['c'] = $data['c'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets s + * + * @return string|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param string|null $s Symbol. + * + * @return self + */ + public function setS($s) + { + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets skip + * + * @return int|null + */ + public function getSkip() + { + return $this->container['skip']; + } + + /** + * Sets skip + * + * @param int|null $skip Number of ticks skipped. + * + * @return self + */ + public function setSkip($skip) + { + $this->container['skip'] = $skip; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count Number of ticks returned. If count < limit, all data for that date has been returned. + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total Total number of ticks for that date. + * + * @return self + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets av + * + * @return float[]|null + */ + public function getAv() + { + return $this->container['av']; + } + + /** + * Sets av + * + * @param float[]|null $av List of Ask volume data. + * + * @return self + */ + public function setAv($av) + { + $this->container['av'] = $av; + + return $this; + } + + /** + * Gets a + * + * @return float[]|null + */ + public function getA() + { + return $this->container['a']; + } + + /** + * Sets a + * + * @param float[]|null $a List of Ask price data. + * + * @return self + */ + public function setA($a) + { + $this->container['a'] = $a; + + return $this; + } + + /** + * Gets ax + * + * @return string[]|null + */ + public function getAx() + { + return $this->container['ax']; + } + + /** + * Sets ax + * + * @param string[]|null $ax List of venues/exchanges - Ask price. A list of exchange codes can be found here + * + * @return self + */ + public function setAx($ax) + { + $this->container['ax'] = $ax; + + return $this; + } + + /** + * Gets bv + * + * @return float[]|null + */ + public function getBv() + { + return $this->container['bv']; + } + + /** + * Sets bv + * + * @param float[]|null $bv List of Bid volume data. + * + * @return self + */ + public function setBv($bv) + { + $this->container['bv'] = $bv; + + return $this; + } + + /** + * Gets b + * + * @return float[]|null + */ + public function getB() + { + return $this->container['b']; + } + + /** + * Sets b + * + * @param float[]|null $b List of Bid price data. + * + * @return self + */ + public function setB($b) + { + $this->container['b'] = $b; + + return $this; + } + + /** + * Gets bx + * + * @return string[]|null + */ + public function getBx() + { + return $this->container['bx']; + } + + /** + * Sets bx + * + * @param string[]|null $bx List of venues/exchanges - Bid price. A list of exchange codes can be found here + * + * @return self + */ + public function setBx($bx) + { + $this->container['bx'] = $bx; + + return $this; + } + + /** + * Gets t + * + * @return int[]|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int[]|null $t List of timestamp in UNIX ms. + * + * @return self + */ + public function setT($t) + { + $this->container['t'] = $t; + + return $this; + } + + /** + * Gets c + * + * @return string[][]|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param string[][]|null $c List of quote conditions. A comprehensive list of quote conditions code can be found here + * + * @return self + */ + public function setC($c) + { + $this->container['c'] = $c; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IPOCalendar.php b/lib/Model/IPOCalendar.php index abd636a..e229753 100644 --- a/lib/Model/IPOCalendar.php +++ b/lib/Model/IPOCalendar.php @@ -2,7 +2,7 @@ /** * IPOCalendar * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class IPOCalendar implements ModelInterface, ArrayAccess +class IPOCalendar implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,6 +66,8 @@ class IPOCalendar implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'ipo_calendar' => null @@ -158,9 +162,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['ipo_calendar'] = isset($data['ipo_calendar']) ? $data['ipo_calendar'] : null; + $this->container['ipo_calendar'] = $data['ipo_calendar'] ?? null; } /** @@ -219,7 +220,7 @@ public function getIpoCalendar() * * @param object[]|null $ipo_calendar Array of IPO events. * - * @return $this + * @return self */ public function setIpoCalendar($ipo_calendar) { @@ -244,18 +245,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -280,6 +281,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/IPOEvent.php b/lib/Model/IPOEvent.php index 1bbaffb..6c733a2 100644 --- a/lib/Model/IPOEvent.php +++ b/lib/Model/IPOEvent.php @@ -2,7 +2,7 @@ /** * IPOEvent * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class IPOEvent implements ModelInterface, ArrayAccess +class IPOEvent implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -71,6 +73,8 @@ class IPOEvent implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -193,9 +197,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -212,14 +213,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['exchange'] = isset($data['exchange']) ? $data['exchange'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; - $this->container['number_of_shares'] = isset($data['number_of_shares']) ? $data['number_of_shares'] : null; - $this->container['total_shares_value'] = isset($data['total_shares_value']) ? $data['total_shares_value'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['date'] = $data['date'] ?? null; + $this->container['exchange'] = $data['exchange'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['price'] = $data['price'] ?? null; + $this->container['number_of_shares'] = $data['number_of_shares'] ?? null; + $this->container['total_shares_value'] = $data['total_shares_value'] ?? null; } /** @@ -261,7 +262,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -285,7 +286,7 @@ public function getDate() * * @param \DateTime|null $date IPO date. * - * @return $this + * @return self */ public function setDate($date) { @@ -309,7 +310,7 @@ public function getExchange() * * @param string|null $exchange Exchange. * - * @return $this + * @return self */ public function setExchange($exchange) { @@ -333,7 +334,7 @@ public function getName() * * @param string|null $name Company's name. * - * @return $this + * @return self */ public function setName($name) { @@ -357,7 +358,7 @@ public function getStatus() * * @param string|null $status IPO status. Can take 1 of the following values: expected,priced,withdrawn,filed * - * @return $this + * @return self */ public function setStatus($status) { @@ -381,7 +382,7 @@ public function getPrice() * * @param string|null $price Projected price or price range. * - * @return $this + * @return self */ public function setPrice($price) { @@ -405,7 +406,7 @@ public function getNumberOfShares() * * @param int|null $number_of_shares Number of shares offered during the IPO. * - * @return $this + * @return self */ public function setNumberOfShares($number_of_shares) { @@ -429,7 +430,7 @@ public function getTotalSharesValue() * * @param int|null $total_shares_value Total shares value. * - * @return $this + * @return self */ public function setTotalSharesValue($total_shares_value) { @@ -454,18 +455,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -490,6 +491,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/IndexHistoricalConstituent.php b/lib/Model/IndexHistoricalConstituent.php index 695ee4e..8ebeeef 100644 --- a/lib/Model/IndexHistoricalConstituent.php +++ b/lib/Model/IndexHistoricalConstituent.php @@ -2,7 +2,7 @@ /** * IndexHistoricalConstituent * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class IndexHistoricalConstituent implements ModelInterface, ArrayAccess +class IndexHistoricalConstituent implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class IndexHistoricalConstituent implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['action'] = isset($data['action']) ? $data['action'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['action'] = $data['action'] ?? null; + $this->container['date'] = $data['date'] ?? null; } /** @@ -231,7 +232,7 @@ public function getSymbol() * * @param string|null $symbol Symbol * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -255,7 +256,7 @@ public function getAction() * * @param string|null $action add or remove. * - * @return $this + * @return self */ public function setAction($action) { @@ -279,7 +280,7 @@ public function getDate() * * @param \DateTime|null $date Date of joining or leaving the index. * - * @return $this + * @return self */ public function setDate($date) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Indicator.php b/lib/Model/Indicator.php index def86f1..fdaf2ae 100644 --- a/lib/Model/Indicator.php +++ b/lib/Model/Indicator.php @@ -2,7 +2,7 @@ /** * Indicator * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Indicator implements ModelInterface, ArrayAccess +class Indicator implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class Indicator implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'buy' => 'int64', @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['buy'] = isset($data['buy']) ? $data['buy'] : null; - $this->container['neutral'] = isset($data['neutral']) ? $data['neutral'] : null; - $this->container['sell'] = isset($data['sell']) ? $data['sell'] : null; + $this->container['buy'] = $data['buy'] ?? null; + $this->container['neutral'] = $data['neutral'] ?? null; + $this->container['sell'] = $data['sell'] ?? null; } /** @@ -231,7 +232,7 @@ public function getBuy() * * @param int|null $buy Number of buy signals * - * @return $this + * @return self */ public function setBuy($buy) { @@ -255,7 +256,7 @@ public function getNeutral() * * @param int|null $neutral Number of neutral signals * - * @return $this + * @return self */ public function setNeutral($neutral) { @@ -279,7 +280,7 @@ public function getSell() * * @param int|null $sell Number of sell signals * - * @return $this + * @return self */ public function setSell($sell) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/IndicesConstituents.php b/lib/Model/IndicesConstituents.php index 56118ed..3a088a8 100644 --- a/lib/Model/IndicesConstituents.php +++ b/lib/Model/IndicesConstituents.php @@ -2,7 +2,7 @@ /** * IndicesConstituents * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class IndicesConstituents implements ModelInterface, ArrayAccess +class IndicesConstituents implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class IndicesConstituents implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['constituents'] = isset($data['constituents']) ? $data['constituents'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['constituents'] = $data['constituents'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Index's symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getConstituents() * * @param string[]|null $constituents Array of constituents. * - * @return $this + * @return self */ public function setConstituents($constituents) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/IndicesHistoricalConstituents.php b/lib/Model/IndicesHistoricalConstituents.php index 5652a78..d03b596 100644 --- a/lib/Model/IndicesHistoricalConstituents.php +++ b/lib/Model/IndicesHistoricalConstituents.php @@ -2,7 +2,7 @@ /** * IndicesHistoricalConstituents * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class IndicesHistoricalConstituents implements ModelInterface, ArrayAccess +class IndicesHistoricalConstituents implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class IndicesHistoricalConstituents implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['historical_constituents'] = isset($data['historical_constituents']) ? $data['historical_constituents'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['historical_constituents'] = $data['historical_constituents'] ?? null; } /** @@ -225,7 +226,7 @@ public function getSymbol() * * @param string|null $symbol Index's symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -249,7 +250,7 @@ public function getHistoricalConstituents() * * @param object[]|null $historical_constituents Array of historical constituents. * - * @return $this + * @return self */ public function setHistoricalConstituents($historical_constituents) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/InsiderTransactions.php b/lib/Model/InsiderTransactions.php new file mode 100644 index 0000000..0fade71 --- /dev/null +++ b/lib/Model/InsiderTransactions.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InsiderTransactions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InsiderTransactions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol of the company. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data Array of insider transactions. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InternationalFiling.php b/lib/Model/InternationalFiling.php new file mode 100644 index 0000000..05c8bc8 --- /dev/null +++ b/lib/Model/InternationalFiling.php @@ -0,0 +1,560 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InternationalFiling implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternationalFiling'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'company_name' => 'string', + 'filed_date' => '\DateTime', + 'category' => 'string', + 'title' => 'string', + 'description' => 'string', + 'url' => 'string', + 'language' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'company_name' => null, + 'filed_date' => 'date-time', + 'category' => null, + 'title' => null, + 'description' => null, + 'url' => null, + 'language' => null, + 'country' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'company_name' => 'companyName', + 'filed_date' => 'filedDate', + 'category' => 'category', + 'title' => 'title', + 'description' => 'description', + 'url' => 'url', + 'language' => 'language', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'company_name' => 'setCompanyName', + 'filed_date' => 'setFiledDate', + 'category' => 'setCategory', + 'title' => 'setTitle', + 'description' => 'setDescription', + 'url' => 'setUrl', + 'language' => 'setLanguage', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'company_name' => 'getCompanyName', + 'filed_date' => 'getFiledDate', + 'category' => 'getCategory', + 'title' => 'getTitle', + 'description' => 'getDescription', + 'url' => 'getUrl', + 'language' => 'getLanguage', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['company_name'] = $data['company_name'] ?? null; + $this->container['filed_date'] = $data['filed_date'] ?? null; + $this->container['category'] = $data['category'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['language'] = $data['language'] ?? null; + $this->container['country'] = $data['country'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets company_name + * + * @return string|null + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string|null $company_name Company name. + * + * @return self + */ + public function setCompanyName($company_name) + { + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets filed_date + * + * @return \DateTime|null + */ + public function getFiledDate() + { + return $this->container['filed_date']; + } + + /** + * Sets filed_date + * + * @param \DateTime|null $filed_date Filed date %Y-%m-%d %H:%M:%S. + * + * @return self + */ + public function setFiledDate($filed_date) + { + $this->container['filed_date'] = $filed_date; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category Category. + * + * @return self + */ + public function setCategory($category) + { + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Document's title. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Document's description. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Url. + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language Language. + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvestmentThemePortfolio.php b/lib/Model/InvestmentThemePortfolio.php new file mode 100644 index 0000000..aaf0356 --- /dev/null +++ b/lib/Model/InvestmentThemePortfolio.php @@ -0,0 +1,320 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InvestmentThemePortfolio implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvestmentThemePortfolio'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvestmentThemesThematicInvesting.php b/lib/Model/InvestmentThemesThematicInvesting.php new file mode 100644 index 0000000..d774850 --- /dev/null +++ b/lib/Model/InvestmentThemesThematicInvesting.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InvestmentThemesThematicInvesting implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvestmentThemes(ThematicInvesting)'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'theme' => 'string', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'theme' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'theme' => 'theme', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'theme' => 'setTheme', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'theme' => 'getTheme', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['theme'] = $data['theme'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets theme + * + * @return string|null + */ + public function getTheme() + { + return $this->container['theme']; + } + + /** + * Sets theme + * + * @param string|null $theme Investment theme + * + * @return self + */ + public function setTheme($theme) + { + $this->container['theme'] = $theme; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data Investment theme portfolio. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Investor.php b/lib/Model/Investor.php index 8bf064a..b805fc8 100644 --- a/lib/Model/Investor.php +++ b/lib/Model/Investor.php @@ -2,7 +2,7 @@ /** * Investor * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Investor implements ModelInterface, ArrayAccess +class Investor implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +69,8 @@ class Investor implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null, @@ -173,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['share'] = isset($data['share']) ? $data['share'] : null; - $this->container['change'] = isset($data['change']) ? $data['change'] : null; - $this->container['filing_date'] = isset($data['filing_date']) ? $data['filing_date'] : null; + $this->container['name'] = $data['name'] ?? null; + $this->container['share'] = $data['share'] ?? null; + $this->container['change'] = $data['change'] ?? null; + $this->container['filing_date'] = $data['filing_date'] ?? null; } /** @@ -237,7 +238,7 @@ public function getName() * * @param string|null $name Investor's name. * - * @return $this + * @return self */ public function setName($name) { @@ -261,7 +262,7 @@ public function getShare() * * @param int|null $share Number of shares held by the investor. * - * @return $this + * @return self */ public function setShare($share) { @@ -285,7 +286,7 @@ public function getChange() * * @param int|null $change Number of share changed (net buy or sell) from the last period. * - * @return $this + * @return self */ public function setChange($change) { @@ -309,7 +310,7 @@ public function getFilingDate() * * @param \DateTime|null $filing_date Filing date. * - * @return $this + * @return self */ public function setFilingDate($filing_date) { @@ -334,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/KeyCustomersSuppliers.php b/lib/Model/KeyCustomersSuppliers.php new file mode 100644 index 0000000..2d8a57b --- /dev/null +++ b/lib/Model/KeyCustomersSuppliers.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class KeyCustomersSuppliers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KeyCustomersSuppliers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'name' => 'string', + 'customer' => 'bool', + 'supplier' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'name' => null, + 'customer' => null, + 'supplier' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'name' => 'name', + 'customer' => 'customer', + 'supplier' => 'supplier' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'name' => 'setName', + 'customer' => 'setCustomer', + 'supplier' => 'setSupplier' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'name' => 'getName', + 'customer' => 'getCustomer', + 'supplier' => 'getSupplier' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['customer'] = $data['customer'] ?? null; + $this->container['supplier'] = $data['supplier'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets customer + * + * @return bool|null + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param bool|null $customer Whether the company is a customer. + * + * @return self + */ + public function setCustomer($customer) + { + $this->container['customer'] = $customer; + + return $this; + } + + /** + * Gets supplier + * + * @return bool|null + */ + public function getSupplier() + { + return $this->container['supplier']; + } + + /** + * Sets supplier + * + * @param bool|null $supplier Whether the company is a supplier + * + * @return self + */ + public function setSupplier($supplier) + { + $this->container['supplier'] = $supplier; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LastBidAsk.php b/lib/Model/LastBidAsk.php index 792ea50..ef13ddc 100644 --- a/lib/Model/LastBidAsk.php +++ b/lib/Model/LastBidAsk.php @@ -2,7 +2,7 @@ /** * LastBidAsk * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class LastBidAsk implements ModelInterface, ArrayAccess +class LastBidAsk implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +70,8 @@ class LastBidAsk implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'b' => 'float', @@ -178,9 +182,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +198,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['b'] = isset($data['b']) ? $data['b'] : null; - $this->container['a'] = isset($data['a']) ? $data['a'] : null; - $this->container['bv'] = isset($data['bv']) ? $data['bv'] : null; - $this->container['av'] = isset($data['av']) ? $data['av'] : null; - $this->container['t'] = isset($data['t']) ? $data['t'] : null; + $this->container['b'] = $data['b'] ?? null; + $this->container['a'] = $data['a'] ?? null; + $this->container['bv'] = $data['bv'] ?? null; + $this->container['av'] = $data['av'] ?? null; + $this->container['t'] = $data['t'] ?? null; } /** @@ -243,7 +244,7 @@ public function getB() * * @param float|null $b Bid price. * - * @return $this + * @return self */ public function setB($b) { @@ -267,7 +268,7 @@ public function getA() * * @param float|null $a Ask price. * - * @return $this + * @return self */ public function setA($a) { @@ -291,7 +292,7 @@ public function getBv() * * @param float|null $bv Bid volume. * - * @return $this + * @return self */ public function setBv($bv) { @@ -315,7 +316,7 @@ public function getAv() * * @param float|null $av Ask volume. * - * @return $this + * @return self */ public function setAv($av) { @@ -339,7 +340,7 @@ public function getT() * * @param int|null $t Reference UNIX timestamp in ms. * - * @return $this + * @return self */ public function setT($t) { @@ -364,18 +365,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +401,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/MajorPressReleases.php b/lib/Model/MajorPressReleases.php new file mode 100644 index 0000000..6073d12 --- /dev/null +++ b/lib/Model/MajorPressReleases.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MajorPressReleases implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MajorPressReleases'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'major_development' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'major_development' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'major_development' => 'majorDevelopment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'major_development' => 'setMajorDevelopment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'major_development' => 'getMajorDevelopment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['major_development'] = $data['major_development'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Company symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets major_development + * + * @return object[]|null + */ + public function getMajorDevelopment() + { + return $this->container['major_development']; + } + + /** + * Sets major_development + * + * @param object[]|null $major_development Array of major developments. + * + * @return self + */ + public function setMajorDevelopment($major_development) + { + $this->container['major_development'] = $major_development; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 2a1a46b..ea0ee77 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub\Model @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** diff --git a/lib/Model/MutualFundCountryExposureData.php b/lib/Model/MutualFundCountryExposureData.php new file mode 100644 index 0000000..9bfb670 --- /dev/null +++ b/lib/Model/MutualFundCountryExposureData.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundCountryExposureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MutualFundCountryExposureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country' => 'string', + 'exposure' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country' => null, + 'exposure' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'exposure' => 'exposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'exposure' => 'setExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'exposure' => 'getExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country'] = $data['country'] ?? null; + $this->container['exposure'] = $data['exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets exposure + * + * @return float|null + */ + public function getExposure() + { + return $this->container['exposure']; + } + + /** + * Sets exposure + * + * @param float|null $exposure Percent of exposure. + * + * @return self + */ + public function setExposure($exposure) + { + $this->container['exposure'] = $exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MutualFundSectorExposure.php b/lib/Model/MutualFundSectorExposure.php new file mode 100644 index 0000000..cb0d66e --- /dev/null +++ b/lib/Model/MutualFundSectorExposure.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundSectorExposure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Mutual-fundSectorExposure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'sector_exposure' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'sector_exposure' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'sector_exposure' => 'sectorExposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'sector_exposure' => 'setSectorExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'sector_exposure' => 'getSectorExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['sector_exposure'] = $data['sector_exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Mutual symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets sector_exposure + * + * @return object[]|null + */ + public function getSectorExposure() + { + return $this->container['sector_exposure']; + } + + /** + * Sets sector_exposure + * + * @param object[]|null $sector_exposure Array of sector and exposure levels. + * + * @return self + */ + public function setSectorExposure($sector_exposure) + { + $this->container['sector_exposure'] = $sector_exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MutualFundSectorExposureData.php b/lib/Model/MutualFundSectorExposureData.php new file mode 100644 index 0000000..7dfe77e --- /dev/null +++ b/lib/Model/MutualFundSectorExposureData.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundSectorExposureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MutualFundSectorExposureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sector' => 'string', + 'exposure' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sector' => null, + 'exposure' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sector' => 'sector', + 'exposure' => 'exposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sector' => 'setSector', + 'exposure' => 'setExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sector' => 'getSector', + 'exposure' => 'getExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sector'] = $data['sector'] ?? null; + $this->container['exposure'] = $data['exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sector + * + * @return string|null + */ + public function getSector() + { + return $this->container['sector']; + } + + /** + * Sets sector + * + * @param string|null $sector Sector + * + * @return self + */ + public function setSector($sector) + { + $this->container['sector'] = $sector; + + return $this; + } + + /** + * Gets exposure + * + * @return float|null + */ + public function getExposure() + { + return $this->container['exposure']; + } + + /** + * Sets exposure + * + * @param float|null $exposure Percent of exposure. + * + * @return self + */ + public function setExposure($exposure) + { + $this->container['exposure'] = $exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MutualFundsCountryExposure.php b/lib/Model/MutualFundsCountryExposure.php new file mode 100644 index 0000000..7c185c8 --- /dev/null +++ b/lib/Model/MutualFundsCountryExposure.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundsCountryExposure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MutualFundsCountryExposure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'country_exposure' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'country_exposure' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'country_exposure' => 'countryExposure' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'country_exposure' => 'setCountryExposure' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'country_exposure' => 'getCountryExposure' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['country_exposure'] = $data['country_exposure'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets country_exposure + * + * @return object[]|null + */ + public function getCountryExposure() + { + return $this->container['country_exposure']; + } + + /** + * Sets country_exposure + * + * @param object[]|null $country_exposure Array of countries and and exposure levels. + * + * @return self + */ + public function setCountryExposure($country_exposure) + { + $this->container['country_exposure'] = $country_exposure; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MutualFundsHoldings.php b/lib/Model/MutualFundsHoldings.php new file mode 100644 index 0000000..cc7a68b --- /dev/null +++ b/lib/Model/MutualFundsHoldings.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundsHoldings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MutualFundsHoldings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'at_date' => '\DateTime', + 'number_of_holdings' => 'int', + 'holdings' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'at_date' => 'date', + 'number_of_holdings' => 'int64', + 'holdings' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'at_date' => 'atDate', + 'number_of_holdings' => 'numberOfHoldings', + 'holdings' => 'holdings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'at_date' => 'setAtDate', + 'number_of_holdings' => 'setNumberOfHoldings', + 'holdings' => 'setHoldings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'at_date' => 'getAtDate', + 'number_of_holdings' => 'getNumberOfHoldings', + 'holdings' => 'getHoldings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['at_date'] = $data['at_date'] ?? null; + $this->container['number_of_holdings'] = $data['number_of_holdings'] ?? null; + $this->container['holdings'] = $data['holdings'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets at_date + * + * @return \DateTime|null + */ + public function getAtDate() + { + return $this->container['at_date']; + } + + /** + * Sets at_date + * + * @param \DateTime|null $at_date Holdings update date. + * + * @return self + */ + public function setAtDate($at_date) + { + $this->container['at_date'] = $at_date; + + return $this; + } + + /** + * Gets number_of_holdings + * + * @return int|null + */ + public function getNumberOfHoldings() + { + return $this->container['number_of_holdings']; + } + + /** + * Sets number_of_holdings + * + * @param int|null $number_of_holdings Number of holdings. + * + * @return self + */ + public function setNumberOfHoldings($number_of_holdings) + { + $this->container['number_of_holdings'] = $number_of_holdings; + + return $this; + } + + /** + * Gets holdings + * + * @return object[]|null + */ + public function getHoldings() + { + return $this->container['holdings']; + } + + /** + * Sets holdings + * + * @param object[]|null $holdings Array of holdings. + * + * @return self + */ + public function setHoldings($holdings) + { + $this->container['holdings'] = $holdings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MutualFundsProfile.php b/lib/Model/MutualFundsProfile.php new file mode 100644 index 0000000..74c1af7 --- /dev/null +++ b/lib/Model/MutualFundsProfile.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MutualFundsProfile implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MutualFundsProfile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'profile' => '\Finnhub\Model\ETFProfileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'profile' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'profile' => 'profile' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'profile' => 'setProfile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'profile' => 'getProfile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['profile'] = $data['profile'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets profile + * + * @return \Finnhub\Model\ETFProfileData|null + */ + public function getProfile() + { + return $this->container['profile']; + } + + /** + * Sets profile + * + * @param \Finnhub\Model\ETFProfileData|null $profile profile + * + * @return self + */ + public function setProfile($profile) + { + $this->container['profile'] = $profile; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/News.php b/lib/Model/News.php index 8afd6f9..9e0ee10 100644 --- a/lib/Model/News.php +++ b/lib/Model/News.php @@ -2,7 +2,7 @@ /** * News * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class News implements ModelInterface, ArrayAccess +class News implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -72,6 +74,8 @@ class News implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'category' => null, @@ -198,9 +202,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -217,15 +218,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['category'] = isset($data['category']) ? $data['category'] : null; - $this->container['datetime'] = isset($data['datetime']) ? $data['datetime'] : null; - $this->container['headline'] = isset($data['headline']) ? $data['headline'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['image'] = isset($data['image']) ? $data['image'] : null; - $this->container['related'] = isset($data['related']) ? $data['related'] : null; - $this->container['source'] = isset($data['source']) ? $data['source'] : null; - $this->container['summary'] = isset($data['summary']) ? $data['summary'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['category'] = $data['category'] ?? null; + $this->container['datetime'] = $data['datetime'] ?? null; + $this->container['headline'] = $data['headline'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['image'] = $data['image'] ?? null; + $this->container['related'] = $data['related'] ?? null; + $this->container['source'] = $data['source'] ?? null; + $this->container['summary'] = $data['summary'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -267,7 +268,7 @@ public function getCategory() * * @param string|null $category News category. * - * @return $this + * @return self */ public function setCategory($category) { @@ -291,7 +292,7 @@ public function getDatetime() * * @param int|null $datetime Published time in UNIX timestamp. * - * @return $this + * @return self */ public function setDatetime($datetime) { @@ -315,7 +316,7 @@ public function getHeadline() * * @param string|null $headline News headline. * - * @return $this + * @return self */ public function setHeadline($headline) { @@ -339,7 +340,7 @@ public function getId() * * @param int|null $id News ID. This value can be used for minId params to get the latest news only. * - * @return $this + * @return self */ public function setId($id) { @@ -363,7 +364,7 @@ public function getImage() * * @param string|null $image Thumbnail image URL. * - * @return $this + * @return self */ public function setImage($image) { @@ -387,7 +388,7 @@ public function getRelated() * * @param string|null $related Related stocks and companies mentioned in the article. * - * @return $this + * @return self */ public function setRelated($related) { @@ -411,7 +412,7 @@ public function getSource() * * @param string|null $source News source. * - * @return $this + * @return self */ public function setSource($source) { @@ -435,7 +436,7 @@ public function getSummary() * * @param string|null $summary News summary. * - * @return $this + * @return self */ public function setSummary($summary) { @@ -459,7 +460,7 @@ public function getUrl() * * @param string|null $url URL of the original article. * - * @return $this + * @return self */ public function setUrl($url) { @@ -484,18 +485,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -520,6 +521,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/NewsSentiment.php b/lib/Model/NewsSentiment.php index fa40028..e844f8b 100644 --- a/lib/Model/NewsSentiment.php +++ b/lib/Model/NewsSentiment.php @@ -2,7 +2,7 @@ /** * NewsSentiment * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class NewsSentiment implements ModelInterface, ArrayAccess +class NewsSentiment implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +71,8 @@ class NewsSentiment implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'buzz' => null, @@ -183,9 +187,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +203,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['buzz'] = isset($data['buzz']) ? $data['buzz'] : null; - $this->container['company_news_score'] = isset($data['company_news_score']) ? $data['company_news_score'] : null; - $this->container['sector_average_bullish_percent'] = isset($data['sector_average_bullish_percent']) ? $data['sector_average_bullish_percent'] : null; - $this->container['sector_average_news_score'] = isset($data['sector_average_news_score']) ? $data['sector_average_news_score'] : null; - $this->container['sentiment'] = isset($data['sentiment']) ? $data['sentiment'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['buzz'] = $data['buzz'] ?? null; + $this->container['company_news_score'] = $data['company_news_score'] ?? null; + $this->container['sector_average_bullish_percent'] = $data['sector_average_bullish_percent'] ?? null; + $this->container['sector_average_news_score'] = $data['sector_average_news_score'] ?? null; + $this->container['sentiment'] = $data['sentiment'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -249,7 +250,7 @@ public function getBuzz() * * @param \Finnhub\Model\CompanyNewsStatistics|null $buzz buzz * - * @return $this + * @return self */ public function setBuzz($buzz) { @@ -273,7 +274,7 @@ public function getCompanyNewsScore() * * @param float|null $company_news_score News score. * - * @return $this + * @return self */ public function setCompanyNewsScore($company_news_score) { @@ -297,7 +298,7 @@ public function getSectorAverageBullishPercent() * * @param float|null $sector_average_bullish_percent Sector average bullish percent. * - * @return $this + * @return self */ public function setSectorAverageBullishPercent($sector_average_bullish_percent) { @@ -321,7 +322,7 @@ public function getSectorAverageNewsScore() * * @param float|null $sector_average_news_score Sectore average score. * - * @return $this + * @return self */ public function setSectorAverageNewsScore($sector_average_news_score) { @@ -345,7 +346,7 @@ public function getSentiment() * * @param \Finnhub\Model\Sentiment|null $sentiment sentiment * - * @return $this + * @return self */ public function setSentiment($sentiment) { @@ -369,7 +370,7 @@ public function getSymbol() * * @param string|null $symbol Requested symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -394,18 +395,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -430,6 +431,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Ownership.php b/lib/Model/Ownership.php new file mode 100644 index 0000000..0e4fd87 --- /dev/null +++ b/lib/Model/Ownership.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Ownership implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Ownership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'ownership' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'ownership' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'ownership' => 'ownership' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'ownership' => 'setOwnership' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'ownership' => 'getOwnership' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['ownership'] = $data['ownership'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol of the company. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets ownership + * + * @return object[]|null + */ + public function getOwnership() + { + return $this->container['ownership']; + } + + /** + * Sets ownership + * + * @param object[]|null $ownership Array of investors with detailed information about their holdings. + * + * @return self + */ + public function setOwnership($ownership) + { + $this->container['ownership'] = $ownership; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PatternRecognition.php b/lib/Model/PatternRecognition.php index 6ca09fa..84e69d6 100644 --- a/lib/Model/PatternRecognition.php +++ b/lib/Model/PatternRecognition.php @@ -2,7 +2,7 @@ /** * PatternRecognition * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class PatternRecognition implements ModelInterface, ArrayAccess +class PatternRecognition implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,6 +66,8 @@ class PatternRecognition implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'points' => null @@ -158,9 +162,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['points'] = isset($data['points']) ? $data['points'] : null; + $this->container['points'] = $data['points'] ?? null; } /** @@ -219,7 +220,7 @@ public function getPoints() * * @param object[]|null $points Array of patterns. * - * @return $this + * @return self */ public function setPoints($points) { @@ -244,18 +245,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -280,6 +281,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/PriceTarget.php b/lib/Model/PriceTarget.php index f2dabe9..b5a9283 100644 --- a/lib/Model/PriceTarget.php +++ b/lib/Model/PriceTarget.php @@ -2,7 +2,7 @@ /** * PriceTarget * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class PriceTarget implements ModelInterface, ArrayAccess +class PriceTarget implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +71,8 @@ class PriceTarget implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -183,9 +187,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +203,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['target_high'] = isset($data['target_high']) ? $data['target_high'] : null; - $this->container['target_low'] = isset($data['target_low']) ? $data['target_low'] : null; - $this->container['target_mean'] = isset($data['target_mean']) ? $data['target_mean'] : null; - $this->container['target_median'] = isset($data['target_median']) ? $data['target_median'] : null; - $this->container['last_updated'] = isset($data['last_updated']) ? $data['last_updated'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['target_high'] = $data['target_high'] ?? null; + $this->container['target_low'] = $data['target_low'] ?? null; + $this->container['target_mean'] = $data['target_mean'] ?? null; + $this->container['target_median'] = $data['target_median'] ?? null; + $this->container['last_updated'] = $data['last_updated'] ?? null; } /** @@ -249,7 +250,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -273,7 +274,7 @@ public function getTargetHigh() * * @param float|null $target_high Highes analysts' target. * - * @return $this + * @return self */ public function setTargetHigh($target_high) { @@ -297,7 +298,7 @@ public function getTargetLow() * * @param float|null $target_low Lowest analysts' target. * - * @return $this + * @return self */ public function setTargetLow($target_low) { @@ -321,7 +322,7 @@ public function getTargetMean() * * @param float|null $target_mean Mean of all analysts' targets. * - * @return $this + * @return self */ public function setTargetMean($target_mean) { @@ -345,7 +346,7 @@ public function getTargetMedian() * * @param float|null $target_median Median of all analysts' targets. * - * @return $this + * @return self */ public function setTargetMedian($target_median) { @@ -369,7 +370,7 @@ public function getLastUpdated() * * @param \DateTime|null $last_updated Updated time of the data * - * @return $this + * @return self */ public function setLastUpdated($last_updated) { @@ -394,18 +395,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -430,6 +431,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Quote.php b/lib/Model/Quote.php index 0920077..f108dc1 100644 --- a/lib/Model/Quote.php +++ b/lib/Model/Quote.php @@ -2,7 +2,7 @@ /** * Quote * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Quote implements ModelInterface, ArrayAccess +class Quote implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -61,20 +63,26 @@ class Quote implements ModelInterface, ArrayAccess 'h' => 'float', 'l' => 'float', 'c' => 'float', - 'pc' => 'float' + 'pc' => 'float', + 'd' => 'float', + 'dp' => 'float' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'o' => 'float', 'h' => 'float', 'l' => 'float', 'c' => 'float', - 'pc' => 'float' + 'pc' => 'float', + 'd' => 'float', + 'dp' => 'float' ]; /** @@ -108,7 +116,9 @@ public static function openAPIFormats() 'h' => 'h', 'l' => 'l', 'c' => 'c', - 'pc' => 'pc' + 'pc' => 'pc', + 'd' => 'd', + 'dp' => 'dp' ]; /** @@ -121,7 +131,9 @@ public static function openAPIFormats() 'h' => 'setH', 'l' => 'setL', 'c' => 'setC', - 'pc' => 'setPc' + 'pc' => 'setPc', + 'd' => 'setD', + 'dp' => 'setDp' ]; /** @@ -134,7 +146,9 @@ public static function openAPIFormats() 'h' => 'getH', 'l' => 'getL', 'c' => 'getC', - 'pc' => 'getPc' + 'pc' => 'getPc', + 'd' => 'getD', + 'dp' => 'getDp' ]; /** @@ -178,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['o'] = isset($data['o']) ? $data['o'] : null; - $this->container['h'] = isset($data['h']) ? $data['h'] : null; - $this->container['l'] = isset($data['l']) ? $data['l'] : null; - $this->container['c'] = isset($data['c']) ? $data['c'] : null; - $this->container['pc'] = isset($data['pc']) ? $data['pc'] : null; + $this->container['o'] = $data['o'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['l'] = $data['l'] ?? null; + $this->container['c'] = $data['c'] ?? null; + $this->container['pc'] = $data['pc'] ?? null; + $this->container['d'] = $data['d'] ?? null; + $this->container['dp'] = $data['dp'] ?? null; } /** @@ -243,7 +256,7 @@ public function getO() * * @param float|null $o Open price of the day * - * @return $this + * @return self */ public function setO($o) { @@ -267,7 +280,7 @@ public function getH() * * @param float|null $h High price of the day * - * @return $this + * @return self */ public function setH($h) { @@ -291,7 +304,7 @@ public function getL() * * @param float|null $l Low price of the day * - * @return $this + * @return self */ public function setL($l) { @@ -315,7 +328,7 @@ public function getC() * * @param float|null $c Current price * - * @return $this + * @return self */ public function setC($c) { @@ -339,7 +352,7 @@ public function getPc() * * @param float|null $pc Previous close price * - * @return $this + * @return self */ public function setPc($pc) { @@ -347,6 +360,54 @@ public function setPc($pc) return $this; } + + /** + * Gets d + * + * @return float|null + */ + public function getD() + { + return $this->container['d']; + } + + /** + * Sets d + * + * @param float|null $d Change + * + * @return self + */ + public function setD($d) + { + $this->container['d'] = $d; + + return $this; + } + + /** + * Gets dp + * + * @return float|null + */ + public function getDp() + { + return $this->container['dp']; + } + + /** + * Sets dp + * + * @param float|null $dp Percent change + * + * @return self + */ + public function setDp($dp) + { + $this->container['dp'] = $dp; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -364,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/RecommendationTrend.php b/lib/Model/RecommendationTrend.php index 6e782ab..4fcdc27 100644 --- a/lib/Model/RecommendationTrend.php +++ b/lib/Model/RecommendationTrend.php @@ -2,7 +2,7 @@ /** * RecommendationTrend * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class RecommendationTrend implements ModelInterface, ArrayAccess +class RecommendationTrend implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +72,8 @@ class RecommendationTrend implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -188,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -207,13 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['buy'] = isset($data['buy']) ? $data['buy'] : null; - $this->container['hold'] = isset($data['hold']) ? $data['hold'] : null; - $this->container['period'] = isset($data['period']) ? $data['period'] : null; - $this->container['sell'] = isset($data['sell']) ? $data['sell'] : null; - $this->container['strong_buy'] = isset($data['strong_buy']) ? $data['strong_buy'] : null; - $this->container['strong_sell'] = isset($data['strong_sell']) ? $data['strong_sell'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['buy'] = $data['buy'] ?? null; + $this->container['hold'] = $data['hold'] ?? null; + $this->container['period'] = $data['period'] ?? null; + $this->container['sell'] = $data['sell'] ?? null; + $this->container['strong_buy'] = $data['strong_buy'] ?? null; + $this->container['strong_sell'] = $data['strong_sell'] ?? null; } /** @@ -255,7 +256,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -279,7 +280,7 @@ public function getBuy() * * @param int|null $buy Number of recommendations that fall into the Buy category * - * @return $this + * @return self */ public function setBuy($buy) { @@ -303,7 +304,7 @@ public function getHold() * * @param int|null $hold Number of recommendations that fall into the Hold category * - * @return $this + * @return self */ public function setHold($hold) { @@ -327,7 +328,7 @@ public function getPeriod() * * @param string|null $period Updated period * - * @return $this + * @return self */ public function setPeriod($period) { @@ -351,7 +352,7 @@ public function getSell() * * @param int|null $sell Number of recommendations that fall into the Sell category * - * @return $this + * @return self */ public function setSell($sell) { @@ -375,7 +376,7 @@ public function getStrongBuy() * * @param int|null $strong_buy Number of recommendations that fall into the Strong Buy category * - * @return $this + * @return self */ public function setStrongBuy($strong_buy) { @@ -399,7 +400,7 @@ public function getStrongSell() * * @param int|null $strong_sell Number of recommendations that fall into the Strong Sell category * - * @return $this + * @return self */ public function setStrongSell($strong_sell) { @@ -424,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -460,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/RedditSentimentContent.php b/lib/Model/RedditSentimentContent.php new file mode 100644 index 0000000..c4f06a7 --- /dev/null +++ b/lib/Model/RedditSentimentContent.php @@ -0,0 +1,500 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RedditSentimentContent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RedditSentimentContent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mention' => 'int', + 'positive_mention' => 'int', + 'negative_mention' => 'int', + 'positive_score' => 'float', + 'negative_score' => 'float', + 'score' => 'float', + 'at_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mention' => 'int64', + 'positive_mention' => 'int64', + 'negative_mention' => 'int64', + 'positive_score' => 'float', + 'negative_score' => 'float', + 'score' => 'float', + 'at_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mention' => 'mention', + 'positive_mention' => 'positiveMention', + 'negative_mention' => 'negativeMention', + 'positive_score' => 'positiveScore', + 'negative_score' => 'negativeScore', + 'score' => 'score', + 'at_time' => 'atTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mention' => 'setMention', + 'positive_mention' => 'setPositiveMention', + 'negative_mention' => 'setNegativeMention', + 'positive_score' => 'setPositiveScore', + 'negative_score' => 'setNegativeScore', + 'score' => 'setScore', + 'at_time' => 'setAtTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mention' => 'getMention', + 'positive_mention' => 'getPositiveMention', + 'negative_mention' => 'getNegativeMention', + 'positive_score' => 'getPositiveScore', + 'negative_score' => 'getNegativeScore', + 'score' => 'getScore', + 'at_time' => 'getAtTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['mention'] = $data['mention'] ?? null; + $this->container['positive_mention'] = $data['positive_mention'] ?? null; + $this->container['negative_mention'] = $data['negative_mention'] ?? null; + $this->container['positive_score'] = $data['positive_score'] ?? null; + $this->container['negative_score'] = $data['negative_score'] ?? null; + $this->container['score'] = $data['score'] ?? null; + $this->container['at_time'] = $data['at_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mention + * + * @return int|null + */ + public function getMention() + { + return $this->container['mention']; + } + + /** + * Sets mention + * + * @param int|null $mention Number of mentions + * + * @return self + */ + public function setMention($mention) + { + $this->container['mention'] = $mention; + + return $this; + } + + /** + * Gets positive_mention + * + * @return int|null + */ + public function getPositiveMention() + { + return $this->container['positive_mention']; + } + + /** + * Sets positive_mention + * + * @param int|null $positive_mention Number of positive mentions + * + * @return self + */ + public function setPositiveMention($positive_mention) + { + $this->container['positive_mention'] = $positive_mention; + + return $this; + } + + /** + * Gets negative_mention + * + * @return int|null + */ + public function getNegativeMention() + { + return $this->container['negative_mention']; + } + + /** + * Sets negative_mention + * + * @param int|null $negative_mention Number of negative mentions + * + * @return self + */ + public function setNegativeMention($negative_mention) + { + $this->container['negative_mention'] = $negative_mention; + + return $this; + } + + /** + * Gets positive_score + * + * @return float|null + */ + public function getPositiveScore() + { + return $this->container['positive_score']; + } + + /** + * Sets positive_score + * + * @param float|null $positive_score Positive score. Range 0-1 + * + * @return self + */ + public function setPositiveScore($positive_score) + { + $this->container['positive_score'] = $positive_score; + + return $this; + } + + /** + * Gets negative_score + * + * @return float|null + */ + public function getNegativeScore() + { + return $this->container['negative_score']; + } + + /** + * Sets negative_score + * + * @param float|null $negative_score Negative score. Range 0-1 + * + * @return self + */ + public function setNegativeScore($negative_score) + { + $this->container['negative_score'] = $negative_score; + + return $this; + } + + /** + * Gets score + * + * @return float|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param float|null $score Final score. Range: -1 to 1 with 1 is very positive and -1 is very negative + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets at_time + * + * @return \DateTime|null + */ + public function getAtTime() + { + return $this->container['at_time']; + } + + /** + * Sets at_time + * + * @param \DateTime|null $at_time Period. + * + * @return self + */ + public function setAtTime($at_time) + { + $this->container['at_time'] = $at_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Report.php b/lib/Model/Report.php index a7fc5c1..8b254d2 100644 --- a/lib/Model/Report.php +++ b/lib/Model/Report.php @@ -2,7 +2,7 @@ /** * Report * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Report implements ModelInterface, ArrayAccess +class Report implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -74,6 +76,8 @@ class Report implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'access_number' => null, @@ -208,9 +212,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -227,17 +228,17 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['access_number'] = isset($data['access_number']) ? $data['access_number'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['cik'] = isset($data['cik']) ? $data['cik'] : null; - $this->container['year'] = isset($data['year']) ? $data['year'] : null; - $this->container['quarter'] = isset($data['quarter']) ? $data['quarter'] : null; - $this->container['form'] = isset($data['form']) ? $data['form'] : null; - $this->container['start_date'] = isset($data['start_date']) ? $data['start_date'] : null; - $this->container['end_date'] = isset($data['end_date']) ? $data['end_date'] : null; - $this->container['filed_date'] = isset($data['filed_date']) ? $data['filed_date'] : null; - $this->container['accepted_date'] = isset($data['accepted_date']) ? $data['accepted_date'] : null; - $this->container['report'] = isset($data['report']) ? $data['report'] : null; + $this->container['access_number'] = $data['access_number'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; + $this->container['form'] = $data['form'] ?? null; + $this->container['start_date'] = $data['start_date'] ?? null; + $this->container['end_date'] = $data['end_date'] ?? null; + $this->container['filed_date'] = $data['filed_date'] ?? null; + $this->container['accepted_date'] = $data['accepted_date'] ?? null; + $this->container['report'] = $data['report'] ?? null; } /** @@ -279,7 +280,7 @@ public function getAccessNumber() * * @param string|null $access_number Access number. * - * @return $this + * @return self */ public function setAccessNumber($access_number) { @@ -303,7 +304,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -327,7 +328,7 @@ public function getCik() * * @param string|null $cik CIK. * - * @return $this + * @return self */ public function setCik($cik) { @@ -351,7 +352,7 @@ public function getYear() * * @param int|null $year Year. * - * @return $this + * @return self */ public function setYear($year) { @@ -375,7 +376,7 @@ public function getQuarter() * * @param int|null $quarter Quarter. * - * @return $this + * @return self */ public function setQuarter($quarter) { @@ -399,7 +400,7 @@ public function getForm() * * @param string|null $form Form type. * - * @return $this + * @return self */ public function setForm($form) { @@ -423,7 +424,7 @@ public function getStartDate() * * @param \DateTime|null $start_date Period start date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setStartDate($start_date) { @@ -447,7 +448,7 @@ public function getEndDate() * * @param \DateTime|null $end_date Period end date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setEndDate($end_date) { @@ -471,7 +472,7 @@ public function getFiledDate() * * @param \DateTime|null $filed_date Filed date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setFiledDate($filed_date) { @@ -495,7 +496,7 @@ public function getAcceptedDate() * * @param \DateTime|null $accepted_date Accepted date %Y-%m-%d %H:%M:%S. * - * @return $this + * @return self */ public function setAcceptedDate($accepted_date) { @@ -519,7 +520,7 @@ public function getReport() * * @param object|null $report report * - * @return $this + * @return self */ public function setReport($report) { @@ -544,18 +545,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -580,6 +581,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/RevenueBreakdown.php b/lib/Model/RevenueBreakdown.php new file mode 100644 index 0000000..371dddc --- /dev/null +++ b/lib/Model/RevenueBreakdown.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RevenueBreakdown implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RevenueBreakdown'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'cik' => 'string', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'cik' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'cik' => 'cik', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'cik' => 'setCik', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'cik' => 'getCik', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets cik + * + * @return string|null + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string|null $cik CIK + * + * @return self + */ + public function setCik($cik) + { + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data Array of revenue breakdown over multiple periods. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RevenueEstimates.php b/lib/Model/RevenueEstimates.php index 3f7922f..840c6f6 100644 --- a/lib/Model/RevenueEstimates.php +++ b/lib/Model/RevenueEstimates.php @@ -2,7 +2,7 @@ /** * RevenueEstimates * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class RevenueEstimates implements ModelInterface, ArrayAccess +class RevenueEstimates implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class RevenueEstimates implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'data' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['freq'] = isset($data['freq']) ? $data['freq'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; + $this->container['data'] = $data['data'] ?? null; + $this->container['freq'] = $data['freq'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; } /** @@ -231,7 +232,7 @@ public function getData() * * @param object[]|null $data List of estimates * - * @return $this + * @return self */ public function setData($data) { @@ -255,7 +256,7 @@ public function getFreq() * * @param string|null $freq Frequency: annual or quarterly. * - * @return $this + * @return self */ public function setFreq($freq) { @@ -279,7 +280,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/SECSentimentAnalysis.php b/lib/Model/SECSentimentAnalysis.php new file mode 100644 index 0000000..dd94923 --- /dev/null +++ b/lib/Model/SECSentimentAnalysis.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SECSentimentAnalysis implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SECSentimentAnalysis'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'access_number' => 'string', + 'symbol' => 'string', + 'cik' => 'string', + 'sentiment' => '\Finnhub\Model\FilingSentiment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'access_number' => null, + 'symbol' => null, + 'cik' => null, + 'sentiment' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'access_number' => 'accessNumber', + 'symbol' => 'symbol', + 'cik' => 'cik', + 'sentiment' => 'sentiment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'access_number' => 'setAccessNumber', + 'symbol' => 'setSymbol', + 'cik' => 'setCik', + 'sentiment' => 'setSentiment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'access_number' => 'getAccessNumber', + 'symbol' => 'getSymbol', + 'cik' => 'getCik', + 'sentiment' => 'getSentiment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_number'] = $data['access_number'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['sentiment'] = $data['sentiment'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets access_number + * + * @return string|null + */ + public function getAccessNumber() + { + return $this->container['access_number']; + } + + /** + * Sets access_number + * + * @param string|null $access_number Access number. + * + * @return self + */ + public function setAccessNumber($access_number) + { + $this->container['access_number'] = $access_number; + + return $this; + } + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets cik + * + * @return string|null + */ + public function getCik() + { + return $this->container['cik']; + } + + /** + * Sets cik + * + * @param string|null $cik CIK. + * + * @return self + */ + public function setCik($cik) + { + $this->container['cik'] = $cik; + + return $this; + } + + /** + * Gets sentiment + * + * @return \Finnhub\Model\FilingSentiment|null + */ + public function getSentiment() + { + return $this->container['sentiment']; + } + + /** + * Sets sentiment + * + * @param \Finnhub\Model\FilingSentiment|null $sentiment sentiment + * + * @return self + */ + public function setSentiment($sentiment) + { + $this->container['sentiment'] = $sentiment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Sentiment.php b/lib/Model/Sentiment.php index aa39bba..0ed20d9 100644 --- a/lib/Model/Sentiment.php +++ b/lib/Model/Sentiment.php @@ -2,7 +2,7 @@ /** * Sentiment * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Sentiment implements ModelInterface, ArrayAccess +class Sentiment implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class Sentiment implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'bearish_percent' => 'int64', @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['bearish_percent'] = isset($data['bearish_percent']) ? $data['bearish_percent'] : null; - $this->container['bullish_percent'] = isset($data['bullish_percent']) ? $data['bullish_percent'] : null; + $this->container['bearish_percent'] = $data['bearish_percent'] ?? null; + $this->container['bullish_percent'] = $data['bullish_percent'] ?? null; } /** @@ -225,7 +226,7 @@ public function getBearishPercent() * * @param int|null $bearish_percent * - * @return $this + * @return self */ public function setBearishPercent($bearish_percent) { @@ -249,7 +250,7 @@ public function getBullishPercent() * * @param int|null $bullish_percent * - * @return $this + * @return self */ public function setBullishPercent($bullish_percent) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/SimilarityIndex.php b/lib/Model/SimilarityIndex.php index 7c1edf2..23dbab5 100644 --- a/lib/Model/SimilarityIndex.php +++ b/lib/Model/SimilarityIndex.php @@ -2,7 +2,7 @@ /** * SimilarityIndex * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SimilarityIndex implements ModelInterface, ArrayAccess +class SimilarityIndex implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -66,6 +68,8 @@ class SimilarityIndex implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -168,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['cik'] = isset($data['cik']) ? $data['cik'] : null; - $this->container['similarity'] = isset($data['similarity']) ? $data['similarity'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['cik'] = $data['cik'] ?? null; + $this->container['similarity'] = $data['similarity'] ?? null; } /** @@ -231,7 +232,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -255,7 +256,7 @@ public function getCik() * * @param string|null $cik CIK. * - * @return $this + * @return self */ public function setCik($cik) { @@ -279,7 +280,7 @@ public function getSimilarity() * * @param object[]|null $similarity Array of filings with its cosine similarity compared to the same report of the previous year. * - * @return $this + * @return self */ public function setSimilarity($similarity) { @@ -304,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -340,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/SocialSentiment.php b/lib/Model/SocialSentiment.php new file mode 100644 index 0000000..651950f --- /dev/null +++ b/lib/Model/SocialSentiment.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SocialSentiment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SocialSentiment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'reddit' => 'object[]', + 'twitter' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'reddit' => null, + 'twitter' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'reddit' => 'reddit', + 'twitter' => 'twitter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'reddit' => 'setReddit', + 'twitter' => 'setTwitter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'reddit' => 'getReddit', + 'twitter' => 'getTwitter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['reddit'] = $data['reddit'] ?? null; + $this->container['twitter'] = $data['twitter'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol Company symbol. + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets reddit + * + * @return object[]|null + */ + public function getReddit() + { + return $this->container['reddit']; + } + + /** + * Sets reddit + * + * @param object[]|null $reddit Reddit sentiment. + * + * @return self + */ + public function setReddit($reddit) + { + $this->container['reddit'] = $reddit; + + return $this; + } + + /** + * Gets twitter + * + * @return object[]|null + */ + public function getTwitter() + { + return $this->container['twitter']; + } + + /** + * Sets twitter + * + * @param object[]|null $twitter Twitter sentiment. + * + * @return self + */ + public function setTwitter($twitter) + { + $this->container['twitter'] = $twitter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Split.php b/lib/Model/Split.php index 3d1115a..7353fe7 100644 --- a/lib/Model/Split.php +++ b/lib/Model/Split.php @@ -2,7 +2,7 @@ /** * Split * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Split implements ModelInterface, ArrayAccess +class Split implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +69,8 @@ class Split implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -173,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['from_factor'] = isset($data['from_factor']) ? $data['from_factor'] : null; - $this->container['to_factor'] = isset($data['to_factor']) ? $data['to_factor'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['date'] = $data['date'] ?? null; + $this->container['from_factor'] = $data['from_factor'] ?? null; + $this->container['to_factor'] = $data['to_factor'] ?? null; } /** @@ -237,7 +238,7 @@ public function getSymbol() * * @param string|null $symbol Symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -261,7 +262,7 @@ public function getDate() * * @param \DateTime|null $date Split date. * - * @return $this + * @return self */ public function setDate($date) { @@ -285,7 +286,7 @@ public function getFromFactor() * * @param float|null $from_factor From factor. * - * @return $this + * @return self */ public function setFromFactor($from_factor) { @@ -309,7 +310,7 @@ public function getToFactor() * * @param float|null $to_factor To factor. * - * @return $this + * @return self */ public function setToFactor($to_factor) { @@ -334,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -370,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Stock.php b/lib/Model/Stock.php index 666d172..0850e38 100644 --- a/lib/Model/Stock.php +++ b/lib/Model/Stock.php @@ -2,7 +2,7 @@ /** * Stock * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Stock implements ModelInterface, ArrayAccess +class Stock implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -60,21 +62,21 @@ class Stock implements ModelInterface, ArrayAccess 'description' => 'string', 'display_symbol' => 'string', 'symbol' => 'string', - 'type' => 'string', - 'currency' => 'string' + 'type' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'description' => null, 'display_symbol' => null, 'symbol' => null, - 'type' => null, - 'currency' => null + 'type' => null ]; /** @@ -107,8 +109,7 @@ public static function openAPIFormats() 'description' => 'description', 'display_symbol' => 'displaySymbol', 'symbol' => 'symbol', - 'type' => 'type', - 'currency' => 'currency' + 'type' => 'type' ]; /** @@ -120,8 +121,7 @@ public static function openAPIFormats() 'description' => 'setDescription', 'display_symbol' => 'setDisplaySymbol', 'symbol' => 'setSymbol', - 'type' => 'setType', - 'currency' => 'setCurrency' + 'type' => 'setType' ]; /** @@ -133,8 +133,7 @@ public static function openAPIFormats() 'description' => 'getDescription', 'display_symbol' => 'getDisplaySymbol', 'symbol' => 'getSymbol', - 'type' => 'getType', - 'currency' => 'getCurrency' + 'type' => 'getType' ]; /** @@ -178,9 +177,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['display_symbol'] = isset($data['display_symbol']) ? $data['display_symbol'] : null; - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['description'] = $data['description'] ?? null; + $this->container['display_symbol'] = $data['display_symbol'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['type'] = $data['type'] ?? null; } /** @@ -243,7 +238,7 @@ public function getDescription() * * @param string|null $description Symbol description * - * @return $this + * @return self */ public function setDescription($description) { @@ -267,7 +262,7 @@ public function getDisplaySymbol() * * @param string|null $display_symbol Display symbol name. * - * @return $this + * @return self */ public function setDisplaySymbol($display_symbol) { @@ -291,7 +286,7 @@ public function getSymbol() * * @param string|null $symbol Unique symbol used to identify this symbol used in /stock/candle endpoint. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -315,7 +310,7 @@ public function getType() * * @param string|null $type Security type. * - * @return $this + * @return self */ public function setType($type) { @@ -323,30 +318,6 @@ public function setType($type) return $this; } - - /** - * Gets currency - * - * @return string|null - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param string|null $currency Price's currency. This might be different from the reporting currency of fundamental data. - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -364,18 +335,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +371,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/StockCandles.php b/lib/Model/StockCandles.php index fbcdff1..8e18c3b 100644 --- a/lib/Model/StockCandles.php +++ b/lib/Model/StockCandles.php @@ -2,7 +2,7 @@ /** * StockCandles * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StockCandles implements ModelInterface, ArrayAccess +class StockCandles implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -70,6 +72,8 @@ class StockCandles implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'o' => 'float', @@ -188,9 +192,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -207,13 +208,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['o'] = isset($data['o']) ? $data['o'] : null; - $this->container['h'] = isset($data['h']) ? $data['h'] : null; - $this->container['l'] = isset($data['l']) ? $data['l'] : null; - $this->container['c'] = isset($data['c']) ? $data['c'] : null; - $this->container['v'] = isset($data['v']) ? $data['v'] : null; - $this->container['t'] = isset($data['t']) ? $data['t'] : null; - $this->container['s'] = isset($data['s']) ? $data['s'] : null; + $this->container['o'] = $data['o'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['l'] = $data['l'] ?? null; + $this->container['c'] = $data['c'] ?? null; + $this->container['v'] = $data['v'] ?? null; + $this->container['t'] = $data['t'] ?? null; + $this->container['s'] = $data['s'] ?? null; } /** @@ -255,7 +256,7 @@ public function getO() * * @param float[]|null $o List of open prices for returned candles. * - * @return $this + * @return self */ public function setO($o) { @@ -279,7 +280,7 @@ public function getH() * * @param float[]|null $h List of high prices for returned candles. * - * @return $this + * @return self */ public function setH($h) { @@ -303,7 +304,7 @@ public function getL() * * @param float[]|null $l List of low prices for returned candles. * - * @return $this + * @return self */ public function setL($l) { @@ -327,7 +328,7 @@ public function getC() * * @param float[]|null $c List of close prices for returned candles. * - * @return $this + * @return self */ public function setC($c) { @@ -351,7 +352,7 @@ public function getV() * * @param float[]|null $v List of volume data for returned candles. * - * @return $this + * @return self */ public function setV($v) { @@ -375,7 +376,7 @@ public function getT() * * @param int[]|null $t List of timestamp for returned candles. * - * @return $this + * @return self */ public function setT($t) { @@ -399,7 +400,7 @@ public function getS() * * @param string|null $s Status of the response. This field can either be ok or no_data. * - * @return $this + * @return self */ public function setS($s) { @@ -424,18 +425,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -460,6 +461,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/StockTranscripts.php b/lib/Model/StockTranscripts.php index f377f42..e67953b 100644 --- a/lib/Model/StockTranscripts.php +++ b/lib/Model/StockTranscripts.php @@ -2,7 +2,7 @@ /** * StockTranscripts * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class StockTranscripts implements ModelInterface, ArrayAccess +class StockTranscripts implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +70,8 @@ class StockTranscripts implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -178,9 +182,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +198,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['year'] = isset($data['year']) ? $data['year'] : null; - $this->container['quarter'] = isset($data['quarter']) ? $data['quarter'] : null; + $this->container['id'] = $data['id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['time'] = $data['time'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -243,7 +244,7 @@ public function getId() * * @param string|null $id Transcript's ID used to get the full transcript. * - * @return $this + * @return self */ public function setId($id) { @@ -267,7 +268,7 @@ public function getTitle() * * @param string|null $title Title. * - * @return $this + * @return self */ public function setTitle($title) { @@ -291,7 +292,7 @@ public function getTime() * * @param \DateTime|null $time Time of the event. * - * @return $this + * @return self */ public function setTime($time) { @@ -315,7 +316,7 @@ public function getYear() * * @param int|null $year Year of earnings result in the case of earnings call transcript. * - * @return $this + * @return self */ public function setYear($year) { @@ -339,7 +340,7 @@ public function getQuarter() * * @param int|null $quarter Quarter of earnings result in the case of earnings call transcript. * - * @return $this + * @return self */ public function setQuarter($quarter) { @@ -364,18 +365,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -400,6 +401,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/SupplyChainRelationships.php b/lib/Model/SupplyChainRelationships.php new file mode 100644 index 0000000..752e3d5 --- /dev/null +++ b/lib/Model/SupplyChainRelationships.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SupplyChainRelationships implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyChainRelationships'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'symbol' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'symbol' => 'symbol', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol symbol + * + * @return self + */ + public function setSymbol($symbol) + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data Key customers and suppliers. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SupportResistance.php b/lib/Model/SupportResistance.php index f16f5a6..d130cf1 100644 --- a/lib/Model/SupportResistance.php +++ b/lib/Model/SupportResistance.php @@ -2,7 +2,7 @@ /** * SupportResistance * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class SupportResistance implements ModelInterface, ArrayAccess +class SupportResistance implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,6 +66,8 @@ class SupportResistance implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'levels' => 'float' @@ -158,9 +162,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['levels'] = isset($data['levels']) ? $data['levels'] : null; + $this->container['levels'] = $data['levels'] ?? null; } /** @@ -219,7 +220,7 @@ public function getLevels() * * @param float[]|null $levels Array of support and resistance levels. * - * @return $this + * @return self */ public function setLevels($levels) { @@ -244,18 +245,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -280,6 +281,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/SymbolLookup.php b/lib/Model/SymbolLookup.php new file mode 100644 index 0000000..dca8ccd --- /dev/null +++ b/lib/Model/SymbolLookup.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SymbolLookup implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SymbolLookup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'result' => 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result' => 'result', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result' => 'setResult', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result' => 'getResult', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result'] = $data['result'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return object[]|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param object[]|null $result Array of search results. + * + * @return self + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count Number of results. + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TechnicalAnalysis.php b/lib/Model/TechnicalAnalysis.php index 088f038..d4fd920 100644 --- a/lib/Model/TechnicalAnalysis.php +++ b/lib/Model/TechnicalAnalysis.php @@ -2,7 +2,7 @@ /** * TechnicalAnalysis * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class TechnicalAnalysis implements ModelInterface, ArrayAccess +class TechnicalAnalysis implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class TechnicalAnalysis implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'count' => null, @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['count'] = isset($data['count']) ? $data['count'] : null; - $this->container['signal'] = isset($data['signal']) ? $data['signal'] : null; + $this->container['count'] = $data['count'] ?? null; + $this->container['signal'] = $data['signal'] ?? null; } /** @@ -225,7 +226,7 @@ public function getCount() * * @param \Finnhub\Model\Indicator|null $count count * - * @return $this + * @return self */ public function setCount($count) { @@ -249,7 +250,7 @@ public function getSignal() * * @param string|null $signal Aggregate Signal * - * @return $this + * @return self */ public function setSignal($signal) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/TickData.php b/lib/Model/TickData.php index e959806..1b95b19 100644 --- a/lib/Model/TickData.php +++ b/lib/Model/TickData.php @@ -2,7 +2,7 @@ /** * TickData * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class TickData implements ModelInterface, ArrayAccess +class TickData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,13 +66,16 @@ class TickData implements ModelInterface, ArrayAccess 'v' => 'float[]', 'p' => 'float[]', 't' => 'int[]', - 'x' => 'string[]' + 'x' => 'string[]', + 'c' => 'string[][]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 's' => null, @@ -80,7 +85,8 @@ class TickData implements ModelInterface, ArrayAccess 'v' => 'float', 'p' => 'float', 't' => 'int64', - 'x' => null + 'x' => null, + 'c' => null ]; /** @@ -117,7 +123,8 @@ public static function openAPIFormats() 'v' => 'v', 'p' => 'p', 't' => 't', - 'x' => 'x' + 'x' => 'x', + 'c' => 'c' ]; /** @@ -133,7 +140,8 @@ public static function openAPIFormats() 'v' => 'setV', 'p' => 'setP', 't' => 'setT', - 'x' => 'setX' + 'x' => 'setX', + 'c' => 'setC' ]; /** @@ -149,7 +157,8 @@ public static function openAPIFormats() 'v' => 'getV', 'p' => 'getP', 't' => 'getT', - 'x' => 'getX' + 'x' => 'getX', + 'c' => 'getC' ]; /** @@ -193,9 +202,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -212,14 +218,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['s'] = isset($data['s']) ? $data['s'] : null; - $this->container['skip'] = isset($data['skip']) ? $data['skip'] : null; - $this->container['count'] = isset($data['count']) ? $data['count'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['v'] = isset($data['v']) ? $data['v'] : null; - $this->container['p'] = isset($data['p']) ? $data['p'] : null; - $this->container['t'] = isset($data['t']) ? $data['t'] : null; - $this->container['x'] = isset($data['x']) ? $data['x'] : null; + $this->container['s'] = $data['s'] ?? null; + $this->container['skip'] = $data['skip'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['total'] = $data['total'] ?? null; + $this->container['v'] = $data['v'] ?? null; + $this->container['p'] = $data['p'] ?? null; + $this->container['t'] = $data['t'] ?? null; + $this->container['x'] = $data['x'] ?? null; + $this->container['c'] = $data['c'] ?? null; } /** @@ -261,7 +268,7 @@ public function getS() * * @param string|null $s Symbol. * - * @return $this + * @return self */ public function setS($s) { @@ -285,7 +292,7 @@ public function getSkip() * * @param int|null $skip Number of ticks skipped. * - * @return $this + * @return self */ public function setSkip($skip) { @@ -309,7 +316,7 @@ public function getCount() * * @param int|null $count Number of ticks returned. If count < limit, all data for that date has been returned. * - * @return $this + * @return self */ public function setCount($count) { @@ -333,7 +340,7 @@ public function getTotal() * * @param int|null $total Total number of ticks for that date. * - * @return $this + * @return self */ public function setTotal($total) { @@ -357,7 +364,7 @@ public function getV() * * @param float[]|null $v List of volume data. * - * @return $this + * @return self */ public function setV($v) { @@ -381,7 +388,7 @@ public function getP() * * @param float[]|null $p List of price data. * - * @return $this + * @return self */ public function setP($p) { @@ -405,7 +412,7 @@ public function getT() * * @param int[]|null $t List of timestamp in UNIX ms. * - * @return $this + * @return self */ public function setT($t) { @@ -427,9 +434,9 @@ public function getX() /** * Sets x * - * @param string[]|null $x List of venues/exchanges. + * @param string[]|null $x List of venues/exchanges. A list of exchange codes can be found here * - * @return $this + * @return self */ public function setX($x) { @@ -437,6 +444,30 @@ public function setX($x) return $this; } + + /** + * Gets c + * + * @return string[][]|null + */ + public function getC() + { + return $this->container['c']; + } + + /** + * Sets c + * + * @param string[][]|null $c List of trade conditions. A comprehensive list of trade conditions code can be found here + * + * @return self + */ + public function setC($c) + { + $this->container['c'] = $c; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -454,18 +485,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -490,6 +521,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Transactions.php b/lib/Model/Transactions.php new file mode 100644 index 0000000..900719b --- /dev/null +++ b/lib/Model/Transactions.php @@ -0,0 +1,500 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Transactions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Transactions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'share' => 'int', + 'change' => 'int', + 'filing_date' => '\DateTime', + 'transaction_date' => '\DateTime', + 'transaction_price' => 'float', + 'transaction_code' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'share' => 'int64', + 'change' => 'int64', + 'filing_date' => 'date', + 'transaction_date' => 'date', + 'transaction_price' => 'float', + 'transaction_code' => 'date' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'share' => 'share', + 'change' => 'change', + 'filing_date' => 'filingDate', + 'transaction_date' => 'transactionDate', + 'transaction_price' => 'transactionPrice', + 'transaction_code' => 'transactionCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'share' => 'setShare', + 'change' => 'setChange', + 'filing_date' => 'setFilingDate', + 'transaction_date' => 'setTransactionDate', + 'transaction_price' => 'setTransactionPrice', + 'transaction_code' => 'setTransactionCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'share' => 'getShare', + 'change' => 'getChange', + 'filing_date' => 'getFilingDate', + 'transaction_date' => 'getTransactionDate', + 'transaction_price' => 'getTransactionPrice', + 'transaction_code' => 'getTransactionCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['share'] = $data['share'] ?? null; + $this->container['change'] = $data['change'] ?? null; + $this->container['filing_date'] = $data['filing_date'] ?? null; + $this->container['transaction_date'] = $data['transaction_date'] ?? null; + $this->container['transaction_price'] = $data['transaction_price'] ?? null; + $this->container['transaction_code'] = $data['transaction_code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Insider's name. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets share + * + * @return int|null + */ + public function getShare() + { + return $this->container['share']; + } + + /** + * Sets share + * + * @param int|null $share Number of shares held after the transaction. + * + * @return self + */ + public function setShare($share) + { + $this->container['share'] = $share; + + return $this; + } + + /** + * Gets change + * + * @return int|null + */ + public function getChange() + { + return $this->container['change']; + } + + /** + * Sets change + * + * @param int|null $change Number of share changed from the last period. A positive value suggests a BUY transaction. A negative value suggests a SELL transaction. + * + * @return self + */ + public function setChange($change) + { + $this->container['change'] = $change; + + return $this; + } + + /** + * Gets filing_date + * + * @return \DateTime|null + */ + public function getFilingDate() + { + return $this->container['filing_date']; + } + + /** + * Sets filing_date + * + * @param \DateTime|null $filing_date Filing date. + * + * @return self + */ + public function setFilingDate($filing_date) + { + $this->container['filing_date'] = $filing_date; + + return $this; + } + + /** + * Gets transaction_date + * + * @return \DateTime|null + */ + public function getTransactionDate() + { + return $this->container['transaction_date']; + } + + /** + * Sets transaction_date + * + * @param \DateTime|null $transaction_date Transaction date. + * + * @return self + */ + public function setTransactionDate($transaction_date) + { + $this->container['transaction_date'] = $transaction_date; + + return $this; + } + + /** + * Gets transaction_price + * + * @return float|null + */ + public function getTransactionPrice() + { + return $this->container['transaction_price']; + } + + /** + * Sets transaction_price + * + * @param float|null $transaction_price Average transaction price. + * + * @return self + */ + public function setTransactionPrice($transaction_price) + { + $this->container['transaction_price'] = $transaction_price; + + return $this; + } + + /** + * Gets transaction_code + * + * @return \DateTime|null + */ + public function getTransactionCode() + { + return $this->container['transaction_code']; + } + + /** + * Sets transaction_code + * + * @param \DateTime|null $transaction_code Transaction code. A list of codes and their meanings can be found here. + * + * @return self + */ + public function setTransactionCode($transaction_code) + { + $this->container['transaction_code'] = $transaction_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TranscriptContent.php b/lib/Model/TranscriptContent.php index be38c56..a57187b 100644 --- a/lib/Model/TranscriptContent.php +++ b/lib/Model/TranscriptContent.php @@ -2,7 +2,7 @@ /** * TranscriptContent * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class TranscriptContent implements ModelInterface, ArrayAccess +class TranscriptContent implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,17 +60,21 @@ class TranscriptContent implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', - 'speech' => 'string[]' + 'speech' => 'string[]', + 'session' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null, - 'speech' => null + 'speech' => null, + 'session' => null ]; /** @@ -99,7 +105,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'speech' => 'speech' + 'speech' => 'speech', + 'session' => 'session' ]; /** @@ -109,7 +116,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', - 'speech' => 'setSpeech' + 'speech' => 'setSpeech', + 'session' => 'setSession' ]; /** @@ -119,7 +127,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', - 'speech' => 'getSpeech' + 'speech' => 'getSpeech', + 'session' => 'getSession' ]; /** @@ -163,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['speech'] = isset($data['speech']) ? $data['speech'] : null; + $this->container['name'] = $data['name'] ?? null; + $this->container['speech'] = $data['speech'] ?? null; + $this->container['session'] = $data['session'] ?? null; } /** @@ -225,7 +232,7 @@ public function getName() * * @param string|null $name Speaker's name * - * @return $this + * @return self */ public function setName($name) { @@ -249,7 +256,7 @@ public function getSpeech() * * @param string[]|null $speech Speaker's speech * - * @return $this + * @return self */ public function setSpeech($speech) { @@ -257,6 +264,30 @@ public function setSpeech($speech) return $this; } + + /** + * Gets session + * + * @return string|null + */ + public function getSession() + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param string|null $session Earnings calls section (management discussion or Q&A) + * + * @return self + */ + public function setSession($session) + { + $this->container['session'] = $session; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -274,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/TranscriptParticipant.php b/lib/Model/TranscriptParticipant.php index 3c4eedc..17c08dc 100644 --- a/lib/Model/TranscriptParticipant.php +++ b/lib/Model/TranscriptParticipant.php @@ -2,7 +2,7 @@ /** * TranscriptParticipant * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class TranscriptParticipant implements ModelInterface, ArrayAccess +class TranscriptParticipant implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,17 +60,21 @@ class TranscriptParticipant implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', - 'description' => 'string' + 'description' => 'string', + 'role' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null, - 'description' => null + 'description' => null, + 'role' => null ]; /** @@ -99,7 +105,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'description' => 'description' + 'description' => 'description', + 'role' => 'role' ]; /** @@ -109,7 +116,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', - 'description' => 'setDescription' + 'description' => 'setDescription', + 'role' => 'setRole' ]; /** @@ -119,7 +127,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', - 'description' => 'getDescription' + 'description' => 'getDescription', + 'role' => 'getRole' ]; /** @@ -163,9 +172,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['role'] = $data['role'] ?? null; } /** @@ -225,7 +232,7 @@ public function getName() * * @param string|null $name Participant's name * - * @return $this + * @return self */ public function setName($name) { @@ -249,7 +256,7 @@ public function getDescription() * * @param string|null $description Participant's description * - * @return $this + * @return self */ public function setDescription($description) { @@ -257,6 +264,30 @@ public function setDescription($description) return $this; } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role Whether the speak is a company's executive or an analyst + * + * @return self + */ + public function setRole($role) + { + $this->container['role'] = $role; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -274,18 +305,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +341,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/Trend.php b/lib/Model/Trend.php index e96e122..a44a08c 100644 --- a/lib/Model/Trend.php +++ b/lib/Model/Trend.php @@ -2,7 +2,7 @@ /** * Trend * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class Trend implements ModelInterface, ArrayAccess +class Trend implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,6 +67,8 @@ class Trend implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'adx' => 'float', @@ -163,9 +167,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['adx'] = isset($data['adx']) ? $data['adx'] : null; - $this->container['trending'] = isset($data['trending']) ? $data['trending'] : null; + $this->container['adx'] = $data['adx'] ?? null; + $this->container['trending'] = $data['trending'] ?? null; } /** @@ -225,7 +226,7 @@ public function getAdx() * * @param float|null $adx ADX reading * - * @return $this + * @return self */ public function setAdx($adx) { @@ -249,7 +250,7 @@ public function getTrending() * * @param bool|null $trending Whether market is trending or going sideway * - * @return $this + * @return self */ public function setTrending($trending) { @@ -274,18 +275,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -310,6 +311,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/Model/TwitterSentimentContent.php b/lib/Model/TwitterSentimentContent.php new file mode 100644 index 0000000..13a0fba --- /dev/null +++ b/lib/Model/TwitterSentimentContent.php @@ -0,0 +1,500 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TwitterSentimentContent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TwitterSentimentContent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mention' => 'int', + 'positive_mention' => 'int', + 'negative_mention' => 'int', + 'positive_score' => 'float', + 'negative_score' => 'float', + 'score' => 'float', + 'at_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mention' => 'int64', + 'positive_mention' => 'int64', + 'negative_mention' => 'int64', + 'positive_score' => 'float', + 'negative_score' => 'float', + 'score' => 'float', + 'at_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mention' => 'mention', + 'positive_mention' => 'positiveMention', + 'negative_mention' => 'negativeMention', + 'positive_score' => 'positiveScore', + 'negative_score' => 'negativeScore', + 'score' => 'score', + 'at_time' => 'atTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mention' => 'setMention', + 'positive_mention' => 'setPositiveMention', + 'negative_mention' => 'setNegativeMention', + 'positive_score' => 'setPositiveScore', + 'negative_score' => 'setNegativeScore', + 'score' => 'setScore', + 'at_time' => 'setAtTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mention' => 'getMention', + 'positive_mention' => 'getPositiveMention', + 'negative_mention' => 'getNegativeMention', + 'positive_score' => 'getPositiveScore', + 'negative_score' => 'getNegativeScore', + 'score' => 'getScore', + 'at_time' => 'getAtTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['mention'] = $data['mention'] ?? null; + $this->container['positive_mention'] = $data['positive_mention'] ?? null; + $this->container['negative_mention'] = $data['negative_mention'] ?? null; + $this->container['positive_score'] = $data['positive_score'] ?? null; + $this->container['negative_score'] = $data['negative_score'] ?? null; + $this->container['score'] = $data['score'] ?? null; + $this->container['at_time'] = $data['at_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mention + * + * @return int|null + */ + public function getMention() + { + return $this->container['mention']; + } + + /** + * Sets mention + * + * @param int|null $mention Number of mentions + * + * @return self + */ + public function setMention($mention) + { + $this->container['mention'] = $mention; + + return $this; + } + + /** + * Gets positive_mention + * + * @return int|null + */ + public function getPositiveMention() + { + return $this->container['positive_mention']; + } + + /** + * Sets positive_mention + * + * @param int|null $positive_mention Number of positive mentions + * + * @return self + */ + public function setPositiveMention($positive_mention) + { + $this->container['positive_mention'] = $positive_mention; + + return $this; + } + + /** + * Gets negative_mention + * + * @return int|null + */ + public function getNegativeMention() + { + return $this->container['negative_mention']; + } + + /** + * Sets negative_mention + * + * @param int|null $negative_mention Number of negative mentions + * + * @return self + */ + public function setNegativeMention($negative_mention) + { + $this->container['negative_mention'] = $negative_mention; + + return $this; + } + + /** + * Gets positive_score + * + * @return float|null + */ + public function getPositiveScore() + { + return $this->container['positive_score']; + } + + /** + * Sets positive_score + * + * @param float|null $positive_score Positive score. Range 0-1 + * + * @return self + */ + public function setPositiveScore($positive_score) + { + $this->container['positive_score'] = $positive_score; + + return $this; + } + + /** + * Gets negative_score + * + * @return float|null + */ + public function getNegativeScore() + { + return $this->container['negative_score']; + } + + /** + * Sets negative_score + * + * @param float|null $negative_score Negative score. Range 0-1 + * + * @return self + */ + public function setNegativeScore($negative_score) + { + $this->container['negative_score'] = $negative_score; + + return $this; + } + + /** + * Gets score + * + * @return float|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param float|null $score Final score. Range: -1 to 1 with 1 is very positive and -1 is very negative + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets at_time + * + * @return \DateTime|null + */ + public function getAtTime() + { + return $this->container['at_time']; + } + + /** + * Sets at_time + * + * @param \DateTime|null $at_time Period. + * + * @return self + */ + public function setAtTime($at_time) + { + $this->container['at_time'] = $at_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpgradeDowngrade.php b/lib/Model/UpgradeDowngrade.php index eb9aebb..1041194 100644 --- a/lib/Model/UpgradeDowngrade.php +++ b/lib/Model/UpgradeDowngrade.php @@ -2,7 +2,7 @@ /** * UpgradeDowngrade * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -39,10 +38,13 @@ * @package Finnhub * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null */ -class UpgradeDowngrade implements ModelInterface, ArrayAccess +class UpgradeDowngrade implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +71,8 @@ class UpgradeDowngrade implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'symbol' => null, @@ -183,9 +187,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +203,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null; - $this->container['grade_time'] = isset($data['grade_time']) ? $data['grade_time'] : null; - $this->container['from_grade'] = isset($data['from_grade']) ? $data['from_grade'] : null; - $this->container['to_grade'] = isset($data['to_grade']) ? $data['to_grade'] : null; - $this->container['company'] = isset($data['company']) ? $data['company'] : null; - $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['grade_time'] = $data['grade_time'] ?? null; + $this->container['from_grade'] = $data['from_grade'] ?? null; + $this->container['to_grade'] = $data['to_grade'] ?? null; + $this->container['company'] = $data['company'] ?? null; + $this->container['action'] = $data['action'] ?? null; } /** @@ -249,7 +250,7 @@ public function getSymbol() * * @param string|null $symbol Company symbol. * - * @return $this + * @return self */ public function setSymbol($symbol) { @@ -273,7 +274,7 @@ public function getGradeTime() * * @param int|null $grade_time Upgrade/downgrade time in UNIX timestamp. * - * @return $this + * @return self */ public function setGradeTime($grade_time) { @@ -297,7 +298,7 @@ public function getFromGrade() * * @param string|null $from_grade From grade. * - * @return $this + * @return self */ public function setFromGrade($from_grade) { @@ -321,7 +322,7 @@ public function getToGrade() * * @param string|null $to_grade To grade. * - * @return $this + * @return self */ public function setToGrade($to_grade) { @@ -345,7 +346,7 @@ public function getCompany() * * @param string|null $company Company/analyst who did the upgrade/downgrade. * - * @return $this + * @return self */ public function setCompany($company) { @@ -369,7 +370,7 @@ public function getAction() * * @param string|null $action Action can take any of the following values: up(upgrade), down(downgrade), main(maintains), init(initiate), reit(reiterate). * - * @return $this + * @return self */ public function setAction($action) { @@ -394,18 +395,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -430,6 +431,18 @@ public function offsetUnset($offset) unset($this->container[$offset]); } + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 81977ac..f03ef48 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 5 + * PHP version 7.2 * * @category Class * @package Finnhub @@ -16,9 +16,8 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 - * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.3.1 + * OpenAPI Generator version: 5.2.0 */ /** @@ -61,32 +60,42 @@ public static function setDateTimeFormat($format) * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return string|object serialized form of $data + * @return scalar|object|array|null serialized form of $data */ public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; - } elseif ($data instanceof \DateTime) { + } + + if ($data instanceof \DateTime) { return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); - } elseif (is_array($data)) { + } + + if (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } elseif (is_object($data)) { + } + + if (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ($value !== null && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } } if ($value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); @@ -163,8 +172,9 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - if (method_exists($value, 'toHeaderValue')) { - return $value->toHeaderValue(); + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); } return self::toString($value); @@ -202,7 +212,7 @@ public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format return $value->format(self::$dateTimeFormat); - } else if (is_bool($value)) { + } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { return $value; @@ -260,7 +270,24 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -273,18 +300,14 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { + } + + if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === '\DateTime') { + } + + if ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -292,14 +315,27 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - return new \DateTime($data); + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } elseif ($class === '\SplFileObject') { + } + + if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -333,6 +369,8 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } + + /** @var ModelInterface $instance */ $instance = new $class(); foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; @@ -341,8 +379,8 @@ public static function deserialize($data, $class, $httpHeaders = null) continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } diff --git a/test/Model/BreakdownItemTest.php b/test/Model/BreakdownItemTest.php new file mode 100644 index 0000000..f1e0d80 --- /dev/null +++ b/test/Model/BreakdownItemTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "access_number" + */ + public function testPropertyAccessNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "breakdown" + */ + public function testPropertyBreakdown() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/Dividends2BasicTest.php b/test/Model/Dividends2BasicTest.php new file mode 100644 index 0000000..3862b4d --- /dev/null +++ b/test/Model/Dividends2BasicTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ETFCountryExposureDataTest.php b/test/Model/ETFCountryExposureDataTest.php new file mode 100644 index 0000000..6d9bce7 --- /dev/null +++ b/test/Model/ETFCountryExposureDataTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exposure" + */ + public function testPropertyExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ETFHoldingsDataTest.php b/test/Model/ETFHoldingsDataTest.php new file mode 100644 index 0000000..4ed26f0 --- /dev/null +++ b/test/Model/ETFHoldingsDataTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "isin" + */ + public function testPropertyIsin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cusip" + */ + public function testPropertyCusip() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share" + */ + public function testPropertyShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percent" + */ + public function testPropertyPercent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ETFProfileDataTest.php b/test/Model/ETFProfileDataTest.php new file mode 100644 index 0000000..515e5b7 --- /dev/null +++ b/test/Model/ETFProfileDataTest.php @@ -0,0 +1,243 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_class" + */ + public function testPropertyAssetClass() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "investment_segment" + */ + public function testPropertyInvestmentSegment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aum" + */ + public function testPropertyAum() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nav" + */ + public function testPropertyNav() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nav_currency" + */ + public function testPropertyNavCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expense_ratio" + */ + public function testPropertyExpenseRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tracking_index" + */ + public function testPropertyTrackingIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "etf_company" + */ + public function testPropertyEtfCompany() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "domicile" + */ + public function testPropertyDomicile() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "inception_date" + */ + public function testPropertyInceptionDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "website" + */ + public function testPropertyWebsite() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "isin" + */ + public function testPropertyIsin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cusip" + */ + public function testPropertyCusip() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_to_earnings" + */ + public function testPropertyPriceToEarnings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price_to_book" + */ + public function testPropertyPriceToBook() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "avg_volume" + */ + public function testPropertyAvgVolume() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ETFSectorExposureDataTest.php b/test/Model/ETFSectorExposureDataTest.php new file mode 100644 index 0000000..96f45f1 --- /dev/null +++ b/test/Model/ETFSectorExposureDataTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "industry" + */ + public function testPropertyIndustry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exposure" + */ + public function testPropertyExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ETFsSectorExposureTest.php b/test/Model/ETFsSectorExposureTest.php new file mode 100644 index 0000000..d16a949 --- /dev/null +++ b/test/Model/ETFsSectorExposureTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sector_exposure" + */ + public function testPropertySectorExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FDAComitteeMeetingTest.php b/test/Model/FDAComitteeMeetingTest.php new file mode 100644 index 0000000..93a2788 --- /dev/null +++ b/test/Model/FDAComitteeMeetingTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from_date" + */ + public function testPropertyFromDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to_date" + */ + public function testPropertyToDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_description" + */ + public function testPropertyEventDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FilingSentimentTest.php b/test/Model/FilingSentimentTest.php new file mode 100644 index 0000000..fb56c9c --- /dev/null +++ b/test/Model/FilingSentimentTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative" + */ + public function testPropertyNegative() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive" + */ + public function testPropertyPositive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "polarity" + */ + public function testPropertyPolarity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "litigious" + */ + public function testPropertyLitigious() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uncertainty" + */ + public function testPropertyUncertainty() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "constraining" + */ + public function testPropertyConstraining() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "modal_weak" + */ + public function testPropertyModalWeak() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "modal_strong" + */ + public function testPropertyModalStrong() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "modal_moderate" + */ + public function testPropertyModalModerate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/HistoricalNBBOTest.php b/test/Model/HistoricalNBBOTest.php new file mode 100644 index 0000000..b1ebe62 --- /dev/null +++ b/test/Model/HistoricalNBBOTest.php @@ -0,0 +1,189 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "s" + */ + public function testPropertyS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "skip" + */ + public function testPropertySkip() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "av" + */ + public function testPropertyAv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "a" + */ + public function testPropertyA() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ax" + */ + public function testPropertyAx() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bv" + */ + public function testPropertyBv() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "b" + */ + public function testPropertyB() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bx" + */ + public function testPropertyBx() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "c" + */ + public function testPropertyC() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InsiderTransactionsTest.php b/test/Model/InsiderTransactionsTest.php new file mode 100644 index 0000000..56e66c8 --- /dev/null +++ b/test/Model/InsiderTransactionsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InternationalFilingTest.php b/test/Model/InternationalFilingTest.php new file mode 100644 index 0000000..9ec9c20 --- /dev/null +++ b/test/Model/InternationalFilingTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "company_name" + */ + public function testPropertyCompanyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filed_date" + */ + public function testPropertyFiledDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "category" + */ + public function testPropertyCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language" + */ + public function testPropertyLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InvestmentThemePortfolioTest.php b/test/Model/InvestmentThemePortfolioTest.php new file mode 100644 index 0000000..decf6a7 --- /dev/null +++ b/test/Model/InvestmentThemePortfolioTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InvestmentThemesThematicInvestingTest.php b/test/Model/InvestmentThemesThematicInvestingTest.php new file mode 100644 index 0000000..0962af7 --- /dev/null +++ b/test/Model/InvestmentThemesThematicInvestingTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "theme" + */ + public function testPropertyTheme() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/KeyCustomersSuppliersTest.php b/test/Model/KeyCustomersSuppliersTest.php new file mode 100644 index 0000000..be24784 --- /dev/null +++ b/test/Model/KeyCustomersSuppliersTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer" + */ + public function testPropertyCustomer() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "supplier" + */ + public function testPropertySupplier() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MajorPressReleasesTest.php b/test/Model/MajorPressReleasesTest.php new file mode 100644 index 0000000..7bdd03e --- /dev/null +++ b/test/Model/MajorPressReleasesTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "major_development" + */ + public function testPropertyMajorDevelopment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundCountryExposureDataTest.php b/test/Model/MutualFundCountryExposureDataTest.php new file mode 100644 index 0000000..330fd76 --- /dev/null +++ b/test/Model/MutualFundCountryExposureDataTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country" + */ + public function testPropertyCountry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exposure" + */ + public function testPropertyExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundSectorExposureDataTest.php b/test/Model/MutualFundSectorExposureDataTest.php new file mode 100644 index 0000000..71824b1 --- /dev/null +++ b/test/Model/MutualFundSectorExposureDataTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sector" + */ + public function testPropertySector() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exposure" + */ + public function testPropertyExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundSectorExposureTest.php b/test/Model/MutualFundSectorExposureTest.php new file mode 100644 index 0000000..e52682f --- /dev/null +++ b/test/Model/MutualFundSectorExposureTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sector_exposure" + */ + public function testPropertySectorExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundsCountryExposureTest.php b/test/Model/MutualFundsCountryExposureTest.php new file mode 100644 index 0000000..e5ab9bb --- /dev/null +++ b/test/Model/MutualFundsCountryExposureTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_exposure" + */ + public function testPropertyCountryExposure() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundsHoldingsTest.php b/test/Model/MutualFundsHoldingsTest.php new file mode 100644 index 0000000..c7ed19d --- /dev/null +++ b/test/Model/MutualFundsHoldingsTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "at_date" + */ + public function testPropertyAtDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number_of_holdings" + */ + public function testPropertyNumberOfHoldings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "holdings" + */ + public function testPropertyHoldings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MutualFundsProfileTest.php b/test/Model/MutualFundsProfileTest.php new file mode 100644 index 0000000..1b2ecf3 --- /dev/null +++ b/test/Model/MutualFundsProfileTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "profile" + */ + public function testPropertyProfile() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OwnershipTest.php b/test/Model/OwnershipTest.php new file mode 100644 index 0000000..b7436ab --- /dev/null +++ b/test/Model/OwnershipTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ownership" + */ + public function testPropertyOwnership() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RedditSentimentContentTest.php b/test/Model/RedditSentimentContentTest.php new file mode 100644 index 0000000..39a1306 --- /dev/null +++ b/test/Model/RedditSentimentContentTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mention" + */ + public function testPropertyMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive_mention" + */ + public function testPropertyPositiveMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_mention" + */ + public function testPropertyNegativeMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive_score" + */ + public function testPropertyPositiveScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_score" + */ + public function testPropertyNegativeScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "score" + */ + public function testPropertyScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "at_time" + */ + public function testPropertyAtTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RevenueBreakdownTest.php b/test/Model/RevenueBreakdownTest.php new file mode 100644 index 0000000..f4c9163 --- /dev/null +++ b/test/Model/RevenueBreakdownTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SECSentimentAnalysisTest.php b/test/Model/SECSentimentAnalysisTest.php new file mode 100644 index 0000000..49d5b77 --- /dev/null +++ b/test/Model/SECSentimentAnalysisTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "access_number" + */ + public function testPropertyAccessNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cik" + */ + public function testPropertyCik() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sentiment" + */ + public function testPropertySentiment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SocialSentimentTest.php b/test/Model/SocialSentimentTest.php new file mode 100644 index 0000000..1a56329 --- /dev/null +++ b/test/Model/SocialSentimentTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reddit" + */ + public function testPropertyReddit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "twitter" + */ + public function testPropertyTwitter() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SupplyChainRelationshipsTest.php b/test/Model/SupplyChainRelationshipsTest.php new file mode 100644 index 0000000..4cb8419 --- /dev/null +++ b/test/Model/SupplyChainRelationshipsTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SymbolLookupTest.php b/test/Model/SymbolLookupTest.php new file mode 100644 index 0000000..1230607 --- /dev/null +++ b/test/Model/SymbolLookupTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "result" + */ + public function testPropertyResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TransactionsTest.php b/test/Model/TransactionsTest.php new file mode 100644 index 0000000..722fb1c --- /dev/null +++ b/test/Model/TransactionsTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "share" + */ + public function testPropertyShare() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "change" + */ + public function testPropertyChange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filing_date" + */ + public function testPropertyFilingDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transaction_date" + */ + public function testPropertyTransactionDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transaction_price" + */ + public function testPropertyTransactionPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transaction_code" + */ + public function testPropertyTransactionCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TwitterSentimentContentTest.php b/test/Model/TwitterSentimentContentTest.php new file mode 100644 index 0000000..dd3a836 --- /dev/null +++ b/test/Model/TwitterSentimentContentTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mention" + */ + public function testPropertyMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive_mention" + */ + public function testPropertyPositiveMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_mention" + */ + public function testPropertyNegativeMention() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive_score" + */ + public function testPropertyPositiveScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_score" + */ + public function testPropertyNegativeScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "score" + */ + public function testPropertyScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "at_time" + */ + public function testPropertyAtTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +}