diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c2cb3d3..2306868 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -76,6 +76,7 @@ docs/Model/InFilingSearchBody.md docs/Model/IndexHistoricalConstituent.md docs/Model/Indicator.md docs/Model/IndicesConstituents.md +docs/Model/IndicesConstituentsBreakdown.md docs/Model/IndicesHistoricalConstituents.md docs/Model/InsiderSentiments.md docs/Model/InsiderSentimentsData.md @@ -97,7 +98,10 @@ docs/Model/KeyCustomersSuppliers.md docs/Model/LastBidAsk.md docs/Model/LobbyingData.md docs/Model/LobbyingResult.md +docs/Model/MarketHoliday.md +docs/Model/MarketHolidayData.md docs/Model/MarketNews.md +docs/Model/MarketStatus.md docs/Model/MutualFundCountryExposure.md docs/Model/MutualFundCountryExposureData.md docs/Model/MutualFundEet.md @@ -117,7 +121,6 @@ docs/Model/PriceMetrics.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 @@ -129,6 +132,7 @@ docs/Model/SearchResponse.md docs/Model/SectorMetric.md docs/Model/SectorMetricData.md docs/Model/Sentiment.md +docs/Model/SentimentContent.md docs/Model/SimilarityIndex.md docs/Model/SimilarityIndexInfo.md docs/Model/SocialSentiment.md @@ -148,7 +152,6 @@ docs/Model/Transactions.md docs/Model/TranscriptContent.md docs/Model/TranscriptParticipant.md docs/Model/Trend.md -docs/Model/TwitterSentimentContent.md docs/Model/UpgradeDowngrade.md docs/Model/UsaSpending.md docs/Model/UsaSpendingResult.md @@ -234,6 +237,7 @@ lib/Model/InFilingSearchBody.php lib/Model/IndexHistoricalConstituent.php lib/Model/Indicator.php lib/Model/IndicesConstituents.php +lib/Model/IndicesConstituentsBreakdown.php lib/Model/IndicesHistoricalConstituents.php lib/Model/InsiderSentiments.php lib/Model/InsiderSentimentsData.php @@ -255,7 +259,10 @@ lib/Model/KeyCustomersSuppliers.php lib/Model/LastBidAsk.php lib/Model/LobbyingData.php lib/Model/LobbyingResult.php +lib/Model/MarketHoliday.php +lib/Model/MarketHolidayData.php lib/Model/MarketNews.php +lib/Model/MarketStatus.php lib/Model/ModelInterface.php lib/Model/MutualFundCountryExposure.php lib/Model/MutualFundCountryExposureData.php @@ -276,7 +283,6 @@ lib/Model/PriceMetrics.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 @@ -288,6 +294,7 @@ lib/Model/SearchResponse.php lib/Model/SectorMetric.php lib/Model/SectorMetricData.php lib/Model/Sentiment.php +lib/Model/SentimentContent.php lib/Model/SimilarityIndex.php lib/Model/SimilarityIndexInfo.php lib/Model/SocialSentiment.php @@ -307,7 +314,6 @@ 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/Model/UsaSpending.php lib/Model/UsaSpendingResult.php @@ -317,17 +323,8 @@ lib/Model/VisaApplication.php lib/Model/VisaApplicationResult.php lib/ObjectSerializer.php phpunit.xml.dist -test/Model/BondYieldCurveInfoTest.php -test/Model/BondYieldCurveTest.php -test/Model/CongressionalTradingTest.php -test/Model/CongressionalTransactionTest.php -test/Model/DocumentResponseTest.php -test/Model/ExcerptResponseTest.php -test/Model/FilingResponseTest.php -test/Model/InFilingResponseTest.php -test/Model/InFilingSearchBodyTest.php -test/Model/MutualFundEetPaiTest.php -test/Model/MutualFundEetTest.php -test/Model/SearchBodyTest.php -test/Model/SearchFilterTest.php -test/Model/SearchResponseTest.php +test/Model/IndicesConstituentsBreakdownTest.php +test/Model/MarketHolidayDataTest.php +test/Model/MarketHolidayTest.php +test/Model/MarketStatusTest.php +test/Model/SentimentContentTest.php diff --git a/README.md b/README.md index 3f7f620..6467e6b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ - Finnhub php api clent - API version: 1.0.0 -- Package version: 1.1.16 +- Package version: 1.1.17 ## Requirements @@ -17,7 +17,7 @@ In composer.json: ```json { "require": { - "finnhub/client": "1.1.16" + "finnhub/client": "1.1.17" } } ``` diff --git a/composer.json b/composer.json index 499235e..e596c82 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "finnhub/client", - "version": "1.1.16", - "description": "Finnhub Stock API PHP", + "version": "1.1.17", + "description": "Official Finnhub stock API PHP library. https://finnhub.io/", "keywords": [ "openapitools", "openapi-generator", diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index caa698b..dcd4d35 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -54,10 +54,13 @@ Method | HTTP request | Description [**institutionalOwnership()**](DefaultApi.md#institutionalOwnership) | **GET** /institutional/ownership | Institutional Ownership [**institutionalPortfolio()**](DefaultApi.md#institutionalPortfolio) | **GET** /institutional/portfolio | Institutional Portfolio [**institutionalProfile()**](DefaultApi.md#institutionalProfile) | **GET** /institutional/profile | Institutional Profile +[**internationalFilings()**](DefaultApi.md#internationalFilings) | **GET** /stock/international-filings | International Filings [**investmentThemes()**](DefaultApi.md#investmentThemes) | **GET** /stock/investment-theme | Investment Themes (Thematic Investing) [**ipoCalendar()**](DefaultApi.md#ipoCalendar) | **GET** /calendar/ipo | IPO Calendar [**isinChange()**](DefaultApi.md#isinChange) | **GET** /ca/isin-change | ISIN Change +[**marketHoliday()**](DefaultApi.md#marketHoliday) | **GET** /stock/market-holiday | Market Holiday [**marketNews()**](DefaultApi.md#marketNews) | **GET** /news | Market News +[**marketStatus()**](DefaultApi.md#marketStatus) | **GET** /stock/market-status | Market Status [**mutualFundCountryExposure()**](DefaultApi.md#mutualFundCountryExposure) | **GET** /mutual-fund/country | Mutual Funds Country Exposure [**mutualFundEet()**](DefaultApi.md#mutualFundEet) | **GET** /mutual-fund/eet | Mutual Funds EET [**mutualFundEetPai()**](DefaultApi.md#mutualFundEetPai) | **GET** /mutual-fund/eet-pai | Mutual Funds EET PAI @@ -818,7 +821,7 @@ companyEsgScore($symbol): \Finnhub\Model\CompanyESG Company ESG Scores -

This endpoint provides ESG scores and important indicators for 1000+ global companies. The data is collected through company's public ESG disclosure and public sources.

Our ESG scoring models takes into account more than 150 different inputs to calculate the level of ESG risks and how well a company is managing them. A higher score means lower ESG risk or better ESG management. ESG scores are in the the range of 0-100. Some key indicators might contain letter-grade score from C- to A+ with C- is the lowest score and A+ is the highest score.

+

This endpoint provides ESG scores and important indicators for 7000+ global companies. The data is collected through company's public ESG disclosure and public sources.

Our ESG scoring models takes into account more than 150 different inputs to calculate the level of ESG risks and how well a company is managing them. A higher score means lower ESG risk or better ESG management. ESG scores are in the the range of 0-100. Some key indicators might contain letter-grade score from C- to A+ with C- is the lowest score and A+ is the highest score.

Historical ESG data is available for Enterprise users. Contact us to learn more.

### Example @@ -1951,7 +1954,7 @@ Name | Type | Description | Notes ## `etfsCountryExposure()` ```php -etfsCountryExposure($symbol): \Finnhub\Model\ETFsCountryExposure +etfsCountryExposure($symbol, $isin): \Finnhub\Model\ETFsCountryExposure ``` ETFs Country Exposure @@ -1978,9 +1981,10 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | ETF symbol. +$isin = 'isin_example'; // string | ETF isin. try { - $result = $apiInstance->etfsCountryExposure($symbol); + $result = $apiInstance->etfsCountryExposure($symbol, $isin); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->etfsCountryExposure: ', $e->getMessage(), PHP_EOL; @@ -1991,7 +1995,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| ETF symbol. | + **symbol** | **string**| ETF symbol. | [optional] + **isin** | **string**| ETF isin. | [optional] ### Return type @@ -2145,7 +2150,7 @@ Name | Type | Description | Notes ## `etfsSectorExposure()` ```php -etfsSectorExposure($symbol): \Finnhub\Model\ETFsSectorExposure +etfsSectorExposure($symbol, $isin): \Finnhub\Model\ETFsSectorExposure ``` ETFs Sector Exposure @@ -2172,9 +2177,10 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | ETF symbol. +$isin = 'isin_example'; // string | ETF isin. try { - $result = $apiInstance->etfsSectorExposure($symbol); + $result = $apiInstance->etfsSectorExposure($symbol, $isin); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->etfsSectorExposure: ', $e->getMessage(), PHP_EOL; @@ -2185,7 +2191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| ETF symbol. | + **symbol** | **string**| ETF symbol. | [optional] + **isin** | **string**| ETF isin. | [optional] ### Return type @@ -2860,7 +2867,7 @@ indicesConstituents($symbol): \Finnhub\Model\IndicesConstituents Indices Constituents -Get a list of index's constituents. A list of supported indices for this endpoint can be found here. +Get a list of index's constituents. A list of supported indices for this endpoint can be found here. ### Example @@ -3304,6 +3311,70 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `internationalFilings()` + +```php +internationalFilings($symbol, $country): \Finnhub\Model\InternationalFiling[] +``` + +International Filings + +List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access. + +### 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. Leave empty to list latest filings. +$country = 'country_example'; // string | Filter by country using country's 2-letter code. + +try { + $result = $apiInstance->internationalFilings($symbol, $country); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->internationalFilings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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\InternationalFiling[]**](../Model/InternationalFiling.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) + ## `investmentThemes()` ```php @@ -3494,6 +3565,68 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `marketHoliday()` + +```php +marketHoliday($exchange): \Finnhub\Model\MarketHoliday +``` + +Market Holiday + +Get a list of holidays for global exchanges. + +### 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 +); +$exchange = 'exchange_example'; // string | Exchange code. + +try { + $result = $apiInstance->marketHoliday($exchange); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->marketHoliday: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exchange** | **string**| Exchange code. | + +### Return type + +[**\Finnhub\Model\MarketHoliday**](../Model/MarketHoliday.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) + ## `marketNews()` ```php @@ -3558,10 +3691,72 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `marketStatus()` + +```php +marketStatus($exchange): \Finnhub\Model\MarketStatus +``` + +Market Status + +Get current market status for global exchanges (whether exchanges are open or close). + +### 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 +); +$exchange = 'exchange_example'; // string | Exchange code. + +try { + $result = $apiInstance->marketStatus($exchange); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->marketStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exchange** | **string**| Exchange code. | + +### Return type + +[**\Finnhub\Model\MarketStatus**](../Model/MarketStatus.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) + ## `mutualFundCountryExposure()` ```php -mutualFundCountryExposure($symbol): \Finnhub\Model\MutualFundCountryExposure +mutualFundCountryExposure($symbol, $isin): \Finnhub\Model\MutualFundCountryExposure ``` Mutual Funds Country Exposure @@ -3588,9 +3783,10 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | Symbol. +$isin = 'isin_example'; // string | Fund's isin. try { - $result = $apiInstance->mutualFundCountryExposure($symbol); + $result = $apiInstance->mutualFundCountryExposure($symbol, $isin); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->mutualFundCountryExposure: ', $e->getMessage(), PHP_EOL; @@ -3601,7 +3797,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Symbol. | + **symbol** | **string**| Symbol. | [optional] + **isin** | **string**| Fund's isin. | [optional] ### Return type @@ -3877,7 +4074,7 @@ Name | Type | Description | Notes ## `mutualFundSectorExposure()` ```php -mutualFundSectorExposure($symbol): \Finnhub\Model\MutualFundSectorExposure +mutualFundSectorExposure($symbol, $isin): \Finnhub\Model\MutualFundSectorExposure ``` Mutual Funds Sector Exposure @@ -3904,9 +4101,10 @@ $apiInstance = new Finnhub\Api\DefaultApi( $config ); $symbol = 'symbol_example'; // string | Mutual Fund symbol. +$isin = 'isin_example'; // string | Fund's isin. try { - $result = $apiInstance->mutualFundSectorExposure($symbol); + $result = $apiInstance->mutualFundSectorExposure($symbol, $isin); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->mutualFundSectorExposure: ', $e->getMessage(), PHP_EOL; @@ -3917,7 +4115,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **symbol** | **string**| Mutual Fund symbol. | + **symbol** | **string**| Mutual Fund symbol. | [optional] + **isin** | **string**| Fund's isin. | [optional] ### Return type @@ -4642,7 +4841,7 @@ socialSentiment($symbol, $from, $to): \Finnhub\Model\SocialSentiment Social Sentiment -

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

+

Get social sentiment for stocks on Reddit and Twitter.

### Example @@ -4832,7 +5031,7 @@ stockCandles($symbol, $resolution, $from, $to): \Finnhub\Model\StockCandles Stock Candles -

Get candlestick data (OHLCV) for stocks.

Daily data will be adjusted for Splits. Intraday data will remain unadjusted.

+

Get candlestick data (OHLCV) for stocks.

Daily data will be adjusted for Splits. Intraday data will remain unadjusted. Only 1 month of intraday will be returned at a time. If you need more historical intraday data, please use the from and to params iteratively to request more data.

### Example @@ -5234,7 +5433,7 @@ stockTick($symbol, $date, $limit, $skip): \Finnhub\Model\TickData Tick Data -

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.

Exchange Segment Delay
US CTA/UTP Full SIP End-of-day
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
+

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 more historical tick data, you can visit our bulk download page in the Dashboard here to speed up the download process.

Exchange Segment Delay
US CTA/UTP Full SIP End-of-day
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
### Example diff --git a/docs/Model/CompanyProfile.md b/docs/Model/CompanyProfile.md index 8d67b23..128318d 100644 --- a/docs/Model/CompanyProfile.md +++ b/docs/Model/CompanyProfile.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**alias** | **string[]** | Company name alias. | [optional] **address** | **string** | Address of company's headquarter. | [optional] **city** | **string** | City of company's headquarter. | [optional] **country** | **string** | Country of company's headquarter. | [optional] @@ -19,6 +20,7 @@ Name | Type | Description | Notes **gsector** | **string** | Sector. | [optional] **gsubind** | **string** | Sub-industry. | [optional] **isin** | **string** | ISIN number. | [optional] +**lei** | **string** | LEI number. | [optional] **naics_national_industry** | **string** | NAICS national industry. | [optional] **naics** | **string** | NAICS industry. | [optional] **naics_sector** | **string** | NAICS sector. | [optional] diff --git a/docs/Model/CountryMetadata.md b/docs/Model/CountryMetadata.md index 00850f5..6ca7743 100644 --- a/docs/Model/CountryMetadata.md +++ b/docs/Model/CountryMetadata.md @@ -12,5 +12,9 @@ Name | Type | Description | Notes **currency_code** | **string** | Currency code | [optional] **region** | **string** | Region | [optional] **sub_region** | **string** | Sub-Region | [optional] +**rating** | **string** | Moody's credit risk rating. | [optional] +**default_spread** | **float** | Default spread | [optional] +**country_risk_premium** | **float** | Country risk premium | [optional] +**equity_risk_premium** | **float** | Equity risk premium | [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 d4b1819..9085326 100644 --- a/docs/Model/EarningResult.md +++ b/docs/Model/EarningResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **surprise_percent** | **float** | Surprise percent. | [optional] **period** | [**\DateTime**](\DateTime.md) | Reported period. | [optional] **symbol** | **string** | Company symbol. | [optional] -**year** | **int** | Earnings year. | [optional] -**quarter** | **int** | Earnings quarter. | [optional] +**year** | **int** | Fiscal year. | [optional] +**quarter** | **int** | Fiscal quarter. | [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/EarningsEstimatesInfo.md b/docs/Model/EarningsEstimatesInfo.md index 0621094..851b7a1 100644 --- a/docs/Model/EarningsEstimatesInfo.md +++ b/docs/Model/EarningsEstimatesInfo.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **eps_low** | **float** | Lowest estimate. | [optional] **number_analysts** | **int** | Number of Analysts. | [optional] **period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +**year** | **int** | Fiscal year. | [optional] +**quarter** | **int** | Fiscal quarter. | [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/EbitEstimatesInfo.md b/docs/Model/EbitEstimatesInfo.md index 5eaaa26..9e26330 100644 --- a/docs/Model/EbitEstimatesInfo.md +++ b/docs/Model/EbitEstimatesInfo.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **ebit_low** | **float** | Lowest estimate. | [optional] **number_analysts** | **int** | Number of Analysts. | [optional] **period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +**year** | **int** | Fiscal year. | [optional] +**quarter** | **int** | Fiscal quarter. | [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/EbitdaEstimatesInfo.md b/docs/Model/EbitdaEstimatesInfo.md index a2dfb93..7b73827 100644 --- a/docs/Model/EbitdaEstimatesInfo.md +++ b/docs/Model/EbitdaEstimatesInfo.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **ebitda_low** | **float** | Lowest estimate. | [optional] **number_analysts** | **int** | Number of Analysts. | [optional] **period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +**year** | **int** | Fiscal year. | [optional] +**quarter** | **int** | Fiscal quarter. | [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 c3b7fef..d5b2f1e 100644 --- a/docs/Model/IndicesConstituents.md +++ b/docs/Model/IndicesConstituents.md @@ -6,5 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **symbol** | **string** | Index's symbol. | [optional] **constituents** | **string[]** | Array of constituents. | [optional] +**constituents_breakdown** | [**\Finnhub\Model\IndicesConstituentsBreakdown[]**](IndicesConstituentsBreakdown.md) | Array of constituents' details. | [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/IndicesConstituentsBreakdown.md b/docs/Model/IndicesConstituentsBreakdown.md new file mode 100644 index 0000000..ae29160 --- /dev/null +++ b/docs/Model/IndicesConstituentsBreakdown.md @@ -0,0 +1,14 @@ +# # IndicesConstituentsBreakdown + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **string** | Symbol. | [optional] +**name** | **string** | Name. | [optional] +**isin** | **string** | ISIN. | [optional] +**cusip** | **string** | Cusip. | [optional] +**share_class_figi** | **string** | Global Share Class FIGI. | [optional] +**weight** | **float** | Weight. | [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/MarketHoliday.md b/docs/Model/MarketHoliday.md new file mode 100644 index 0000000..8ed9de1 --- /dev/null +++ b/docs/Model/MarketHoliday.md @@ -0,0 +1,11 @@ +# # MarketHoliday + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timezone** | **string** | Timezone. | [optional] +**exchange** | **string** | Exchange. | [optional] +**data** | [**\Finnhub\Model\MarketHolidayData[]**](MarketHolidayData.md) | Array of holidays. | [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/MarketHolidayData.md b/docs/Model/MarketHolidayData.md new file mode 100644 index 0000000..07cb23a --- /dev/null +++ b/docs/Model/MarketHolidayData.md @@ -0,0 +1,11 @@ +# # MarketHolidayData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_name** | **string** | Holiday's name. | [optional] +**at_date** | **string** | Date. | [optional] +**trading_hour** | **string** | Trading hours for this day if the market is partially closed only. | [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/MarketStatus.md b/docs/Model/MarketStatus.md new file mode 100644 index 0000000..c9c85fe --- /dev/null +++ b/docs/Model/MarketStatus.md @@ -0,0 +1,14 @@ +# # MarketStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange** | **string** | Exchange. | [optional] +**timezone** | **string** | Timezone. | [optional] +**session** | **string** | Market session. | [optional] +**holiday** | **string** | Holiday event. | [optional] +**is_open** | **bool** | Whether the market is open at the moment. | [optional] +**t** | **int** | Current timestamp. | [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/MutualFundProfileData.md b/docs/Model/MutualFundProfileData.md index 9cf34b5..25a54e9 100644 --- a/docs/Model/MutualFundProfileData.md +++ b/docs/Model/MutualFundProfileData.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **inception_date** | [**\DateTime**](\DateTime.md) | Inception date. | [optional] **description** | **string** | Fund's description. | [optional] **fund_family** | **string** | Fund Family. | [optional] +**fund_company** | **string** | Fund Company. | [optional] **manager** | **string** | Fund's managers. | [optional] **status** | **string** | Status. | [optional] **beta** | **float** | Beta. | [optional] diff --git a/docs/Model/RevenueEstimatesInfo.md b/docs/Model/RevenueEstimatesInfo.md index 9946fc4..60b377a 100644 --- a/docs/Model/RevenueEstimatesInfo.md +++ b/docs/Model/RevenueEstimatesInfo.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **revenue_low** | **float** | Lowest estimate. | [optional] **number_analysts** | **int** | Number of Analysts. | [optional] **period** | [**\DateTime**](\DateTime.md) | Period. | [optional] +**year** | **int** | Fiscal year. | [optional] +**quarter** | **int** | Fiscal quarter. | [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/SentimentContent.md b/docs/Model/SentimentContent.md new file mode 100644 index 0000000..3bfb21e --- /dev/null +++ b/docs/Model/SentimentContent.md @@ -0,0 +1,15 @@ +# # SentimentContent + +## 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** | **string** | 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/SocialSentiment.md b/docs/Model/SocialSentiment.md index 7962162..46a8160 100644 --- a/docs/Model/SocialSentiment.md +++ b/docs/Model/SocialSentiment.md @@ -5,7 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **symbol** | **string** | Company symbol. | [optional] -**reddit** | [**\Finnhub\Model\RedditSentimentContent[]**](RedditSentimentContent.md) | Reddit sentiment. | [optional] -**twitter** | [**\Finnhub\Model\TwitterSentimentContent[]**](TwitterSentimentContent.md) | Twitter sentiment. | [optional] +**data** | [**\Finnhub\Model\SentimentContent[]**](SentimentContent.md) | Sentiment data. | [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 9282b84..da2ca0f 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -8269,15 +8269,16 @@ public function economicDataRequest($code) * * ETFs Country Exposure * - * @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\ETFsCountryExposure */ - public function etfsCountryExposure($symbol) + public function etfsCountryExposure($symbol = null, $isin = null) { - list($response) = $this->etfsCountryExposureWithHttpInfo($symbol); + list($response) = $this->etfsCountryExposureWithHttpInfo($symbol, $isin); return $response; } @@ -8286,15 +8287,16 @@ public function etfsCountryExposure($symbol) * * ETFs Country Exposure * - * @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\ETFsCountryExposure, HTTP status code, HTTP response headers (array of strings) */ - public function etfsCountryExposureWithHttpInfo($symbol) + public function etfsCountryExposureWithHttpInfo($symbol = null, $isin = null) { - $request = $this->etfsCountryExposureRequest($symbol); + $request = $this->etfsCountryExposureRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -8372,14 +8374,15 @@ public function etfsCountryExposureWithHttpInfo($symbol) * * ETFs Country Exposure * - * @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 etfsCountryExposureAsync($symbol) + public function etfsCountryExposureAsync($symbol = null, $isin = null) { - return $this->etfsCountryExposureAsyncWithHttpInfo($symbol) + return $this->etfsCountryExposureAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -8392,15 +8395,16 @@ function ($response) { * * ETFs Country Exposure * - * @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 etfsCountryExposureAsyncWithHttpInfo($symbol) + public function etfsCountryExposureAsyncWithHttpInfo($symbol = null, $isin = null) { $returnType = '\Finnhub\Model\ETFsCountryExposure'; - $request = $this->etfsCountryExposureRequest($symbol); + $request = $this->etfsCountryExposureRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8438,19 +8442,14 @@ function ($exception) { /** * Create request for operation 'etfsCountryExposure' * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function etfsCountryExposureRequest($symbol) + public function etfsCountryExposureRequest($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 etfsCountryExposure' - ); - } $resourcePath = '/etf/country'; $formParams = []; @@ -8466,6 +8465,13 @@ public function etfsCountryExposureRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } @@ -9109,15 +9115,16 @@ public function etfsProfileRequest($symbol = null, $isin = null) * * ETFs Sector Exposure * - * @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\ETFsSectorExposure */ - public function etfsSectorExposure($symbol) + public function etfsSectorExposure($symbol = null, $isin = null) { - list($response) = $this->etfsSectorExposureWithHttpInfo($symbol); + list($response) = $this->etfsSectorExposureWithHttpInfo($symbol, $isin); return $response; } @@ -9126,15 +9133,16 @@ public function etfsSectorExposure($symbol) * * ETFs Sector Exposure * - * @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\ETFsSectorExposure, HTTP status code, HTTP response headers (array of strings) */ - public function etfsSectorExposureWithHttpInfo($symbol) + public function etfsSectorExposureWithHttpInfo($symbol = null, $isin = null) { - $request = $this->etfsSectorExposureRequest($symbol); + $request = $this->etfsSectorExposureRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -9212,14 +9220,15 @@ public function etfsSectorExposureWithHttpInfo($symbol) * * ETFs Sector Exposure * - * @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 etfsSectorExposureAsync($symbol) + public function etfsSectorExposureAsync($symbol = null, $isin = null) { - return $this->etfsSectorExposureAsyncWithHttpInfo($symbol) + return $this->etfsSectorExposureAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -9232,15 +9241,16 @@ function ($response) { * * ETFs Sector Exposure * - * @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 etfsSectorExposureAsyncWithHttpInfo($symbol) + public function etfsSectorExposureAsyncWithHttpInfo($symbol = null, $isin = null) { $returnType = '\Finnhub\Model\ETFsSectorExposure'; - $request = $this->etfsSectorExposureRequest($symbol); + $request = $this->etfsSectorExposureRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9278,19 +9288,14 @@ function ($exception) { /** * Create request for operation 'etfsSectorExposure' * - * @param string $symbol ETF symbol. (required) + * @param string $symbol ETF symbol. (optional) + * @param string $isin ETF isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function etfsSectorExposureRequest($symbol) + public function etfsSectorExposureRequest($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 etfsSectorExposure' - ); - } $resourcePath = '/etf/sector'; $formParams = []; @@ -9306,6 +9311,13 @@ public function etfsSectorExposureRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } @@ -14253,36 +14265,38 @@ public function institutionalProfileRequest($cik = null) } /** - * Operation investmentThemes + * Operation internationalFilings * - * Investment Themes (Thematic Investing) + * International Filings * - * @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) + * @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\InvestmentThemes + * @return \Finnhub\Model\InternationalFiling[] */ - public function investmentThemes($theme) + public function internationalFilings($symbol = null, $country = null) { - list($response) = $this->investmentThemesWithHttpInfo($theme); + list($response) = $this->internationalFilingsWithHttpInfo($symbol, $country); return $response; } /** - * Operation investmentThemesWithHttpInfo + * Operation internationalFilingsWithHttpInfo * - * Investment Themes (Thematic Investing) + * International Filings * - * @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) + * @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\InvestmentThemes, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\InternationalFiling[], HTTP status code, HTTP response headers (array of strings) */ - public function investmentThemesWithHttpInfo($theme) + public function internationalFilingsWithHttpInfo($symbol = null, $country = null) { - $request = $this->investmentThemesRequest($theme); + $request = $this->internationalFilingsRequest($symbol, $country); try { $options = $this->createHttpClientOption(); @@ -14314,20 +14328,20 @@ public function investmentThemesWithHttpInfo($theme) switch($statusCode) { case 200: - if ('\Finnhub\Model\InvestmentThemes' === '\SplFileObject') { + if ('\Finnhub\Model\InternationalFiling[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\InvestmentThemes', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\InternationalFiling[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\InvestmentThemes'; + $returnType = '\Finnhub\Model\InternationalFiling[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14345,7 +14359,7 @@ public function investmentThemesWithHttpInfo($theme) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\InvestmentThemes', + '\Finnhub\Model\InternationalFiling[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14356,18 +14370,19 @@ public function investmentThemesWithHttpInfo($theme) } /** - * Operation investmentThemesAsync + * Operation internationalFilingsAsync * - * Investment Themes (Thematic Investing) + * International Filings * - * @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) + * @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 investmentThemesAsync($theme) + public function internationalFilingsAsync($symbol = null, $country = null) { - return $this->investmentThemesAsyncWithHttpInfo($theme) + return $this->internationalFilingsAsyncWithHttpInfo($symbol, $country) ->then( function ($response) { return $response[0]; @@ -14376,19 +14391,20 @@ function ($response) { } /** - * Operation investmentThemesAsyncWithHttpInfo + * Operation internationalFilingsAsyncWithHttpInfo * - * Investment Themes (Thematic Investing) + * International Filings * - * @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) + * @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 investmentThemesAsyncWithHttpInfo($theme) + public function internationalFilingsAsyncWithHttpInfo($symbol = null, $country = null) { - $returnType = '\Finnhub\Model\InvestmentThemes'; - $request = $this->investmentThemesRequest($theme); + $returnType = '\Finnhub\Model\InternationalFiling[]'; + $request = $this->internationalFilingsRequest($symbol, $country); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14424,23 +14440,18 @@ function ($exception) { } /** - * Create request for operation 'investmentThemes' + * Create request for operation 'internationalFilings' * - * @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) + * @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 investmentThemesRequest($theme) + public function internationalFilingsRequest($symbol = null, $country = null) { - // 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 investmentThemes' - ); - } - $resourcePath = '/stock/investment-theme'; + $resourcePath = '/stock/international-filings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14448,11 +14459,18 @@ public function investmentThemesRequest($theme) $multipart = false; // query params - if (is_array($theme)) { - $theme = ObjectSerializer::serializeCollection($theme, '', true); + if (is_array($symbol)) { + $symbol = ObjectSerializer::serializeCollection($symbol, '', true); } - if ($theme !== null) { - $queryParams['theme'] = $theme; + if ($symbol !== null) { + $queryParams['symbol'] = $symbol; + } + // query params + if (is_array($country)) { + $country = ObjectSerializer::serializeCollection($country, '', true); + } + if ($country !== null) { + $queryParams['country'] = $country; } @@ -14521,38 +14539,36 @@ public function investmentThemesRequest($theme) } /** - * Operation ipoCalendar + * Operation investmentThemes * - * IPO Calendar + * Investment Themes (Thematic Investing) * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @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\IPOCalendar + * @return \Finnhub\Model\InvestmentThemes */ - public function ipoCalendar($from, $to) + public function investmentThemes($theme) { - list($response) = $this->ipoCalendarWithHttpInfo($from, $to); + list($response) = $this->investmentThemesWithHttpInfo($theme); return $response; } /** - * Operation ipoCalendarWithHttpInfo + * Operation investmentThemesWithHttpInfo * - * IPO Calendar + * Investment Themes (Thematic Investing) * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @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\IPOCalendar, HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\InvestmentThemes, HTTP status code, HTTP response headers (array of strings) */ - public function ipoCalendarWithHttpInfo($from, $to) + public function investmentThemesWithHttpInfo($theme) { - $request = $this->ipoCalendarRequest($from, $to); + $request = $this->investmentThemesRequest($theme); try { $options = $this->createHttpClientOption(); @@ -14584,20 +14600,20 @@ public function ipoCalendarWithHttpInfo($from, $to) switch($statusCode) { case 200: - if ('\Finnhub\Model\IPOCalendar' === '\SplFileObject') { + if ('\Finnhub\Model\InvestmentThemes' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\IPOCalendar', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\InvestmentThemes', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\IPOCalendar'; + $returnType = '\Finnhub\Model\InvestmentThemes'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14615,7 +14631,7 @@ public function ipoCalendarWithHttpInfo($from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\IPOCalendar', + '\Finnhub\Model\InvestmentThemes', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14626,19 +14642,18 @@ public function ipoCalendarWithHttpInfo($from, $to) } /** - * Operation ipoCalendarAsync + * Operation investmentThemesAsync * - * IPO Calendar + * Investment Themes (Thematic Investing) * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @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 ipoCalendarAsync($from, $to) + public function investmentThemesAsync($theme) { - return $this->ipoCalendarAsyncWithHttpInfo($from, $to) + return $this->investmentThemesAsyncWithHttpInfo($theme) ->then( function ($response) { return $response[0]; @@ -14647,20 +14662,19 @@ function ($response) { } /** - * Operation ipoCalendarAsyncWithHttpInfo + * Operation investmentThemesAsyncWithHttpInfo * - * IPO Calendar + * Investment Themes (Thematic Investing) * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @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 ipoCalendarAsyncWithHttpInfo($from, $to) + public function investmentThemesAsyncWithHttpInfo($theme) { - $returnType = '\Finnhub\Model\IPOCalendar'; - $request = $this->ipoCalendarRequest($from, $to); + $returnType = '\Finnhub\Model\InvestmentThemes'; + $request = $this->investmentThemesRequest($theme); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14696,30 +14710,23 @@ function ($exception) { } /** - * Create request for operation 'ipoCalendar' + * Create request for operation 'investmentThemes' * - * @param \DateTime $from From date: 2020-03-15. (required) - * @param \DateTime $to To date: 2020-03-16. (required) + * @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 ipoCalendarRequest($from, $to) + public function investmentThemesRequest($theme) { - // 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 'theme' is set + if ($theme === null || (is_array($theme) && count($theme) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling ipoCalendar' + 'Missing the required parameter $theme when calling investmentThemes' ); } - $resourcePath = '/calendar/ipo'; + $resourcePath = '/stock/investment-theme'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14727,18 +14734,11 @@ public 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($theme)) { + $theme = ObjectSerializer::serializeCollection($theme, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($theme !== null) { + $queryParams['theme'] = $theme; } @@ -14807,38 +14807,38 @@ public function ipoCalendarRequest($from, $to) } /** - * Operation isinChange + * Operation ipoCalendar * - * ISIN Change + * IPO Calendar * - * @param string $from From date <code>YYYY-MM-DD</code>. (required) - * @param string $to To date <code>YYYY-MM-DD</code>. (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\IsinChange + * @return \Finnhub\Model\IPOCalendar */ - public function isinChange($from, $to) + public function ipoCalendar($from, $to) { - list($response) = $this->isinChangeWithHttpInfo($from, $to); + list($response) = $this->ipoCalendarWithHttpInfo($from, $to); return $response; } /** - * Operation isinChangeWithHttpInfo + * Operation ipoCalendarWithHttpInfo * - * ISIN Change + * IPO Calendar * - * @param string $from From date <code>YYYY-MM-DD</code>. (required) - * @param string $to To date <code>YYYY-MM-DD</code>. (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\IsinChange, 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 isinChangeWithHttpInfo($from, $to) + public function ipoCalendarWithHttpInfo($from, $to) { - $request = $this->isinChangeRequest($from, $to); + $request = $this->ipoCalendarRequest($from, $to); try { $options = $this->createHttpClientOption(); @@ -14870,20 +14870,20 @@ public function isinChangeWithHttpInfo($from, $to) switch($statusCode) { case 200: - if ('\Finnhub\Model\IsinChange' === '\SplFileObject') { + if ('\Finnhub\Model\IPOCalendar' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\IsinChange', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\IPOCalendar', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\IsinChange'; + $returnType = '\Finnhub\Model\IPOCalendar'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14901,7 +14901,7 @@ public function isinChangeWithHttpInfo($from, $to) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\IsinChange', + '\Finnhub\Model\IPOCalendar', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14912,19 +14912,19 @@ public function isinChangeWithHttpInfo($from, $to) } /** - * Operation isinChangeAsync + * Operation ipoCalendarAsync * - * ISIN Change + * IPO Calendar * - * @param string $from From date <code>YYYY-MM-DD</code>. (required) - * @param string $to To date <code>YYYY-MM-DD</code>. (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 isinChangeAsync($from, $to) + public function ipoCalendarAsync($from, $to) { - return $this->isinChangeAsyncWithHttpInfo($from, $to) + return $this->ipoCalendarAsyncWithHttpInfo($from, $to) ->then( function ($response) { return $response[0]; @@ -14933,20 +14933,20 @@ function ($response) { } /** - * Operation isinChangeAsyncWithHttpInfo + * Operation ipoCalendarAsyncWithHttpInfo * - * ISIN Change + * IPO Calendar * - * @param string $from From date <code>YYYY-MM-DD</code>. (required) - * @param string $to To date <code>YYYY-MM-DD</code>. (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 isinChangeAsyncWithHttpInfo($from, $to) + public function ipoCalendarAsyncWithHttpInfo($from, $to) { - $returnType = '\Finnhub\Model\IsinChange'; - $request = $this->isinChangeRequest($from, $to); + $returnType = '\Finnhub\Model\IPOCalendar'; + $request = $this->ipoCalendarRequest($from, $to); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14982,15 +14982,301 @@ function ($exception) { } /** - * Create request for operation 'isinChange' + * Create request for operation 'ipoCalendar' * - * @param string $from From date <code>YYYY-MM-DD</code>. (required) - * @param string $to To date <code>YYYY-MM-DD</code>. (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 */ - public function isinChangeRequest($from, $to) + public function ipoCalendarRequest($from, $to) + { + // 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)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to when calling ipoCalendar' + ); + } + + $resourcePath = '/calendar/ipo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $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 ($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 isinChange + * + * ISIN Change + * + * @param string $from From date <code>YYYY-MM-DD</code>. (required) + * @param string $to To date <code>YYYY-MM-DD</code>. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\IsinChange + */ + public function isinChange($from, $to) + { + list($response) = $this->isinChangeWithHttpInfo($from, $to); + return $response; + } + + /** + * Operation isinChangeWithHttpInfo + * + * ISIN Change + * + * @param string $from From date <code>YYYY-MM-DD</code>. (required) + * @param string $to To date <code>YYYY-MM-DD</code>. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\IsinChange, HTTP status code, HTTP response headers (array of strings) + */ + public function isinChangeWithHttpInfo($from, $to) + { + $request = $this->isinChangeRequest($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\IsinChange' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\IsinChange', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\IsinChange'; + 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\IsinChange', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation isinChangeAsync + * + * ISIN Change + * + * @param string $from From date <code>YYYY-MM-DD</code>. (required) + * @param string $to To date <code>YYYY-MM-DD</code>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function isinChangeAsync($from, $to) + { + return $this->isinChangeAsyncWithHttpInfo($from, $to) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation isinChangeAsyncWithHttpInfo + * + * ISIN Change + * + * @param string $from From date <code>YYYY-MM-DD</code>. (required) + * @param string $to To date <code>YYYY-MM-DD</code>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function isinChangeAsyncWithHttpInfo($from, $to) + { + $returnType = '\Finnhub\Model\IsinChange'; + $request = $this->isinChangeRequest($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 'isinChange' + * + * @param string $from From date <code>YYYY-MM-DD</code>. (required) + * @param string $to To date <code>YYYY-MM-DD</code>. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function isinChangeRequest($from, $to) { // verify the required parameter 'from' is set if ($from === null || (is_array($from) && count($from) === 0)) { @@ -14998,14 +15284,562 @@ public function isinChangeRequest($from, $to) 'Missing the required parameter $from when calling isinChange' ); } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // 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 isinChange' + ); + } + + $resourcePath = '/ca/isin-change'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $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 ($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 marketHoliday + * + * Market Holiday + * + * @param string $exchange Exchange code. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Finnhub\Model\MarketHoliday + */ + public function marketHoliday($exchange) + { + list($response) = $this->marketHolidayWithHttpInfo($exchange); + return $response; + } + + /** + * Operation marketHolidayWithHttpInfo + * + * Market Holiday + * + * @param string $exchange Exchange code. (required) + * + * @throws \Finnhub\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Finnhub\Model\MarketHoliday, HTTP status code, HTTP response headers (array of strings) + */ + public function marketHolidayWithHttpInfo($exchange) + { + $request = $this->marketHolidayRequest($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\MarketHoliday' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\MarketHoliday', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\MarketHoliday'; + 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\MarketHoliday', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation marketHolidayAsync + * + * Market Holiday + * + * @param string $exchange Exchange code. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function marketHolidayAsync($exchange) + { + return $this->marketHolidayAsyncWithHttpInfo($exchange) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation marketHolidayAsyncWithHttpInfo + * + * Market Holiday + * + * @param string $exchange Exchange code. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function marketHolidayAsyncWithHttpInfo($exchange) + { + $returnType = '\Finnhub\Model\MarketHoliday'; + $request = $this->marketHolidayRequest($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 'marketHoliday' + * + * @param string $exchange Exchange code. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function marketHolidayRequest($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 marketHoliday' + ); + } + + $resourcePath = '/stock/market-holiday'; + $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 marketNews + * + * Market News + * + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param int $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\MarketNews[] + */ + public function marketNews($category, $min_id = null) + { + list($response) = $this->marketNewsWithHttpInfo($category, $min_id); + return $response; + } + + /** + * Operation marketNewsWithHttpInfo + * + * Market News + * + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param int $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\MarketNews[], HTTP status code, HTTP response headers (array of strings) + */ + public function marketNewsWithHttpInfo($category, $min_id = null) + { + $request = $this->marketNewsRequest($category, $min_id); + + 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\MarketNews[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Finnhub\Model\MarketNews[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Finnhub\Model\MarketNews[]'; + 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\MarketNews[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation marketNewsAsync + * + * Market News + * + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function marketNewsAsync($category, $min_id = null) + { + return $this->marketNewsAsyncWithHttpInfo($category, $min_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation marketNewsAsyncWithHttpInfo + * + * Market News + * + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function marketNewsAsyncWithHttpInfo($category, $min_id = null) + { + $returnType = '\Finnhub\Model\MarketNews[]'; + $request = $this->marketNewsRequest($category, $min_id); + + 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 'marketNews' + * + * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) + * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + 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 $to when calling isinChange' + 'Missing the required parameter $category when calling marketNews' ); } - $resourcePath = '/ca/isin-change'; + $resourcePath = '/news'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15013,18 +15847,18 @@ public function isinChangeRequest($from, $to) $multipart = false; // query params - if (is_array($from)) { - $from = ObjectSerializer::serializeCollection($from, '', true); + if (is_array($category)) { + $category = ObjectSerializer::serializeCollection($category, '', true); } - if ($from !== null) { - $queryParams['from'] = $from; + if ($category !== null) { + $queryParams['category'] = $category; } // query params - if (is_array($to)) { - $to = ObjectSerializer::serializeCollection($to, '', true); + if (is_array($min_id)) { + $min_id = ObjectSerializer::serializeCollection($min_id, '', true); } - if ($to !== null) { - $queryParams['to'] = $to; + if ($min_id !== null) { + $queryParams['minId'] = $min_id; } @@ -15093,38 +15927,36 @@ public function isinChangeRequest($from, $to) } /** - * Operation marketNews + * Operation marketStatus * - * Market News + * Market Status * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $exchange Exchange code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Finnhub\Model\MarketNews[] + * @return \Finnhub\Model\MarketStatus */ - public function marketNews($category, $min_id = null) + public function marketStatus($exchange) { - list($response) = $this->marketNewsWithHttpInfo($category, $min_id); + list($response) = $this->marketStatusWithHttpInfo($exchange); return $response; } /** - * Operation marketNewsWithHttpInfo + * Operation marketStatusWithHttpInfo * - * Market News + * Market Status * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $exchange Exchange code. (required) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Finnhub\Model\MarketNews[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Finnhub\Model\MarketStatus, HTTP status code, HTTP response headers (array of strings) */ - public function marketNewsWithHttpInfo($category, $min_id = null) + public function marketStatusWithHttpInfo($exchange) { - $request = $this->marketNewsRequest($category, $min_id); + $request = $this->marketStatusRequest($exchange); try { $options = $this->createHttpClientOption(); @@ -15156,20 +15988,20 @@ public function marketNewsWithHttpInfo($category, $min_id = null) switch($statusCode) { case 200: - if ('\Finnhub\Model\MarketNews[]' === '\SplFileObject') { + if ('\Finnhub\Model\MarketStatus' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Finnhub\Model\MarketNews[]', []), + ObjectSerializer::deserialize($content, '\Finnhub\Model\MarketStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Finnhub\Model\MarketNews[]'; + $returnType = '\Finnhub\Model\MarketStatus'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15187,7 +16019,7 @@ public function marketNewsWithHttpInfo($category, $min_id = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Finnhub\Model\MarketNews[]', + '\Finnhub\Model\MarketStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15198,19 +16030,18 @@ public function marketNewsWithHttpInfo($category, $min_id = null) } /** - * Operation marketNewsAsync + * Operation marketStatusAsync * - * Market News + * Market Status * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $exchange Exchange code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function marketNewsAsync($category, $min_id = null) + public function marketStatusAsync($exchange) { - return $this->marketNewsAsyncWithHttpInfo($category, $min_id) + return $this->marketStatusAsyncWithHttpInfo($exchange) ->then( function ($response) { return $response[0]; @@ -15219,20 +16050,19 @@ function ($response) { } /** - * Operation marketNewsAsyncWithHttpInfo + * Operation marketStatusAsyncWithHttpInfo * - * Market News + * Market Status * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $exchange Exchange code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function marketNewsAsyncWithHttpInfo($category, $min_id = null) + public function marketStatusAsyncWithHttpInfo($exchange) { - $returnType = '\Finnhub\Model\MarketNews[]'; - $request = $this->marketNewsRequest($category, $min_id); + $returnType = '\Finnhub\Model\MarketStatus'; + $request = $this->marketStatusRequest($exchange); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15268,24 +16098,23 @@ function ($exception) { } /** - * Create request for operation 'marketNews' + * Create request for operation 'marketStatus' * - * @param string $category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>. (required) - * @param int $min_id Use this field to get only news after this ID. Default to 0 (optional) + * @param string $exchange Exchange code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function marketNewsRequest($category, $min_id = null) + public function marketStatusRequest($exchange) { - // verify the required parameter 'category' is set - if ($category === null || (is_array($category) && count($category) === 0)) { + // verify the required parameter 'exchange' is set + if ($exchange === null || (is_array($exchange) && count($exchange) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category when calling marketNews' + 'Missing the required parameter $exchange when calling marketStatus' ); } - $resourcePath = '/news'; + $resourcePath = '/stock/market-status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15293,18 +16122,11 @@ public function marketNewsRequest($category, $min_id = null) $multipart = false; // query params - if (is_array($category)) { - $category = ObjectSerializer::serializeCollection($category, '', true); - } - if ($category !== null) { - $queryParams['category'] = $category; - } - // query params - if (is_array($min_id)) { - $min_id = ObjectSerializer::serializeCollection($min_id, '', true); + if (is_array($exchange)) { + $exchange = ObjectSerializer::serializeCollection($exchange, '', true); } - if ($min_id !== null) { - $queryParams['minId'] = $min_id; + if ($exchange !== null) { + $queryParams['exchange'] = $exchange; } @@ -15377,15 +16199,16 @@ public function marketNewsRequest($category, $min_id = null) * * Mutual Funds Country Exposure * - * @param string $symbol Symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Finnhub\Model\MutualFundCountryExposure */ - public function mutualFundCountryExposure($symbol) + public function mutualFundCountryExposure($symbol = null, $isin = null) { - list($response) = $this->mutualFundCountryExposureWithHttpInfo($symbol); + list($response) = $this->mutualFundCountryExposureWithHttpInfo($symbol, $isin); return $response; } @@ -15394,15 +16217,16 @@ public function mutualFundCountryExposure($symbol) * * Mutual Funds Country Exposure * - * @param string $symbol Symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Finnhub\Model\MutualFundCountryExposure, HTTP status code, HTTP response headers (array of strings) */ - public function mutualFundCountryExposureWithHttpInfo($symbol) + public function mutualFundCountryExposureWithHttpInfo($symbol = null, $isin = null) { - $request = $this->mutualFundCountryExposureRequest($symbol); + $request = $this->mutualFundCountryExposureRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -15480,14 +16304,15 @@ public function mutualFundCountryExposureWithHttpInfo($symbol) * * Mutual Funds Country Exposure * - * @param string $symbol Symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mutualFundCountryExposureAsync($symbol) + public function mutualFundCountryExposureAsync($symbol = null, $isin = null) { - return $this->mutualFundCountryExposureAsyncWithHttpInfo($symbol) + return $this->mutualFundCountryExposureAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -15500,15 +16325,16 @@ function ($response) { * * Mutual Funds Country Exposure * - * @param string $symbol Symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mutualFundCountryExposureAsyncWithHttpInfo($symbol) + public function mutualFundCountryExposureAsyncWithHttpInfo($symbol = null, $isin = null) { $returnType = '\Finnhub\Model\MutualFundCountryExposure'; - $request = $this->mutualFundCountryExposureRequest($symbol); + $request = $this->mutualFundCountryExposureRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15546,19 +16372,14 @@ function ($exception) { /** * Create request for operation 'mutualFundCountryExposure' * - * @param string $symbol Symbol. (required) + * @param string $symbol Symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function mutualFundCountryExposureRequest($symbol) + public function mutualFundCountryExposureRequest($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 mutualFundCountryExposure' - ); - } $resourcePath = '/mutual-fund/country'; $formParams = []; @@ -15574,6 +16395,13 @@ public function mutualFundCountryExposureRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } @@ -16741,15 +17569,16 @@ public function mutualFundProfileRequest($symbol = null, $isin = null) * * Mutual Funds Sector Exposure * - * @param string $symbol Mutual Fund symbol. (required) + * @param string $symbol Mutual Fund symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Finnhub\Model\MutualFundSectorExposure */ - public function mutualFundSectorExposure($symbol) + public function mutualFundSectorExposure($symbol = null, $isin = null) { - list($response) = $this->mutualFundSectorExposureWithHttpInfo($symbol); + list($response) = $this->mutualFundSectorExposureWithHttpInfo($symbol, $isin); return $response; } @@ -16758,15 +17587,16 @@ public function mutualFundSectorExposure($symbol) * * Mutual Funds Sector Exposure * - * @param string $symbol Mutual Fund symbol. (required) + * @param string $symbol Mutual Fund symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \Finnhub\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Finnhub\Model\MutualFundSectorExposure, HTTP status code, HTTP response headers (array of strings) */ - public function mutualFundSectorExposureWithHttpInfo($symbol) + public function mutualFundSectorExposureWithHttpInfo($symbol = null, $isin = null) { - $request = $this->mutualFundSectorExposureRequest($symbol); + $request = $this->mutualFundSectorExposureRequest($symbol, $isin); try { $options = $this->createHttpClientOption(); @@ -16844,14 +17674,15 @@ public function mutualFundSectorExposureWithHttpInfo($symbol) * * Mutual Funds Sector Exposure * - * @param string $symbol Mutual Fund symbol. (required) + * @param string $symbol Mutual Fund symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mutualFundSectorExposureAsync($symbol) + public function mutualFundSectorExposureAsync($symbol = null, $isin = null) { - return $this->mutualFundSectorExposureAsyncWithHttpInfo($symbol) + return $this->mutualFundSectorExposureAsyncWithHttpInfo($symbol, $isin) ->then( function ($response) { return $response[0]; @@ -16864,15 +17695,16 @@ function ($response) { * * Mutual Funds Sector Exposure * - * @param string $symbol Mutual Fund symbol. (required) + * @param string $symbol Mutual Fund symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mutualFundSectorExposureAsyncWithHttpInfo($symbol) + public function mutualFundSectorExposureAsyncWithHttpInfo($symbol = null, $isin = null) { $returnType = '\Finnhub\Model\MutualFundSectorExposure'; - $request = $this->mutualFundSectorExposureRequest($symbol); + $request = $this->mutualFundSectorExposureRequest($symbol, $isin); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16910,19 +17742,14 @@ function ($exception) { /** * Create request for operation 'mutualFundSectorExposure' * - * @param string $symbol Mutual Fund symbol. (required) + * @param string $symbol Mutual Fund symbol. (optional) + * @param string $isin Fund's isin. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function mutualFundSectorExposureRequest($symbol) + public function mutualFundSectorExposureRequest($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 mutualFundSectorExposure' - ); - } $resourcePath = '/mutual-fund/sector'; $formParams = []; @@ -16938,6 +17765,13 @@ public function mutualFundSectorExposureRequest($symbol) if ($symbol !== null) { $queryParams['symbol'] = $symbol; } + // query params + if (is_array($isin)) { + $isin = ObjectSerializer::serializeCollection($isin, '', true); + } + if ($isin !== null) { + $queryParams['isin'] = $isin; + } diff --git a/lib/Configuration.php b/lib/Configuration.php index f0c9bac..8c3886c 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -90,7 +90,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.1.16/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.1.17/PHP'; /** * Debug switch (default set to false) @@ -399,7 +399,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.1.16' . PHP_EOL; + $report .= ' SDK Package Version: 1.1.17' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/CompanyProfile.php b/lib/Model/CompanyProfile.php index 8c2ff6b..2d8b6db 100644 --- a/lib/Model/CompanyProfile.php +++ b/lib/Model/CompanyProfile.php @@ -59,6 +59,7 @@ class CompanyProfile implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'alias' => 'string[]', 'address' => 'string', 'city' => 'string', 'country' => 'string', @@ -74,6 +75,7 @@ class CompanyProfile implements ModelInterface, ArrayAccess, \JsonSerializable 'gsector' => 'string', 'gsubind' => 'string', 'isin' => 'string', + 'lei' => 'string', 'naics_national_industry' => 'string', 'naics' => 'string', 'naics_sector' => 'string', @@ -99,6 +101,7 @@ class CompanyProfile implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'alias' => null, 'address' => null, 'city' => null, 'country' => null, @@ -114,6 +117,7 @@ class CompanyProfile implements ModelInterface, ArrayAccess, \JsonSerializable 'gsector' => null, 'gsubind' => null, 'isin' => null, + 'lei' => null, 'naics_national_industry' => null, 'naics' => null, 'naics_sector' => null, @@ -158,6 +162,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'alias' => 'alias', 'address' => 'address', 'city' => 'city', 'country' => 'country', @@ -173,6 +178,7 @@ public static function openAPIFormats() 'gsector' => 'gsector', 'gsubind' => 'gsubind', 'isin' => 'isin', + 'lei' => 'lei', 'naics_national_industry' => 'naicsNationalIndustry', 'naics' => 'naics', 'naics_sector' => 'naicsSector', @@ -196,6 +202,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'alias' => 'setAlias', 'address' => 'setAddress', 'city' => 'setCity', 'country' => 'setCountry', @@ -211,6 +218,7 @@ public static function openAPIFormats() 'gsector' => 'setGsector', 'gsubind' => 'setGsubind', 'isin' => 'setIsin', + 'lei' => 'setLei', 'naics_national_industry' => 'setNaicsNationalIndustry', 'naics' => 'setNaics', 'naics_sector' => 'setNaicsSector', @@ -234,6 +242,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'alias' => 'getAlias', 'address' => 'getAddress', 'city' => 'getCity', 'country' => 'getCountry', @@ -249,6 +258,7 @@ public static function openAPIFormats() 'gsector' => 'getGsector', 'gsubind' => 'getGsubind', 'isin' => 'getIsin', + 'lei' => 'getLei', 'naics_national_industry' => 'getNaicsNationalIndustry', 'naics' => 'getNaics', 'naics_sector' => 'getNaicsSector', @@ -323,6 +333,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['alias'] = $data['alias'] ?? null; $this->container['address'] = $data['address'] ?? null; $this->container['city'] = $data['city'] ?? null; $this->container['country'] = $data['country'] ?? null; @@ -338,6 +349,7 @@ public function __construct(array $data = null) $this->container['gsector'] = $data['gsector'] ?? null; $this->container['gsubind'] = $data['gsubind'] ?? null; $this->container['isin'] = $data['isin'] ?? null; + $this->container['lei'] = $data['lei'] ?? 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; @@ -379,6 +391,30 @@ public function valid() } + /** + * Gets alias + * + * @return string[]|null + */ + public function getAlias() + { + return $this->container['alias']; + } + + /** + * Sets alias + * + * @param string[]|null $alias Company name alias. + * + * @return self + */ + public function setAlias($alias) + { + $this->container['alias'] = $alias; + + return $this; + } + /** * Gets address * @@ -739,6 +775,30 @@ public function setIsin($isin) return $this; } + /** + * Gets lei + * + * @return string|null + */ + public function getLei() + { + return $this->container['lei']; + } + + /** + * Sets lei + * + * @param string|null $lei LEI number. + * + * @return self + */ + public function setLei($lei) + { + $this->container['lei'] = $lei; + + return $this; + } + /** * Gets naics_national_industry * diff --git a/lib/Model/CountryMetadata.php b/lib/Model/CountryMetadata.php index bd15d30..7471bba 100644 --- a/lib/Model/CountryMetadata.php +++ b/lib/Model/CountryMetadata.php @@ -66,7 +66,11 @@ class CountryMetadata implements ModelInterface, ArrayAccess, \JsonSerializable 'currency' => 'string', 'currency_code' => 'string', 'region' => 'string', - 'sub_region' => 'string' + 'sub_region' => 'string', + 'rating' => 'string', + 'default_spread' => 'float', + 'country_risk_premium' => 'float', + 'equity_risk_premium' => 'float' ]; /** @@ -84,7 +88,11 @@ class CountryMetadata implements ModelInterface, ArrayAccess, \JsonSerializable 'currency' => null, 'currency_code' => null, 'region' => null, - 'sub_region' => null + 'sub_region' => null, + 'rating' => null, + 'default_spread' => 'float', + 'country_risk_premium' => 'float', + 'equity_risk_premium' => 'float' ]; /** @@ -121,7 +129,11 @@ public static function openAPIFormats() 'currency' => 'currency', 'currency_code' => 'currencyCode', 'region' => 'region', - 'sub_region' => 'subRegion' + 'sub_region' => 'subRegion', + 'rating' => 'rating', + 'default_spread' => 'defaultSpread', + 'country_risk_premium' => 'countryRiskPremium', + 'equity_risk_premium' => 'equityRiskPremium' ]; /** @@ -137,7 +149,11 @@ public static function openAPIFormats() 'currency' => 'setCurrency', 'currency_code' => 'setCurrencyCode', 'region' => 'setRegion', - 'sub_region' => 'setSubRegion' + 'sub_region' => 'setSubRegion', + 'rating' => 'setRating', + 'default_spread' => 'setDefaultSpread', + 'country_risk_premium' => 'setCountryRiskPremium', + 'equity_risk_premium' => 'setEquityRiskPremium' ]; /** @@ -153,7 +169,11 @@ public static function openAPIFormats() 'currency' => 'getCurrency', 'currency_code' => 'getCurrencyCode', 'region' => 'getRegion', - 'sub_region' => 'getSubRegion' + 'sub_region' => 'getSubRegion', + 'rating' => 'getRating', + 'default_spread' => 'getDefaultSpread', + 'country_risk_premium' => 'getCountryRiskPremium', + 'equity_risk_premium' => 'getEquityRiskPremium' ]; /** @@ -221,6 +241,10 @@ public function __construct(array $data = null) $this->container['currency_code'] = $data['currency_code'] ?? null; $this->container['region'] = $data['region'] ?? null; $this->container['sub_region'] = $data['sub_region'] ?? null; + $this->container['rating'] = $data['rating'] ?? null; + $this->container['default_spread'] = $data['default_spread'] ?? null; + $this->container['country_risk_premium'] = $data['country_risk_premium'] ?? null; + $this->container['equity_risk_premium'] = $data['equity_risk_premium'] ?? null; } /** @@ -438,6 +462,102 @@ public function setSubRegion($sub_region) return $this; } + + /** + * Gets rating + * + * @return string|null + */ + public function getRating() + { + return $this->container['rating']; + } + + /** + * Sets rating + * + * @param string|null $rating Moody's credit risk rating. + * + * @return self + */ + public function setRating($rating) + { + $this->container['rating'] = $rating; + + return $this; + } + + /** + * Gets default_spread + * + * @return float|null + */ + public function getDefaultSpread() + { + return $this->container['default_spread']; + } + + /** + * Sets default_spread + * + * @param float|null $default_spread Default spread + * + * @return self + */ + public function setDefaultSpread($default_spread) + { + $this->container['default_spread'] = $default_spread; + + return $this; + } + + /** + * Gets country_risk_premium + * + * @return float|null + */ + public function getCountryRiskPremium() + { + return $this->container['country_risk_premium']; + } + + /** + * Sets country_risk_premium + * + * @param float|null $country_risk_premium Country risk premium + * + * @return self + */ + public function setCountryRiskPremium($country_risk_premium) + { + $this->container['country_risk_premium'] = $country_risk_premium; + + return $this; + } + + /** + * Gets equity_risk_premium + * + * @return float|null + */ + public function getEquityRiskPremium() + { + return $this->container['equity_risk_premium']; + } + + /** + * Sets equity_risk_premium + * + * @param float|null $equity_risk_premium Equity risk premium + * + * @return self + */ + public function setEquityRiskPremium($equity_risk_premium) + { + $this->container['equity_risk_premium'] = $equity_risk_premium; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/EarningResult.php b/lib/Model/EarningResult.php index 3bb74b7..5db1077 100644 --- a/lib/Model/EarningResult.php +++ b/lib/Model/EarningResult.php @@ -404,7 +404,7 @@ public function getYear() /** * Sets year * - * @param int|null $year Earnings year. + * @param int|null $year Fiscal year. * * @return self */ @@ -428,7 +428,7 @@ public function getQuarter() /** * Sets quarter * - * @param int|null $quarter Earnings quarter. + * @param int|null $quarter Fiscal quarter. * * @return self */ diff --git a/lib/Model/EarningsEstimatesInfo.php b/lib/Model/EarningsEstimatesInfo.php index d69ea8a..7d2d634 100644 --- a/lib/Model/EarningsEstimatesInfo.php +++ b/lib/Model/EarningsEstimatesInfo.php @@ -63,7 +63,9 @@ class EarningsEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSeriali 'eps_high' => 'float', 'eps_low' => 'float', 'number_analysts' => 'int', - 'period' => '\DateTime' + 'period' => '\DateTime', + 'year' => 'int', + 'quarter' => 'int' ]; /** @@ -78,7 +80,9 @@ class EarningsEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSeriali 'eps_high' => 'float', 'eps_low' => 'float', 'number_analysts' => 'int64', - 'period' => 'date' + 'period' => 'date', + 'year' => 'int64', + 'quarter' => 'int64' ]; /** @@ -112,7 +116,9 @@ public static function openAPIFormats() 'eps_high' => 'epsHigh', 'eps_low' => 'epsLow', 'number_analysts' => 'numberAnalysts', - 'period' => 'period' + 'period' => 'period', + 'year' => 'year', + 'quarter' => 'quarter' ]; /** @@ -125,7 +131,9 @@ public static function openAPIFormats() 'eps_high' => 'setEpsHigh', 'eps_low' => 'setEpsLow', 'number_analysts' => 'setNumberAnalysts', - 'period' => 'setPeriod' + 'period' => 'setPeriod', + 'year' => 'setYear', + 'quarter' => 'setQuarter' ]; /** @@ -138,7 +146,9 @@ public static function openAPIFormats() 'eps_high' => 'getEpsHigh', 'eps_low' => 'getEpsLow', 'number_analysts' => 'getNumberAnalysts', - 'period' => 'getPeriod' + 'period' => 'getPeriod', + 'year' => 'getYear', + 'quarter' => 'getQuarter' ]; /** @@ -203,6 +213,8 @@ public function __construct(array $data = null) $this->container['eps_low'] = $data['eps_low'] ?? null; $this->container['number_analysts'] = $data['number_analysts'] ?? null; $this->container['period'] = $data['period'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -348,6 +360,54 @@ public function setPeriod($period) return $this; } + + /** + * Gets year + * + * @return int|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int|null $year Fiscal year. + * + * @return self + */ + public function setYear($year) + { + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets quarter + * + * @return int|null + */ + public function getQuarter() + { + return $this->container['quarter']; + } + + /** + * Sets quarter + * + * @param int|null $quarter Fiscal quarter. + * + * @return self + */ + public function setQuarter($quarter) + { + $this->container['quarter'] = $quarter; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/EbitEstimatesInfo.php b/lib/Model/EbitEstimatesInfo.php index 7cf80ae..69433e7 100644 --- a/lib/Model/EbitEstimatesInfo.php +++ b/lib/Model/EbitEstimatesInfo.php @@ -63,7 +63,9 @@ class EbitEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'ebit_high' => 'float', 'ebit_low' => 'float', 'number_analysts' => 'int', - 'period' => '\DateTime' + 'period' => '\DateTime', + 'year' => 'int', + 'quarter' => 'int' ]; /** @@ -78,7 +80,9 @@ class EbitEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'ebit_high' => 'float', 'ebit_low' => 'float', 'number_analysts' => 'int64', - 'period' => 'date' + 'period' => 'date', + 'year' => 'int64', + 'quarter' => 'int64' ]; /** @@ -112,7 +116,9 @@ public static function openAPIFormats() 'ebit_high' => 'ebitHigh', 'ebit_low' => 'ebitLow', 'number_analysts' => 'numberAnalysts', - 'period' => 'period' + 'period' => 'period', + 'year' => 'year', + 'quarter' => 'quarter' ]; /** @@ -125,7 +131,9 @@ public static function openAPIFormats() 'ebit_high' => 'setEbitHigh', 'ebit_low' => 'setEbitLow', 'number_analysts' => 'setNumberAnalysts', - 'period' => 'setPeriod' + 'period' => 'setPeriod', + 'year' => 'setYear', + 'quarter' => 'setQuarter' ]; /** @@ -138,7 +146,9 @@ public static function openAPIFormats() 'ebit_high' => 'getEbitHigh', 'ebit_low' => 'getEbitLow', 'number_analysts' => 'getNumberAnalysts', - 'period' => 'getPeriod' + 'period' => 'getPeriod', + 'year' => 'getYear', + 'quarter' => 'getQuarter' ]; /** @@ -203,6 +213,8 @@ public function __construct(array $data = null) $this->container['ebit_low'] = $data['ebit_low'] ?? null; $this->container['number_analysts'] = $data['number_analysts'] ?? null; $this->container['period'] = $data['period'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -348,6 +360,54 @@ public function setPeriod($period) return $this; } + + /** + * Gets year + * + * @return int|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int|null $year Fiscal year. + * + * @return self + */ + public function setYear($year) + { + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets quarter + * + * @return int|null + */ + public function getQuarter() + { + return $this->container['quarter']; + } + + /** + * Sets quarter + * + * @param int|null $quarter Fiscal quarter. + * + * @return self + */ + public function setQuarter($quarter) + { + $this->container['quarter'] = $quarter; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/EbitdaEstimatesInfo.php b/lib/Model/EbitdaEstimatesInfo.php index 24725dc..d645400 100644 --- a/lib/Model/EbitdaEstimatesInfo.php +++ b/lib/Model/EbitdaEstimatesInfo.php @@ -63,7 +63,9 @@ class EbitdaEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializa 'ebitda_high' => 'float', 'ebitda_low' => 'float', 'number_analysts' => 'int', - 'period' => '\DateTime' + 'period' => '\DateTime', + 'year' => 'int', + 'quarter' => 'int' ]; /** @@ -78,7 +80,9 @@ class EbitdaEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializa 'ebitda_high' => 'float', 'ebitda_low' => 'float', 'number_analysts' => 'int64', - 'period' => 'date' + 'period' => 'date', + 'year' => 'int64', + 'quarter' => 'int64' ]; /** @@ -112,7 +116,9 @@ public static function openAPIFormats() 'ebitda_high' => 'ebitdaHigh', 'ebitda_low' => 'ebitdaLow', 'number_analysts' => 'numberAnalysts', - 'period' => 'period' + 'period' => 'period', + 'year' => 'year', + 'quarter' => 'quarter' ]; /** @@ -125,7 +131,9 @@ public static function openAPIFormats() 'ebitda_high' => 'setEbitdaHigh', 'ebitda_low' => 'setEbitdaLow', 'number_analysts' => 'setNumberAnalysts', - 'period' => 'setPeriod' + 'period' => 'setPeriod', + 'year' => 'setYear', + 'quarter' => 'setQuarter' ]; /** @@ -138,7 +146,9 @@ public static function openAPIFormats() 'ebitda_high' => 'getEbitdaHigh', 'ebitda_low' => 'getEbitdaLow', 'number_analysts' => 'getNumberAnalysts', - 'period' => 'getPeriod' + 'period' => 'getPeriod', + 'year' => 'getYear', + 'quarter' => 'getQuarter' ]; /** @@ -203,6 +213,8 @@ public function __construct(array $data = null) $this->container['ebitda_low'] = $data['ebitda_low'] ?? null; $this->container['number_analysts'] = $data['number_analysts'] ?? null; $this->container['period'] = $data['period'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -348,6 +360,54 @@ public function setPeriod($period) return $this; } + + /** + * Gets year + * + * @return int|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int|null $year Fiscal year. + * + * @return self + */ + public function setYear($year) + { + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets quarter + * + * @return int|null + */ + public function getQuarter() + { + return $this->container['quarter']; + } + + /** + * Sets quarter + * + * @param int|null $quarter Fiscal quarter. + * + * @return self + */ + public function setQuarter($quarter) + { + $this->container['quarter'] = $quarter; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/IndicesConstituents.php b/lib/Model/IndicesConstituents.php index 9756c92..1bddc61 100644 --- a/lib/Model/IndicesConstituents.php +++ b/lib/Model/IndicesConstituents.php @@ -60,7 +60,8 @@ class IndicesConstituents implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'symbol' => 'string', - 'constituents' => 'string[]' + 'constituents' => 'string[]', + 'constituents_breakdown' => '\Finnhub\Model\IndicesConstituentsBreakdown[]' ]; /** @@ -72,7 +73,8 @@ class IndicesConstituents implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'symbol' => null, - 'constituents' => null + 'constituents' => null, + 'constituents_breakdown' => null ]; /** @@ -103,7 +105,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'symbol' => 'symbol', - 'constituents' => 'constituents' + 'constituents' => 'constituents', + 'constituents_breakdown' => 'constituentsBreakdown' ]; /** @@ -113,7 +116,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'symbol' => 'setSymbol', - 'constituents' => 'setConstituents' + 'constituents' => 'setConstituents', + 'constituents_breakdown' => 'setConstituentsBreakdown' ]; /** @@ -123,7 +127,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'symbol' => 'getSymbol', - 'constituents' => 'getConstituents' + 'constituents' => 'getConstituents', + 'constituents_breakdown' => 'getConstituentsBreakdown' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['symbol'] = $data['symbol'] ?? null; $this->container['constituents'] = $data['constituents'] ?? null; + $this->container['constituents_breakdown'] = $data['constituents_breakdown'] ?? null; } /** @@ -258,6 +264,30 @@ public function setConstituents($constituents) return $this; } + + /** + * Gets constituents_breakdown + * + * @return \Finnhub\Model\IndicesConstituentsBreakdown[]|null + */ + public function getConstituentsBreakdown() + { + return $this->container['constituents_breakdown']; + } + + /** + * Sets constituents_breakdown + * + * @param \Finnhub\Model\IndicesConstituentsBreakdown[]|null $constituents_breakdown Array of constituents' details. + * + * @return self + */ + public function setConstituentsBreakdown($constituents_breakdown) + { + $this->container['constituents_breakdown'] = $constituents_breakdown; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/IndicesConstituentsBreakdown.php b/lib/Model/IndicesConstituentsBreakdown.php new file mode 100644 index 0000000..56bff9e --- /dev/null +++ b/lib/Model/IndicesConstituentsBreakdown.php @@ -0,0 +1,470 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IndicesConstituentsBreakdown implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndicesConstituentsBreakdown'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'symbol' => 'string', + 'name' => 'string', + 'isin' => 'string', + 'cusip' => 'string', + 'share_class_figi' => 'string', + 'weight' => '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_class_figi' => null, + 'weight' => '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_class_figi' => 'shareClassFIGI', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'symbol' => 'setSymbol', + 'name' => 'setName', + 'isin' => 'setIsin', + 'cusip' => 'setCusip', + 'share_class_figi' => 'setShareClassFigi', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'symbol' => 'getSymbol', + 'name' => 'getName', + 'isin' => 'getIsin', + 'cusip' => 'getCusip', + 'share_class_figi' => 'getShareClassFigi', + 'weight' => 'getWeight' + ]; + + /** + * 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_class_figi'] = $data['share_class_figi'] ?? null; + $this->container['weight'] = $data['weight'] ?? 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 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_class_figi + * + * @return string|null + */ + public function getShareClassFigi() + { + return $this->container['share_class_figi']; + } + + /** + * Sets share_class_figi + * + * @param string|null $share_class_figi Global Share Class FIGI. + * + * @return self + */ + public function setShareClassFigi($share_class_figi) + { + $this->container['share_class_figi'] = $share_class_figi; + + return $this; + } + + /** + * Gets weight + * + * @return float|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param float|null $weight Weight. + * + * @return self + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + 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/MarketHoliday.php b/lib/Model/MarketHoliday.php new file mode 100644 index 0000000..d264cb5 --- /dev/null +++ b/lib/Model/MarketHoliday.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MarketHoliday implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketHoliday'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'timezone' => 'string', + 'exchange' => 'string', + 'data' => '\Finnhub\Model\MarketHolidayData[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'timezone' => null, + 'exchange' => 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 = [ + 'timezone' => 'timezone', + 'exchange' => 'exchange', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timezone' => 'setTimezone', + 'exchange' => 'setExchange', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timezone' => 'getTimezone', + 'exchange' => 'getExchange', + '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['timezone'] = $data['timezone'] ?? null; + $this->container['exchange'] = $data['exchange'] ?? 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 timezone + * + * @return string|null + */ + public function getTimezone() + { + return $this->container['timezone']; + } + + /** + * Sets timezone + * + * @param string|null $timezone Timezone. + * + * @return self + */ + public function setTimezone($timezone) + { + $this->container['timezone'] = $timezone; + + return $this; + } + + /** + * Gets exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange Exchange. + * + * @return self + */ + public function setExchange($exchange) + { + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets data + * + * @return \Finnhub\Model\MarketHolidayData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Finnhub\Model\MarketHolidayData[]|null $data Array of holidays. + * + * @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/MarketHolidayData.php b/lib/Model/MarketHolidayData.php new file mode 100644 index 0000000..2914bf8 --- /dev/null +++ b/lib/Model/MarketHolidayData.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MarketHolidayData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketHolidayData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_name' => 'string', + 'at_date' => 'string', + 'trading_hour' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_name' => null, + 'at_date' => null, + 'trading_hour' => 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 = [ + 'event_name' => 'eventName', + 'at_date' => 'atDate', + 'trading_hour' => 'tradingHour' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_name' => 'setEventName', + 'at_date' => 'setAtDate', + 'trading_hour' => 'setTradingHour' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_name' => 'getEventName', + 'at_date' => 'getAtDate', + 'trading_hour' => 'getTradingHour' + ]; + + /** + * 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['event_name'] = $data['event_name'] ?? null; + $this->container['at_date'] = $data['at_date'] ?? null; + $this->container['trading_hour'] = $data['trading_hour'] ?? 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 event_name + * + * @return string|null + */ + public function getEventName() + { + return $this->container['event_name']; + } + + /** + * Sets event_name + * + * @param string|null $event_name Holiday's name. + * + * @return self + */ + public function setEventName($event_name) + { + $this->container['event_name'] = $event_name; + + return $this; + } + + /** + * Gets at_date + * + * @return string|null + */ + public function getAtDate() + { + return $this->container['at_date']; + } + + /** + * Sets at_date + * + * @param string|null $at_date Date. + * + * @return self + */ + public function setAtDate($at_date) + { + $this->container['at_date'] = $at_date; + + return $this; + } + + /** + * Gets trading_hour + * + * @return string|null + */ + public function getTradingHour() + { + return $this->container['trading_hour']; + } + + /** + * Sets trading_hour + * + * @param string|null $trading_hour Trading hours for this day if the market is partially closed only. + * + * @return self + */ + public function setTradingHour($trading_hour) + { + $this->container['trading_hour'] = $trading_hour; + + 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/MarketStatus.php b/lib/Model/MarketStatus.php new file mode 100644 index 0000000..7336e70 --- /dev/null +++ b/lib/Model/MarketStatus.php @@ -0,0 +1,470 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MarketStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MarketStatus'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'exchange' => 'string', + 'timezone' => 'string', + 'session' => 'string', + 'holiday' => 'string', + 'is_open' => 'bool', + 't' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'exchange' => null, + 'timezone' => null, + 'session' => null, + 'holiday' => null, + 'is_open' => null, + 't' => '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 = [ + 'exchange' => 'exchange', + 'timezone' => 'timezone', + 'session' => 'session', + 'holiday' => 'holiday', + 'is_open' => 'isOpen', + 't' => 't' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exchange' => 'setExchange', + 'timezone' => 'setTimezone', + 'session' => 'setSession', + 'holiday' => 'setHoliday', + 'is_open' => 'setIsOpen', + 't' => 'setT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exchange' => 'getExchange', + 'timezone' => 'getTimezone', + 'session' => 'getSession', + 'holiday' => 'getHoliday', + 'is_open' => 'getIsOpen', + 't' => 'getT' + ]; + + /** + * 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['exchange'] = $data['exchange'] ?? null; + $this->container['timezone'] = $data['timezone'] ?? null; + $this->container['session'] = $data['session'] ?? null; + $this->container['holiday'] = $data['holiday'] ?? null; + $this->container['is_open'] = $data['is_open'] ?? null; + $this->container['t'] = $data['t'] ?? 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 exchange + * + * @return string|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param string|null $exchange Exchange. + * + * @return self + */ + public function setExchange($exchange) + { + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets timezone + * + * @return string|null + */ + public function getTimezone() + { + return $this->container['timezone']; + } + + /** + * Sets timezone + * + * @param string|null $timezone Timezone. + * + * @return self + */ + public function setTimezone($timezone) + { + $this->container['timezone'] = $timezone; + + return $this; + } + + /** + * Gets session + * + * @return string|null + */ + public function getSession() + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param string|null $session Market session. + * + * @return self + */ + public function setSession($session) + { + $this->container['session'] = $session; + + return $this; + } + + /** + * Gets holiday + * + * @return string|null + */ + public function getHoliday() + { + return $this->container['holiday']; + } + + /** + * Sets holiday + * + * @param string|null $holiday Holiday event. + * + * @return self + */ + public function setHoliday($holiday) + { + $this->container['holiday'] = $holiday; + + return $this; + } + + /** + * Gets is_open + * + * @return bool|null + */ + public function getIsOpen() + { + return $this->container['is_open']; + } + + /** + * Sets is_open + * + * @param bool|null $is_open Whether the market is open at the moment. + * + * @return self + */ + public function setIsOpen($is_open) + { + $this->container['is_open'] = $is_open; + + return $this; + } + + /** + * Gets t + * + * @return int|null + */ + public function getT() + { + return $this->container['t']; + } + + /** + * Sets t + * + * @param int|null $t Current timestamp. + * + * @return self + */ + public function setT($t) + { + $this->container['t'] = $t; + + 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/MutualFundProfileData.php b/lib/Model/MutualFundProfileData.php index a9f8de5..3582972 100644 --- a/lib/Model/MutualFundProfileData.php +++ b/lib/Model/MutualFundProfileData.php @@ -68,6 +68,7 @@ class MutualFundProfileData implements ModelInterface, ArrayAccess, \JsonSeriali 'inception_date' => '\DateTime', 'description' => 'string', 'fund_family' => 'string', + 'fund_company' => 'string', 'manager' => 'string', 'status' => 'string', 'beta' => 'float', @@ -105,6 +106,7 @@ class MutualFundProfileData implements ModelInterface, ArrayAccess, \JsonSeriali 'inception_date' => 'date', 'description' => null, 'fund_family' => null, + 'fund_company' => null, 'manager' => null, 'status' => null, 'beta' => 'float', @@ -161,6 +163,7 @@ public static function openAPIFormats() 'inception_date' => 'inceptionDate', 'description' => 'description', 'fund_family' => 'fundFamily', + 'fund_company' => 'fundCompany', 'manager' => 'manager', 'status' => 'status', 'beta' => 'beta', @@ -196,6 +199,7 @@ public static function openAPIFormats() 'inception_date' => 'setInceptionDate', 'description' => 'setDescription', 'fund_family' => 'setFundFamily', + 'fund_company' => 'setFundCompany', 'manager' => 'setManager', 'status' => 'setStatus', 'beta' => 'setBeta', @@ -231,6 +235,7 @@ public static function openAPIFormats() 'inception_date' => 'getInceptionDate', 'description' => 'getDescription', 'fund_family' => 'getFundFamily', + 'fund_company' => 'getFundCompany', 'manager' => 'getManager', 'status' => 'getStatus', 'beta' => 'getBeta', @@ -317,6 +322,7 @@ public function __construct(array $data = null) $this->container['inception_date'] = $data['inception_date'] ?? null; $this->container['description'] = $data['description'] ?? null; $this->container['fund_family'] = $data['fund_family'] ?? null; + $this->container['fund_company'] = $data['fund_company'] ?? null; $this->container['manager'] = $data['manager'] ?? null; $this->container['status'] = $data['status'] ?? null; $this->container['beta'] = $data['beta'] ?? null; @@ -577,6 +583,30 @@ public function setFundFamily($fund_family) return $this; } + /** + * Gets fund_company + * + * @return string|null + */ + public function getFundCompany() + { + return $this->container['fund_company']; + } + + /** + * Sets fund_company + * + * @param string|null $fund_company Fund Company. + * + * @return self + */ + public function setFundCompany($fund_company) + { + $this->container['fund_company'] = $fund_company; + + return $this; + } + /** * Gets manager * diff --git a/lib/Model/RevenueEstimatesInfo.php b/lib/Model/RevenueEstimatesInfo.php index 29fe95a..a5ee646 100644 --- a/lib/Model/RevenueEstimatesInfo.php +++ b/lib/Model/RevenueEstimatesInfo.php @@ -63,7 +63,9 @@ class RevenueEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializ 'revenue_high' => 'float', 'revenue_low' => 'float', 'number_analysts' => 'int', - 'period' => '\DateTime' + 'period' => '\DateTime', + 'year' => 'int', + 'quarter' => 'int' ]; /** @@ -78,7 +80,9 @@ class RevenueEstimatesInfo implements ModelInterface, ArrayAccess, \JsonSerializ 'revenue_high' => 'float', 'revenue_low' => 'float', 'number_analysts' => 'int64', - 'period' => 'date' + 'period' => 'date', + 'year' => 'int64', + 'quarter' => 'int64' ]; /** @@ -112,7 +116,9 @@ public static function openAPIFormats() 'revenue_high' => 'revenueHigh', 'revenue_low' => 'revenueLow', 'number_analysts' => 'numberAnalysts', - 'period' => 'period' + 'period' => 'period', + 'year' => 'year', + 'quarter' => 'quarter' ]; /** @@ -125,7 +131,9 @@ public static function openAPIFormats() 'revenue_high' => 'setRevenueHigh', 'revenue_low' => 'setRevenueLow', 'number_analysts' => 'setNumberAnalysts', - 'period' => 'setPeriod' + 'period' => 'setPeriod', + 'year' => 'setYear', + 'quarter' => 'setQuarter' ]; /** @@ -138,7 +146,9 @@ public static function openAPIFormats() 'revenue_high' => 'getRevenueHigh', 'revenue_low' => 'getRevenueLow', 'number_analysts' => 'getNumberAnalysts', - 'period' => 'getPeriod' + 'period' => 'getPeriod', + 'year' => 'getYear', + 'quarter' => 'getQuarter' ]; /** @@ -203,6 +213,8 @@ public function __construct(array $data = null) $this->container['revenue_low'] = $data['revenue_low'] ?? null; $this->container['number_analysts'] = $data['number_analysts'] ?? null; $this->container['period'] = $data['period'] ?? null; + $this->container['year'] = $data['year'] ?? null; + $this->container['quarter'] = $data['quarter'] ?? null; } /** @@ -348,6 +360,54 @@ public function setPeriod($period) return $this; } + + /** + * Gets year + * + * @return int|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int|null $year Fiscal year. + * + * @return self + */ + public function setYear($year) + { + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets quarter + * + * @return int|null + */ + public function getQuarter() + { + return $this->container['quarter']; + } + + /** + * Sets quarter + * + * @param int|null $quarter Fiscal quarter. + * + * @return self + */ + public function setQuarter($quarter) + { + $this->container['quarter'] = $quarter; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/SentimentContent.php b/lib/Model/SentimentContent.php new file mode 100644 index 0000000..49b7526 --- /dev/null +++ b/lib/Model/SentimentContent.php @@ -0,0 +1,500 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SentimentContent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SentimentContent'; + + /** + * 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' => 'string' + ]; + + /** + * 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' => 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 = [ + '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 string|null + */ + public function getAtTime() + { + return $this->container['at_time']; + } + + /** + * Sets at_time + * + * @param string|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/SocialSentiment.php b/lib/Model/SocialSentiment.php index 3f87572..afae937 100644 --- a/lib/Model/SocialSentiment.php +++ b/lib/Model/SocialSentiment.php @@ -60,8 +60,7 @@ class SocialSentiment implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'symbol' => 'string', - 'reddit' => '\Finnhub\Model\RedditSentimentContent[]', - 'twitter' => '\Finnhub\Model\TwitterSentimentContent[]' + 'data' => '\Finnhub\Model\SentimentContent[]' ]; /** @@ -73,8 +72,7 @@ class SocialSentiment implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'symbol' => null, - 'reddit' => null, - 'twitter' => null + 'data' => null ]; /** @@ -105,8 +103,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'symbol' => 'symbol', - 'reddit' => 'reddit', - 'twitter' => 'twitter' + 'data' => 'data' ]; /** @@ -116,8 +113,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'symbol' => 'setSymbol', - 'reddit' => 'setReddit', - 'twitter' => 'setTwitter' + 'data' => 'setData' ]; /** @@ -127,8 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'symbol' => 'getSymbol', - 'reddit' => 'getReddit', - 'twitter' => 'getTwitter' + 'data' => 'getData' ]; /** @@ -189,8 +184,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['symbol'] = $data['symbol'] ?? null; - $this->container['reddit'] = $data['reddit'] ?? null; - $this->container['twitter'] = $data['twitter'] ?? null; + $this->container['data'] = $data['data'] ?? null; } /** @@ -242,49 +236,25 @@ public function setSymbol($symbol) } /** - * Gets reddit + * Gets data * - * @return \Finnhub\Model\RedditSentimentContent[]|null + * @return \Finnhub\Model\SentimentContent[]|null */ - public function getReddit() + public function getData() { - return $this->container['reddit']; + return $this->container['data']; } /** - * Sets reddit + * Sets data * - * @param \Finnhub\Model\RedditSentimentContent[]|null $reddit Reddit sentiment. + * @param \Finnhub\Model\SentimentContent[]|null $data Sentiment data. * * @return self */ - public function setReddit($reddit) + public function setData($data) { - $this->container['reddit'] = $reddit; - - return $this; - } - - /** - * Gets twitter - * - * @return \Finnhub\Model\TwitterSentimentContent[]|null - */ - public function getTwitter() - { - return $this->container['twitter']; - } - - /** - * Sets twitter - * - * @param \Finnhub\Model\TwitterSentimentContent[]|null $twitter Twitter sentiment. - * - * @return self - */ - public function setTwitter($twitter) - { - $this->container['twitter'] = $twitter; + $this->container['data'] = $data; return $this; } diff --git a/test/Model/IndicesConstituentsBreakdownTest.php b/test/Model/IndicesConstituentsBreakdownTest.php new file mode 100644 index 0000000..ba64c05 --- /dev/null +++ b/test/Model/IndicesConstituentsBreakdownTest.php @@ -0,0 +1,135 @@ +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_class_figi" + */ + public function testPropertyShareClassFigi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "weight" + */ + public function testPropertyWeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketHolidayDataTest.php b/test/Model/MarketHolidayDataTest.php new file mode 100644 index 0000000..5b12600 --- /dev/null +++ b/test/Model/MarketHolidayDataTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_name" + */ + public function testPropertyEventName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "at_date" + */ + public function testPropertyAtDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trading_hour" + */ + public function testPropertyTradingHour() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketHolidayTest.php b/test/Model/MarketHolidayTest.php new file mode 100644 index 0000000..f662c7b --- /dev/null +++ b/test/Model/MarketHolidayTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timezone" + */ + public function testPropertyTimezone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MarketStatusTest.php b/test/Model/MarketStatusTest.php new file mode 100644 index 0000000..17f049a --- /dev/null +++ b/test/Model/MarketStatusTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timezone" + */ + public function testPropertyTimezone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "session" + */ + public function testPropertySession() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "holiday" + */ + public function testPropertyHoliday() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_open" + */ + public function testPropertyIsOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "t" + */ + public function testPropertyT() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SentimentContentTest.php b/test/Model/SentimentContentTest.php new file mode 100644 index 0000000..1eb5ff2 --- /dev/null +++ b/test/Model/SentimentContentTest.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'); + } +}